Le jeudi 09 juin 2011 à 07:17 -0700, Vinzent Steinberg a écrit :
> On 9 Jun., 00:04, Haz <[email protected]> wrote:
> > > Why it needs to be true or false? I don't expect the x in sin(x) to be
> > > boolean. What am I missing?
> >
> >   Nothing -- I misunderstood. Ronan may be able to shed some light:
> > -https://github.com/sympy/sympy/commit/635d89c3c53fd84cc884e0ab62dc3f0...
> 
> Apparently Ronan basically moved the implementation from Basic to a
> different class. I think it makes sense to move it to BooleanSymbol.
> We have predicates implemented for our new assumption system, if
> anyone needs this.

Yes, I only did that: I added Boolean to the base classes of Symbol so
that x & y would continue to return And(x, y). Creating BooleanSymbol
would make our model cleaner.

> 
> But on the other hand, it can be very expressive to apply boolean to
> general expressions. 0 would be false, everything else true. You could
> write things like
> 
> a = x | y = x if x else y

I'm not sure what you're suggesting here. This looks like a programming
construct, which already exists in Python: 'x or y'. If it's meant to
return a symbolic expression, I'd say too much is implicit here and we
should rather use something like If(Ne(x, 0), x, y).

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to