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 <wdjoy...@gmail.com> wrote: > 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 g=f(evaluated when x[0]=1)? > > > > Also if g is another function defined similarly, how do I compute f(g()) > > composition? > > > > sage: from sage.crypto.boolean_function import * > sage: R = BooleanPolynomialRing(3, "x") > sage: x = R.gens() > sage: f = BooleanFunction(x[0]*x[1]+x[1]*x[2]+x[1]+1) > sage: f.[tab] > > gives the methods implemented for the instances of > BooleanFunction. Subfunctions of Boolean functions are not > implemented, at least not yet as far as I know. > > I'm not sure what you mean by composition of > functions > > f:GF(2)^n -> GF(2) and g:GF(2)^n -> GF(2). > > Maybe you can do what you want using lambda functions? > > > > > > Can someone help please? > > > > Thanks in advance. > > Virendra > > > > -- > > 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 > > -- > 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