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) substitutes this value in f. So for the specific random
f chosen at the time this function is yz. What does the call f(*G) mean?

Virendra

On Tue, Jul 17, 2012 at 7:38 PM, Martin Albrecht <
martinralbre...@googlemail.com> wrote:

> 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.subs        f.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 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 do I compute f(g())
> > composition?
> >
> > Can someone help please?
> >
> > Thanks in advance.
> > Virendra
>
> Cheers,
> Martin
>
> --
> name: Martin Albrecht
> _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
> _www: http://martinralbrecht.wordpress.com/
> _jab: martinralbre...@jabber.ccc.de
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
Virendra Sule
Professor
Dept. of Electrical Engg.
IIT Bombay
Powai, Mumbai 400076.

Tel: (O): 022 25767492

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to