I want to verify, that one boolean expression is mathematically equivalent to another.
Let's say, we have 3 boolean variables: a, b, c
.
The expression X = ((a || b) && !c)
.
Then I rewrite some code, and it turns out, that Y = !(((!a && !b) || c) && true)
.
My questions:
- Is there a possibility to verify on the fly, that expressions X and Y are the same for all input?
- Is there a possibility to compact the expressions, so that Y gets simplified?
- I want to see the truth table for X, Y with inputs a, b, c.
Disclaimer: I know, that i can write a program for different inputs of the variables and the output of X and Y. I thought more of a syntax parser, that might probably also parse other variables (e.g. n<100
) instead of just a
, so that I can paste code of if-statements as input.
Greetings and thanks for your thoughts!