Open suguman opened 3 years ago
@suguman re:
I believe the reason is that simplify() does not implement simplifications on 0 and 1.
I get this: what does not work there?
>>> import boolean
>>> A = boolean.BooleanAlgebra()
>>> bar=A.parse(" ((~(0))&(0))&((0)|(0)) " )
>>> bar
AND(AND(NOT(FALSE), FALSE), OR(FALSE, FALSE))
>>> bar.simplify()
FALSE
Note that 0 and 1 are interpreted as the TRUE and FALSE built-in symbols respectively
I am attempting to determine whether a formula evaluates to True/False given an assignment to all symbols. For this I am substituting symbols with 0 or 1 depending on the truth assignment one by one. At the end, I obtain a formula consisting of 0 and 1s only. For example, I could get a formula like " ((~(0))&(0))&((0)|(0)) " after assigning the truth assignment.
The code is throwing an error when I attempt to simplify() the above formula (in 0s and 1s only). I believe the reason is that simplify() does not implement simplifications on 0 and 1.