Polybench® Reference
Describes logical algebra and a parser that recognizes AND, OR and XOR, optionally clarified with parentheses.

Logical algebra parser

Overview

Some components in the software offer logical evaluations using the keywords AND, OR and XOR. This section describes the syntax of logical formulas.

The basic meaning of those keywords is this:
a AND b AND c is logically TRUE if and only if a is TRUE, and b is TRUE, and c is TRUE.
a OR b OR c is logically TRUE if a is TRUE, or b is TRUE, or c is TRUE.
a XOR b XOR c is logically TRUE if and only if a is TRUE, or b is TRUE, or c is TRUE, and the other two are FALSE.

(OR is called inclusive-OR, and XOR is called exclusive-OR)

Logical expressions may contain parentheses '(' and ')' to clarify the expression.

The logical operators must be written in capitals, so and, or, and xor are wrong.

Details

AND is evaluated before OR and XOR. Therefore
a AND b OR c is equal to (a AND b) OR c