COMTRAN Reconstruction

F28-8043 · June 1960

Page 105

PDF page 110 of 124. Download the scanned PDF

The page as scanned

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

The text read off it

Appendix 2: Supplementary Information

[page 105]

Rules for Forming Conditional Expressions

Conditional expressions may contain the names of conditions, variables, constants and functions, as well as literals, arithmetic operators, relations of equality and relative magnitude and the operators NOT, AND and OR. Subexpressions may be contained in parentheses as required.

If a conditional expression (such as MARRIED OR PAY IS GREATER THAN 2 * X + Y) is designated by the symbol Ci the following rules may be stated concerning the formation of conditional expressions involving Ci, NOT, AND and OR.

The Conditional Expression Is True If
C1 C1 is true
NOT C1 C1 is false
C1 AND C2 Both C1 and C2 are true
C1 OR C2 Either C1 is true, C2 is true, or both are true
NOT (C1 AND C2) C1 is false, C2 is false, or both are false
NOT (C1 OR C2) C1 and C2 are both false
  1. If C1 and C2 are conditional expressions, then "C1 AND C2" and "C1 OR C2" are conditional expressions, as are similar expressions formed with the use of NOT. Thus, an expression of the form

    C1 AND (C2 OR NOT (C3 OR C4))

    may be successively reduced by substituting as follows:

    Let C5 equal "C3 OR C4" → C1 AND (C2 OR NOT C5)

    Let C6 equal "C2 OR NOT C5" → C1 AND C6

    Let C7 equal "C1 AND C6" → C7

    This rule indicates how conditional expressions may be formed from conditional expressions.

  2. The conditional expression "C1 OR C2 AND C3" is identical with "C1 OR (C2 AND C3)" but is not the same as "(C1 OR C2) AND C3." In other words, conditional expressions are grouped first according to AND and subsequently by OR. However, the programmer's use of parentheses will affect the order of grouping.

  3. The rules for formation of symbol pairs are contained in the following table: