COMTRAN Reconstruction

F28-8043 · June 1960

Page 23

PDF page 29 of 124. Download the scanned PDF

The page as scanned

The scan of PDF page 29 of F28-8043
Select the scan to open it at full size.

The text read off it

[page 23]

AND, OR, and NOT

The Commercial Translator system is fully capable of interpreting and processing “compound conditions”—i.e., conditional expressions which are themselves composed of two or more conditional expressions.

Suppose the following expressions are being used as conditions:

MARRIED
OVER.21
HOURLY.RATE IS GREATER THAN 3.50
HOURLY.RATE IS LESS THAN 5.00

These expressions may be joined in any combination the programmer might wish, using the words AND and/or OR. In some cases, it will also be necessary to enclose one or more pairs of conditions in parentheses. The negative form of a conditional expression may also be used; this is obtained by placing the word NOT before the expression.

The interpretation of conditional expressions is governed by four rules:

  1. The word OR is interpreted as “either or both.” In other words, it is used in the “inclusive” sense employed in formal logic.
  2. The word AND is interpreted as “both.” Simple conditions joined by AND must both be true in order for the compound condition to be true.
  3. Each conditional expression must be completely stated. For example, the system would not accept such an expression as HOURLY.RATE IS GREATER THAN 3.50 AND LESS THAN 5.00. To convey the intended meaning, the full expression must be written as HOURLY.RATE IS GREATER THAN 3.50 AND HOURLY.RATE IS LESS THAN 5.00.
  4. When a compound conditional expression contains both the word OR and the word AND, it will be interpreted as if the terms connected by AND were enclosed in parentheses. In other words, each pair of conditions joined by the word AND will be considered as a single condition which is true if both of the subordinate conditions have been met. If a contrary sense is intended, parentheses must be used to show it.

The following examples should clarify the interpretation of these rules:

Compound Conditional Expression Interpretation
MARRIED AND OVER.21 Both of the conditions MARRIED and OVER.21 must be met.
MARRIED OR NOT OVER.21 Either the condition MARRIED or the condition NOT OVER.21, or both, must be met.
NOT MARRIED AND HOURLY.RATE IS NOT LESS THAN 5.00 Both of the conditions NOT MARRIED and HOURLY.RATE IS NOT LESS THAN 5.00 must be met.
MARRIED OR OVER.21 AND HOURLY.RATE IS GREATER THAN 3.50 Either the condition MARRIED must be met or the combination OVER.21 AND HOURLY.RATE IS GREATER THAN 3.50 must be met, or both.