Expression processing order

The processing order of expressions is fixed.

As in mathematical equations, items inside parentheses are always resolved before other comparisons. Next, the operands are processed by type: first the negations, then intersections, and last the unions.

For example, the expression A ⋃ ~(B ⋃ C) ⋂ D is processed as follows:
  1. The formula between parentheses is solved first (the union of B and C). If we replace this result with X, the expression becomes A ⋃ ~X ⋂ D.
  2. The negation is processed next, inverting the value of X. If we replace this result with Y, the expression becomes A ⋃ Y ⋂ D.
  3. Next, the intersection between Y and D is resolved. If we replace this result with Z, the expression becomes A ⋃ Z.
  4. Finally, the union of A and Z yields the actual value that the expression represents (the full contents of both A and Z).

As shown here, the order in which the operand-value combinations appear in the expression have no significance to the order of processing. The only way to change the processing order is by using parentheses as explained next.