[sage-support] Boolean Function

2013-04-18 Thread Santanu Sarkar
Dear all, I have a Boolean polynomial f with huge degree variables. Also it has huge number of monomials. I want to delete all monomials from f with degree greater than 20. For that I have written the following approach. V=BooleanPolynomialRing(4,['r%d'%(i) for i in range(4)])

[sage-support] Boolean function evalution

2012-07-17 Thread virensule
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

Re: [sage-support] Boolean function evalution

2012-07-17 Thread David Joyner
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

Re: [sage-support] Boolean function evalution

2012-07-17 Thread Martin Albrecht
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

Re: [sage-support] Boolean function evalution

2012-07-17 Thread Virendra Sule
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

Re: [sage-support] Boolean function evalution

2012-07-17 Thread Virendra Sule
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)

Re: [sage-support] Boolean function evalution

2012-07-17 Thread David Joyner
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:

Re: Re: [sage-support] Boolean function evalution

2012-07-17 Thread Martin Albrecht
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

[sage-support] Boolean function

2011-12-11 Thread Santanu Sarkar
I have a set of Boolean functions like A[0]=x1*x2+x3*x4 A[1]=x3+x7+x10 A[2]=x19*x36+x43*x45*x50 over variables x_1,.. x_50. But each function contains at most 10 variables. I want to calculate the balancedness of each function. I have done the following: from sage.crypto.boolean_function import