Logical expressions combine relational expressions and logical operators.

Logical operators are as follows:

Operator

Example

Result

AND

A AND B

True if both A and B are True

 

 

 

OR

A OR B

True if either A or B is True
True if both A and B are True

 

 

 

NOT

NOT (A AND B)

True if (A AND B) is False
False if (A AND B) is True

 

NOT (A OR B)

True if (A OR B) is False
False if (A OR B) is True

 

NOT (A = B)

True if (A = B) is False
False if (A = B) is True

 

NOT (A < B)

True if (A < B) is False
False if (A < B) is True

 

NOT (A > B)

True if (A > B) is False
False if (A > B) is True

 

NOT (A <= B)

True if (A <= B) is False
False if (A <= B) is True
 

 

NOT (A >= B)

True if (A >= B) is False
False if (A >= B) is True

For >, <, >=, and <= comparisons, PROIV performs a NOT conversion on the relational operator (for example, > becomes <= and <= becomes >) and then evaluates the logical expression.

When evaluating expressions that contain more than one operator, PROIV follows precedence rules to determine the order in which operations are performed.  An operation with higher precedence is evaluated before an operation with lower precedence. Parentheses can be used to alter the normal precedence.

Operator

Precedence

NOT

Highest

AND

 

OR

Lowest

 

Comment on this topic

Topic ID: 520008