Ask Your Question

Revision history [back]

You can use Python dictionaries in the substitute method, for example:

sage: R = BooleanPolynomialRing(5,'x') ; R
Boolean PolynomialRing in x0, x1, x2, x3, x4
sage: R.inject_variables()
Defining x0, x1, x2, x3, x4
sage: P = R.random_element() ; P
x0*x1 + x0*x4 + x0 + x1*x2 + x1*x4

sage: a = x0
sage: mydict = {a:0} ; mydict
{x0: 0}
sage: P.substitute(mydict)
x1*x2 + x1*x4