Comment #11 on issue 1309 by akshaysrinivasan: implement backward chaining
for rules
http://code.google.com/p/sympy/issues/detail?id=1309
I was thinking of maybe storing implications as Boolean expressions which
are always
true.
>>> i=Bool('Integer')
>>> o=Bool('Odd')
>>> e=Bool('Even')
>>> z=Bool('Zero')
>>> e=(o | e | z)
>>> (e & i) | (~e & ~i) ##Double implication e <-> i
(~Integer & ~(Odd | Zero | Even)) | ((Odd | Zero | Even) & Integer)
>>> expr=(e & i) | (~e & ~i)
>>> expr
(~Integer & ~(Odd | Zero | Even)) | ((Odd | Zero | Even) & Integer)
>>> expr.eval(Odd=True)
Integer
>>> ~o | i ##Implication o -> i
~Odd | Integer
>>> (~o | i).eval(Odd=True)
Integer
>>> (~o | i).eval(Integer=True)
1
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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-issues?hl=en
-~----------~----~----~----~------~----~------~--~---