<!ENTITY scope3 SYSTEM "scope3.xml">
<!ENTITY scope4 SYSTEM "scope4.xml">
-<!ENTITY scriptA "ℜ"> <!-- mapped to script R -->
-<!ENTITY scriptF "ℬ"> <!-- mapped to script B -->
-<!ENTITY scriptL "ℒ"> <!-- this is a script L -->
-<!ENTITY scriptN "ℳ"> <!-- mapped to script M -->
-<!ENTITY scriptS "&sgr;"> <!-- mapped to sigma -->
+<!ENTITY scriptA "<emphasis>A</emphasis>">
+<!ENTITY scriptF "<emphasis>B</emphasis>">
+<!ENTITY scriptL "<emphasis>L</emphasis>">
+<!ENTITY scriptN "<emphasis>M</emphasis>">
+<!ENTITY scriptS "<emphasis>S</emphasis>">
<!-- also available; script H is ℋ -->
]>
<book>
<para>Z is the answer.</para>
</step>
</procedure>
-
+
<para>This may be illustrated by following "flow diagram":</para>
-
+
<mediaobject>
<imageobject>
<imagedata fileref='fig1.png'/>
<para>We shall abbreviate this by the form:</para>
-<programlisting>
+<programlisting>
THROUGH BACK, FOR ALPHA = 12, 3 ALPHA .G. 90 .OR. .ABS. (X+Y) .LE. EPSLON
</programlisting>
<programlisting>
&min;
</programlisting>
-
+
<para>The DIMENSION statement assigns a block of storage in the
computer large enough to handle a<subscript>0</subscript>,
a<subscript>1</subscript>, a<subscript>2</subscript>,
For example, the following is a Boolean expression:</para>
<programlisting>
- ((x - 3)<superscript>3</superscript> < y and i ≤ j) or x ≥ 3
+((x - 3)<superscript>3</superscript> < y and i ≤ j) or x ≥ 3
</programlisting>
-
+
<para>This will be "true" for some values of x and y, and "false" for
others. It might then occur in statements such as:</para>
WHENEVER ((X - 3) .P. 3 .L. Y .AND. I .LE. J) .OR. X .GE. 3,
TRANSFER TO AGAIN
</programlisting>
-
+
<para>or in the iteration statement</para>
<programlisting>
<programlisting>
LARGEQ = 1. + MAX. (6,Q)/3.
</programlisting>
-
+
<para>Note that the set (in this use of MAX.) hose largest element is
desired is called Q, and N has the value 6. No DIMENSION statement is
needed for A is the EXTERNAL FUNCTION definition program above, since
<imagedata fileref='equation3.png'/>
</imageobject>
</mediaobject>
-
+
<para>which is obtained from the standard Newton's Method formula</para>
<!-- Yes, this is repeated from earlier -->
<imagedata fileref='equation1.png'/>
</imageobject>
</mediaobject>
-
+
<!-- in the original, "problem" here was "probelm" -->
<para>for the problem f(x) = 0. (Here f(x) =
x<superscript>3</superscript> + ax<superscript>2</superscript> + bx +
<orderedlist numeration='loweralpha'>
<listitem><para>Addition, written as "+", e.g., Z5 + D.</para></listitem>
-
+
<listitem><para>Subtraction, written as "-", e.g., Z5 - D. (Note,
both the minus sign and the dash are accepted.)</para></listitem>
<sect2><title>Arithmetic Expressions</title>
<para>Arithmetic expressions are defined inductively as follows:</para>
-
+
<orderedlist numeration='loweralpha'>
<listitem><para>All integer, floating point, and alphabetic constants,
integer and floating point individual variables, subscripted integer
<!-- beginpage -->
<literallayout>
- .ABS., + (as unary operations)
- .P.
- - (as a unary operator)
- *, /
- +, - (as binary operations, i.e., addition and subtraction)
-
- .E., .NE., .G., .GE., .L., .LE.
- .NOT.
- .AND.
- .OR.
- .THEN.
- .EQV.
- , (as used to separate function arguments)
- =
+.ABS., + (as unary operations)
+.P.
+- (as a unary operator)
+*, /
++, - (as binary operations, i.e., addition and subtraction)
+
+.E., .NE., .G., .GE., .L., .LE.
+.NOT.
+.AND.
+.OR.
+.THEN.
+.EQV.
+, (as used to separate function arguments)
+=
</literallayout>
<para>Examples:</para>
<literallayout>
- (1) .ABS.(B - C) means |B - C|, while .ABS.B - C means |B| - C.
- (2) -B + C means (-B) + (C), while -(B + C) means the negation of
- the sum.
- (3) B.P. - X + Y means B<superscript>-X</superscript> + Y, while B.P.(-X + Y) means B<superscript>-X</superscript>+Y.
- (4) K2/Z - 3 (K2/Z) - 3, while K2/(Z - 3) implies that Z - 3 is
- the denominator.
- (5) A * B + C means (A * B) + C.
- (6) A.P.3/J means (A<superscript>3</superscript>)/J
- (7) X.L. Y + 3 means (X) .L. (Y + 3).
- (8) P.AND..NOT.P .EQV.Q means (P.AND.(.NOT.P)).EQV.Q.
- (9) Z = X + Y /QA means Z = (X + Y/QA))
- (10) A = -B.P.X means A = -(B<superscript>X</superscript>).
+(1) .ABS.(B - C) means |B - C|, while .ABS.B - C means |B| - C.
+(2) -B + C means (-B) + (C), while -(B + C) means the negation of
+the sum.
+(3) B.P. - X + Y means B<superscript>-X</superscript> + Y, while B.P.(-X + Y) means B<superscript>-X</superscript>+Y.
+(4) K2/Z - 3 (K2/Z) - 3, while K2/(Z - 3) implies that Z - 3 is
+the denominator.
+(5) A * B + C means (A * B) + C.
+(6) A.P.3/J means (A<superscript>3</superscript>)/J
+(7) X.L. Y + 3 means (X) .L. (Y + 3).
+(8) P.AND..NOT.P .EQV.Q means (P.AND.(.NOT.P)).EQV.Q.
+(9) Z = X + Y /QA means Z = (X + Y/QA))
+(10) A = -B.P.X means A = -(B<superscript>X</superscript>).
</literallayout>
<para>(B) Within an expression operations appearing on the same line
<para>Examples:</para>
<literallayout>
- (1) A + B - C + D - E means (((A + B) - C) + D) - E.
- (2) X/Z * Y/R * S means (((X/Z) * Y/R) * S.
+(1) A + B - C + D - E means (((A + B) - C) + D) - E.
+(2) X/Z * Y/R * S means (((X/Z) * Y/R) * S.
</literallayout>
</sect2>
the expressions</para>
<literallayout>
- Y = GCD.(I, J)
- Y + Z - I
- I + 1.
- GCD. (I, J)/Z
+Y = GCD.(I, J)
+Y + Z - I
+I + 1.
+GCD. (I, J)/Z
</literallayout>
<para>are all floating point expressions while the expressions</para>
<literallayout>
- I + GCD.(I, J)
- (I + J)/3
- I + 1
- GCD.(I, J)/I
+I + GCD.(I, J)
+(I + J)/3
+I + 1
+GCD.(I, J)/I
</literallayout>
<!-- beginpage -->
<para>are all integer expressions.</para>
Thus, in the expression</para>
<literallayout>
- Y + 3
+Y + 3
</literallayout>
<para>if Y is in the floating point mode it cannot be added directly
which the conversions will be made. Consider the expression</para>
<literallayout>
- ( Y + 7/3) + (I * J/K)
+( Y + 7/3) + (I * J/K)
</literallayout>
<para>where Y is in the floating point mode, and I, J, and K are in the
temporary locations):</para>
<literallayout>
- T<subscript>1</subscript> = I * J
- T<subscript>2</subscript> = T<subscript>1</subscript>/K
- T<subscript>3</subscript> = 7/3
- T<subscript>4</subscript> = Y + T<subscript>3</subscript>
- T<subscript>5</subscript> = T<subscript>4</subscript> + T<subscript>2</subscript>
+T<subscript>1</subscript> = I * J
+T<subscript>2</subscript> = T<subscript>1</subscript>/K
+T<subscript>3</subscript> = 7/3
+T<subscript>4</subscript> = Y + T<subscript>3</subscript>
+T<subscript>5</subscript> = T<subscript>4</subscript> + T<subscript>2</subscript>
</literallayout>
-
+
<para>and T<subscript>5</subscript> will be the value of the
expression.</para>
floating point mode if the expression were written:</para>
<literallayout>
- (Y + 7./3) + (I * J)/(K + 0.)
+(Y + 7./3) + (I * J)/(K + 0.)
</literallayout>
-
+
<para>Of course, many times the expression will be written as
originally stated just to achieve the "truncation" effect.</para>
<para>This statement has the form illustrated by</para>
<programlisting>
- ALPHA = Y + Z + F.(X, Y, Z)
+ALPHA = Y + Z + F.(X, Y, Z)
</programlisting>
<para>That is, the left side of the "=" sign consists of the name of a
(See <xref linkend='expression_modes'/> for mode of expressions.)</para>
<para>Thus, if Y is a floating point variable, then the statement</para>
-
+
<programlisting>
- Y = 1
+Y = 1
</programlisting>
-
+
<para>will cause the integer 1 to be converted to floating point and then
stored in the location called "Y"; i.e., Y will now have the value 1.
(as a floating point number). If the statement were written</para>
<programlisting>
- Y = 1.
+Y = 1.
</programlisting>
-
+
<para>then the floating point number 1. would be stored in the
location "Y"; i.e., Y would again have the floating point value 1.,
but in this case the conversation of the integer is unnecessary, thus
following floating point numbers:</para>
<programlisting>
- 3E5, .3E0, .34568127E2, - .345681E10
+3E5, .3E0, .34568127E2, - .345681E10
</programlisting>
<para>would convert to the following integers, respectively:</para>
<programlisting>
- 300000, 0, 34, -3456810000.
+300000, 0, 34, -3456810000.
</programlisting>
</sect2>
<sect2><title>Transfer Statement</title>
<para>This statement has the form: TRANSFER TO &scriptS;</para>
-
+
<para>Here &scriptS; may be any statement label or any expression in
<!-- beginpage -->
statement label mode which labels an executable statement. Execution
<sect2><title>Conditional Statements</title>
<para>There are two types of conditional statements.</para>
-
+
<para>(a) Simple Conditional</para>
<programlisting>
- WHENEVER B,Q
+WHENEVER B,Q
</programlisting>
<para>Here B is a Boolean expression and Q any executable statement
<para>Examples:</para>
<programlisting>
- WHENEVER XM.LE.1, TRANSFER TO END
- WHENEVER I.GE.N.AND.J.NE.I-1, I=0
+WHENEVER XM.LE.1, TRANSFER TO END
+WHENEVER I.GE.N.AND.J.NE.I-1, I=0
</programlisting>
-
+
<para>(b) Compound Conditional</para>
<!-- Original has hand-drawn large right curly braces pointing at each -->
<!-- theta from the left, indicating the scope of the conditional body -->
<programlisting>
- &scriptS;<subscript>1</subscript> WHENEVER B<subscript>1</subscript>
-
- ...
- ... &THgr;<subscript>1</subscript>
-
- &scriptS;<subscript>2</subscript> OR WHENEVER B<subscript>2</subscript>
- ...
- ... &THgr;<subscript>2</subscript>
- ...
- ...
- &scriptS;<subscript>k</subscript> OR WHENEVER B<subscript>k</subscript>
- ...
- ... &THgr;<subscript>k</subscript>
- &scriptS;<subscript>k</subscript>+1 END OF CONDITIONAL
+ &scriptS;<subscript>1</subscript> WHENEVER B<subscript>1</subscript>
+
+ ...
+ ... &THgr;<subscript>1</subscript>
+
+ &scriptS;<subscript>2</subscript> OR WHENEVER B<subscript>2</subscript>
+ ...
+ ... &THgr;<subscript>2</subscript>
+ ...
+ ...
+ &scriptS;<subscript>k</subscript> OR WHENEVER B<subscript>k</subscript>
+ ...
+ ... &THgr;<subscript>k</subscript>
+ &scriptS;<subscript>k</subscript>+1 END OF CONDITIONAL
</programlisting>
-
+
<para>Often the last condition B<subscript>k</subscript> is always
true. This may be expressed by the statement</para>
<!-- beginpage -->
<programlisting>
- OR WHENEVER 1B
+OR WHENEVER 1B
</programlisting>
<para>or alternately the statement</para>
<programlisting>
- OTHERWISE
+OTHERWISE
</programlisting>
-
+
<para>The &scriptS;<subscript>i</subscript> are statement labels which
need not be used unless desired. k may equal one (if no "OR
WHENEVER..." statements are used). Here B<subscript>1</subscript>,
<para>might be given by the section of the program:</para>
<programlisting>
- WHENEVER X .LE. 0. .OR. 1. .LE. X .AND. X .L. 2. .OR. X .GE.3
- Y = 0.
- OR WHENEVER 0 .LE. X .AND. X. .L. 3.
- Y = 1.
- END OF CONDITIONAL
+WHENEVER X .LE. 0. .OR. 1. .LE. X .AND. X .L. 2. .OR. X .GE.3
+ Y = 0.
+OR WHENEVER 0 .LE. X .AND. X. .L. 3.
+ Y = 1.
+END OF CONDITIONAL
</programlisting>
-
+
<para>This section of program could be rewritten in another way.</para>
-
+
<!-- beginpage after "Y = X" -->
<programlisting>
- WHENEVER 0. .LE. X .AND. X .L. 1.
- Y = X
- OR WHENEVER 2. .LE. X .AND. X .L. 3.
- Y = 1.
- OTHERWISE
- Y = 0.
- END OF CONDITIONAL
+WHENEVER 0. .LE. X .AND. X .L. 1.
+Y = X
+OR WHENEVER 2. .LE. X .AND. X .L. 3.
+Y = 1.
+OTHERWISE
+Y = 0.
+END OF CONDITIONAL
</programlisting>
-
+
<para>The indentation of the statements between the conditional statements
is not required but contributes to the readability.</para>
</sect2>
<sect2><title>CONTINUE Statement</title>
<para>This statement has the simple form:</para>
-
+
<programlisting>
- CONTINUE
+CONTINUE
</programlisting>
-
+
<para>It serves as an entry point in the program, and causes no computation
to be performed by its presence or absence.</para>
</sect2>
<para>The following program segment illustrates the use of this
statement.</para>
-
+
<programlisting>
- .
- .
- .
- A = D(1, 1)
- THROUGH ST1, FOR I = 1, I .G. 10
- THROUGH ST1, FOR J = 1, J .G. 10
- WHENEVER A .LE. D(I, J), TRANSFER TO ST1
- K = I
- L = J
+ .
+ .
+ .
+A = D(1, 1)
+THROUGH ST1, FOR I = 1, I .G. 10
+THROUGH ST1, FOR J = 1, J .G. 10
+WHENEVER A .LE. D(I, J), TRANSFER TO ST1
+K = I
+L = J
ST1 CONTINUE
- .
- .
- .
+ .
+ .
+ .
</programlisting>
<para>This statement casues the block of statements which follows
<para>Normally, the value of a function will occur as part of an expression, as in the statement:</para>
-<programlisting>
+<programlisting>
Z = COS.(X)/SIN.(X + 2.)
</programlisting>
-
+
<para>Certain functions, however, may stand alone as separate
statements, as a statement calling for the sorting of a list, etc.
This would appear as:</para>
<programlisting>
FUNCTION RETURN ℳ
</programlisting>
-
+
<para>This statement is used in a function definition to indicate a
return to the calling program. ℳ is an expression whose value is to
be the output of this function considered as a single valued function.
made even if at load point.</para>
</listitem>
</varlistentry>
-</variablelist>
+</variablelist>
<sect3><title>End of File and End of Tape</title>