Boolean Expressions

<Boolean expression>

──┬───────┬─ <Boolean primary> ────────────────────────────────────────►
  └─ NOT ─┘
►─┬─────────────────────────────────────────────┬──────────────────────┤
  │ ┌◄────────────────────────────────────────┐ │
  └─┴─┬─ AND ─┬─┬───────┬─ <Boolean primary> ─┴─┘
      ├─ OR ──┤ └─ NOT ─┘
      ├─ IMP ─┤
      └─ EQV ─┘

Explanation

The relational operators in a Boolean expression have the following meanings.

Operator

Meaning

NOT

Returns the opposite of the truth value of the Boolean primary it precedes.

AND

Returns TRUE if both Boolean primaries are TRUE.

OR

Returns TRUE if either or both of the Boolean primaries are TRUE.

IMP

Returns TRUE unless the first Boolean primary is TRUE and the second one is FALSE.

EQV

Returns TRUE if both of the Boolean primaries have the same truth value.

The order of priority (highest first) for the execution of Boolean operations is as follows:

  • Boolean primary

  • NOT

  • AND

  • OR

  • IMP

  • EQV

All Boolean primaries are evaluated first; then the NOT operators are applied to the Boolean primaries that follow them. The other operations are performed in decreasing order of priority. If two operations are of the same priority, the left operation is performed first. If a Boolean expression is enclosed in parentheses, it becomes a Boolean primary.