Equivalence of boolean expressions
Posted
by Iulian Serbanoiu
on Stack Overflow
See other posts from Stack Overflow
or by Iulian Serbanoiu
Published on 2010-06-03T11:42:15Z
Indexed on
2010/06/03
11:44 UTC
Read the original article
Hit count: 349
Hello,
I have a problem that consist in comparing boolean expressions ( OR is +, AND is * ). To be more precise here is an example:
I have the following expression: "A+B+C" and I want to compare it with "B+A+C". Comparing it like string is not a solution - it will tell me that the expressions don't match which is of course false. Any ideas on how to compare those expressions?
Any ideas about how can I tackle this problem? I accept any kind of suggestions but (as a note) the final code in my application will be written in C++ (C accepted of course).
An normal expression could contain also parenthesis:
(A * B * C) + D or A+B*(C+D)+X*Y
Thanks in advance,
Iulian
© Stack Overflow or respective owner