Open gabe-nasc opened 6 years ago
I have reproduced this same issue. The minimal expression that causes this issue is 'NOT (FALSE)'
. The problem is here. The self.TRUE
and self.FALSE
instances of DualBase
are given instances not classes of _TRUE
and _FALSE
. I have come up with the following workaround:
algebra = boolean.BooleanAlgebra()
algebra.TRUE.dual = type(algebra.FALSE)
algebra.FALSE.dual = type(algebra.TRUE)
A more permanent solution would be to change the __init__
method of BooleanAlgebra
like so:
self.TRUE_class = TRUE_class or _TRUE
self.TRUE = self.TRUE_class()
self.FALSE_class = FALSE_class or _FALSE
self.FALSE = self.FALSE_class()
# they cross-reference each other
self.TRUE.dual = self.FALSE_class
self.FALSE.dual = self.TRUE_class
I've ran into a problem while using simplify with a few expressions, even though they are valid and have not apparent reason to cause these errors.
One thing I noticed is that if I remove the 'not' symbol from them, they'll work "correctly"
Cases where "TypeError: '_FALSE' object is not callable" is raised:
Cases where "TypeError: '_TRUE' object is not callable" is raised: