I am trying to work with propositional logic using python. I have run the following program in google colaboratory.
import sympy
from sympy.abc import a,b,c
from sympy import S,simplify_logic
sympy.simplify(~a >> sympy.S.false).equals(sympy.S.true)
This results in the following error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-72f54433199b> in <module
----> 1 sympy.simplify(~a >> sympy.S.false).equals(sympy.S.true)
1 frames
/usr/local/lib/python3.7/dist-packages/sympy/logic/boolalg.py in _noop(self, other)
197
198 def _noop(self, other=None):
--> 199 raise TypeError('BooleanAtom not allowed in this context.')
200
201 __add__ = _noop
TypeError: BooleanAtom not allowed in this context.
I expected false as the output.
Changing the expression to the following did not generate an error and output False as I expected.
sympy.simplify(a >> sympy.S.false).equals(sympy.S.true)
What is the difference? I want to know if two logical expressions containing true or false are equivalent. I read the documentation here but I did not find the solution.