The type of returned objects of simplify_logic

Viewed 26

According to the document, simplify_logic returns Or or And Object. Am I using it incorrectly?(Are there any restrictions on arguments?)



import sympy
from sympy import S
from sympy.logic.boolalg import Equivalent,simplify_logic
from sympy.abc import a,b,c

test = simplify_logic(Equivalent(a >> (~a | a) , S.true))

tor = type(a | b)
tand= type(a &b)

print(test)

print()

print(tor)
print(tand)

print()

print(isinstance(test,tor)) # expected: True
isinstance(test,tand) # expected: True

print()

print(type(simplify_logic(a)))

The following is the output of the code.

True

Or
And

False
False

<class 'sympy.core.symbol.Symbol'>
0 Answers
Related