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

printAsSLP -- print a straight-line program

Description

Prints a straight-line program evaluating the given output expressions in terms of the specified input variables.

i1 : declareVariable \ {x,y}

o1 = {x, y}

o1 : List
i2 : f = (x+y)^2 - x*y

o2 = (((x + y) * (x + y)) + (-1 * (x * y)))

o2 : SumGate
i3 : printAsSLP({x,y},{f})
X0 <== x
X1 <== y
G0 <== X0 + X1
G1 <== G0 * G0
C0 <== -1
G2 <== X0 * X1
G3 <== C0 * G2
G4 <== G1 + G3
output:
G4

See also

Ways to use printAsSLP:

  • printAsSLP(GateMatrix,GateMatrix)
  • printAsSLP(List,List)

For the programmer

The object printAsSLP is a method function.


The source of this document is in SLPexpressions/doc.m2:122:0.