Hi Prakash,

On 2015-12-06, Nils Bruin <[email protected]> wrote:
> On Saturday, December 5, 2015 at 10:49:46 PM UTC-5, Prakash Dey wrote:
>>
>>
>> x,y -----> symbolic boolean variables
>> f -------> symbolic Boolean function
>>
>> Does
>
> sage: P.<x,y>=BooleanPolynomialRing();
> sage: f=x+y
> sage: f(1,0)
> 1
> sage: f(1,1)
> 0
> sage: f+x
> y
>
> do the trick for you?

One thing to be aware about: The "function" f in Nils' example is not a
*symbolic* function and x,y are not *symbolic* variables, in the technical
sense:

  sage: P.<x,y> = BooleanPolynomialRing()
  sage: f = x+y
  sage: type(f)
  <type 'sage.rings.polynomial.pbori.BooleanPolynomial'>
  sage: type(x)
  <type 'sage.rings.polynomial.pbori.BooleanPolynomial'>

in contrast to

  sage: z=var('z')
  sage: type(z)
  <type 'sage.symbolic.expression.Expression'>
  sage: g(z) = z+1
  sage: type(g)
  <type 'sage.symbolic.expression.Expression'>

But when programming in Python, what should matter is how things behave,
not what they are (i.e. what their type is).
If f behaves like a function and x behaves like a symbolic varialbe,
then you will probably be able to work with it.

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to