The answer is negative:
Consider A || B && C || D
A || B && C || D
A || B && C || D
, which has a truth table:
A | B | C | D | 0 | 0 | 0 | 0 | 0 0 | 0 | 0 | 1 | 0 0 | 0 | 1 | 0 | 0 0 | 0 | 1 | 1 | 0 0 | 1 | 0 | 0 | 0 0 | 1 | 0 | 1 | 1 0 | 1 | 1 | 0 | 1 0 | 1 | 1 | 1 | 1 1 | 0 | 0 | 0 | 0 1 | 0 | 0 | 1 | 1 1 | 0 | 1 | 0 | 1 1 | 0 | 1 | 1 | 1 1 | 1 | 0 | 0 | 0 1 | 1 | 0 | 1 | 1 1 | 1 | 1 | 0 | 1 1 | 1 | 1 | 1 | 1
If one could consistently evaluate, there would have to be the last expression, which would be one of two cases:
Case 1:
X || Y
X || Y
such that Y
is one of A,B,C,D
, and X is any consecutive Boolean expression.
Now, since in A,B,C,D
there is no variable where the whole expression is true when this variable is true, none of:
X || A X || B X || C X || D
may be the last operation in the expression (for any X).
Case 2:
X && Y
: such that Y
is one of A,B,C,D
, and X is any consecutive Boolean expression.
Now, since in A,B,C,D
there is no variable where the whole expression is false when this variable is false, none of:
X && A X && B X && C X && D
may be the last operation in the expression (for any X).
Therefore, you cannot write (A || B) && (C || D)
in this way.
The reason you can do this for some expressions, for example: A && ( B || C)
becoming C || B && A
C || B && A
, is that this expression can be constructed recursively from expressions that have one of the two properties above:
IE
The truth table for A && ( B || C)
:
A | B | C | 0 | 0 | 0 | 0 0 | 0 | 1 | 0 0 | 1 | 0 | 0 0 | 1 | 1 | 0 1 | 0 | 0 | 0 1 | 0 | 1 | 1 1 | 1 | 0 | 1 1 | 1 | 1 | 1
What we can quickly see is the property that it is false when A is 0. Thus, our expression can be X && A
Then we select A from the truth table and look only at the lines where A is 1, this is the original:
B | C 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1
Who has the property that it is true when B is 1 (or C, we can choose here). Thus, we can write the expression as
X || B
X || B
, and the whole expression becomes X || B && A
X || B && A
Then we again reduce the table to the part where B is 0, and we get:
C 0 | 0 1 | 1
X is just C. Thus, the final expression is C || B && A
C || B && A