ANTLR - Boolean satisfiabilty
问题 I have a ANTLR expression parser which can evaluate expressions of the form ( A & ( B | C ) ) using the generated visitor. A , B and C can take any of the 2 values true or false . However I am faced with a challenge of finding all combinations of A,B and C for which the expression is true. I tried to solve this by the following method. Evaluate the expression for the 3 variables taking true and false each This comes to 8 combinations since 2 ^ 3 is 8 I evaluate giving values like 000, 001,