bastikr / boolean.py

Implements boolean algebra in one module.
BSD 2-Clause "Simplified" License
76 stars 34 forks source link

Same operands in AND expression after simplification #111

Open tomas789 opened 1 year ago

tomas789 commented 1 year ago

When simplifying the expression

AND(TRUE, OR(OR(symbol("x0"), FALSE), AND(symbol("x2"), TRUE), NOT(TRUE)), AND(AND(TRUE, TRUE, symbol("x2"), TRUE), NOT(symbol("x0"))))

Which produces the expression

AND(NOT(Symbol('x0')), Symbol('x2'), Symbol('x2'))

Which could be trivially simplified to

AND(NOT(Symbol('x0')), Symbol('x2'))
tomas789 commented 1 year ago

I can confirm that the PR https://github.com/bastikr/boolean.py/pull/113 also fixes this issue.