Logical operators

A logical operator evaluates one or two Boolean expressions. It determines whether the expression is true, false, or unknown.

The logical operators are as follows (executed in the order shown):

  • not
  • and
  • or

The unknown truth value is treated according to the Substitution Principle, which dictates:

  • If UNKNOWN occurs as a logical operand, then the result of the operation is TRUE if substituting TRUE or FALSE for UNKNOWN always yields TRUE.
  • The result is FALSE if substituting TRUE or FALSE for UNKNOWN always yields FALSE.
  • The result is UNKNOWN if substituting TRUE or FALSE for UNKNOWN sometimes yields TRUE and sometimes yields FALSE.