Macaulay2 » Documentation
Packages » SLPexpressions :: makeInterpretedSLProgram
next | previous | forward | backward | up | index | toc

makeInterpretedSLProgram -- create a straight-line program

Synopsis

Description

This method returns an object of type InterpretedSLProgram, which encodes a method for evaluating an algebraic circuit.

i1 : declareVariable X; declareVariable C;
i3 : XpC = X+C

o3 = (X + C)

o3 : SumGate
i4 : XXC = productGate{X,X,C}

o4 = (X * X * C)

o4 : ProductGate
i5 : detXCCX = detGate{{X,C},{C,X}}

o5 = det| X C |
        | C X |

o5 : DetGate
i6 : XoC = X/C

     X
o6 = -
     C

o6 : DivideGate
i7 : slp = makeInterpretedSLProgram(matrix{{C,X}},matrix{{XXC,detXCCX,XoC,XpC+2}})

o7 = InterpretedSLProgram{cache => CacheTable{}              }
                          "constant positions" => {-3}
                          "constants" => | 2 |
                          "number of inputs" => 2
                          "number of outputs" => 4
                          RawSLProgram => SLProgram (
                                            consts+vars: 3
                                            noninput nodes: 5
                                            output nodes: 4
                                            )

                          "variable positions" => {-1, -2}

o7 : InterpretedSLProgram

See also

Ways to use makeInterpretedSLProgram :

For the programmer

The object makeInterpretedSLProgram is a method function.