What exactly happens?  The way things are now, there isn't really any
type checking in And or Or, so you can already do things like
And(sin(x), x), i.e., just using regular Functions.  All subclassing
from Boolean does is make it so that operations like & and | work (if
you look at the source of Boolean, that is all it does is define those
methods).

For example:

In [142]: class Test(Function, Boolean):
   .....:     pass
   .....:

In [147]: Test(x) & x
Out[147]: x ∧ Test(x)

In [148]: (Test(x) & x).subs(x, y)
Out[148]: y ∧ Test(y)

Aaron Meurer

On Fri, Feb 15, 2013 at 2:18 AM, Roderick de Nijs <[email protected]> wrote:
> Hello,
>
> I am trying to get the functionality of the logic module (conversion to cnf)
> where each symbol represents an atom in the first order logic sense. That
> means, each atom would contain arguments that can be used for pattern
> matching.
> Unfortunately, defining a class C(Function,Boolean) allows to do the
> conversion to cnf but somehow destroys the Function functionalities.
> What would be the proper way of getting such functionality in sympy?
>
> Thanks for this great project!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" 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/sympy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to