How do I evaluate and compose Boolean functions in Boolean polynomial ring?
For example I have
R=BooleanPolynomialRing(3,x)
x=R.gens()
f=BooleanFunction(x[0]*x[1]+x[1]*x[2]+x[1]+1)
Now how do I find the function g=f(evaluated when x[0]=1)?
Also if g is another function defined similarly, how
On Tue, Jul 17, 2012 at 4:26 AM, virensule viren.s...@gmail.com wrote:
How do I evaluate and compose Boolean functions in Boolean polynomial ring?
For example I have
R=BooleanPolynomialRing(3,x)
x=R.gens()
f=BooleanFunction(x[0]*x[1]+x[1]*x[2]+x[1]+1)
Now how do I find the function
sage: R.x,y,z = BooleanPolynomialRing(3)
sage: f = R.random_element()
sage: G = [R.random_element() for _ in range(3)]
sage: f.sub
f.subsf.substitute
sage: f.subs(x=1)
y*z
sage: f(*G)
x*y + x*z + x + y + 1
On Tuesday 17 Jul 2012, virensule wrote:
How do I evaluate and compose
Thanks David. This will certainly help.
By composition f(g()) I mean if f(x,y) is a Boolean function in two
variables and g(z) is a Boolean function in one variable how to compute the
Boolean function f(g(z)y) as a function of z,y.
Virendra
On Tue, Jul 17, 2012 at 3:44 PM, David Joyner
Thanks Martin for the help. I find it very difficult to search for help in
SAGE. Students in my class have written a lot of code in SAGE for number
theory calculations but none for Boolean functions.
In the following what is function f, it looks like a random element of R. I
suppose f.subs(x=1)
On Tue, Jul 17, 2012 at 12:58 PM, Virendra Sule viren.s...@gmail.com wrote:
Thanks David. This will certainly help.
There are lots of examples of Boolean function computations in the *.pdf
file and the *.sage file from a student's recent undergrad thesis:
Hi,
On Tuesday 17 Jul 2012, Virendra Sule wrote:
Thanks Martin for the help. I find it very difficult to search for help in
SAGE. Students in my class have written a lot of code in SAGE for number
theory calculations but none for Boolean functions.
In the following what is function f, it