Previous

PART I: Preliminary definitions

1. Language and metalanguage

1.1. The method of description

1.1.1. Introduction

a) ALGOL 68 is a language in which algorithms may be formulated for computers, i.e., for automata or for human beings. It is defined by this Report in four stages, the "syntax" {b}, the "semantics" {c}, the "representations" {d} and the "standard environment" {e}.

b) The syntax is a mechanism whereby all the constructs of the language may be produced. This mechanism proceeds as follows:

  1. A set of "hyper-rules" and a set of "metaproduction rules" are given {1.1.3.4 , 1.1.3.3 }, from which "production rules" may be derived:
  2. A "construct in the strict language" is a "production tree" {1.1.3.2.f } which may be produced by the application of a subset of those production rules; this production tree contains static information {i.e., information known at "compile time"} concerning that construct: it is composed of a hierarchy of descendent production trees, terminating at the lowest level in the "symbols"; with each production tree is associated a "nest" of properties, declared in the levels above, which is passed on to the nests of its descendents;
  3. A "program in the strict language" is a production tree for the notion 'program' {2.2.1.a }. It must also satisfy the "environment condition" {10.1.2 }.

c) The semantics ascribes a "meaning" {2.1.4.1.a } to each construct {i.e., to each production tree} by defining the effect (which may, however, be "undefined") of its "elaboration" {2.1.4.1 }. This proceeds as follows:

  1. A dynamic {i.e., run-time} tree of active "actions" is set up {2.1.4 }; typically, an action is the elaboration of some production tree T in an "environ" consistent with the nest of T, and it may bring about the elaboration of descendents of T in suitable newly created descendent environs;
  2. The meaning of a program in the strict language is the effect of its elaboration in the empty "primal environ".

d) A program in the strict language must be represented in some "representation language" {9.3.a } chosen by the implementer. In most cases this will be the official "reference language".

  1. A program in a representation language is obtained by replacing the symbols of a program in the strict language by certain typographical marks {9.3 }.
  2. Even the reference language allows considerable discretion to the implementer {9.4.a, b, c }. A restricted form of the reference language in which such freedom has not been exercised may be termed the "canonical form" of the language, and it is expected that this form will be used in algorithms intended for publication.
  3. The meaning of a program in a representation language is the same as that of the program {in the strict language} from which it was obtained.

e) An algorithm is expressed by means of a particular-program, which is considered to be embedded, together with the standard environment, in a program-text {10.1.1.a }. The meaning of a particular-program {in the strict or a representation language} is the meaning of the program "akin" to that program-text {10.1.2.a }.

1.1.2. Pragmatics

{Merely corroborative detail, intended to give artistic verisimilitude to an otherwise bald and unconvincing narrative. Mikado, W.S. Gilbert.}
Scattered throughout this Report are "pragmatic" remarks included between the braces "{" and "}". These are not part of the definition of the language but serve to help the reader to understand the intentions and implications of the definitions and to find corresponding sections or rules.

{Some of the pragmatic remarks contain examples written in the reference language. In these examples, applied-indicators occur out of context from their defining-indicators. Unless otherwise specified, these occurrences identify those in the standard- or particular-preludes and the particular-postlude {10.2 , 10.3, 10.5 }(e.g., see 10.2.3.12.a for pi, 10.5.1.b for random and 10.5.2.a for stop), or those in:

INT i, j, k, m, n; REAL a, b, x, y; BOOL p, q, overflow; CHAR c;
  FORMAT f; BYTES r; STRING s; BITS t; COMPL w, z; REF REAL xx, yy;
  UNION(INT, REAL) uir; PROC VOID task1, task2;
[ 1: n] REAL x1, y1; FLEX [1:n] REAL a1; [1: m, 1: n] REAL x2;
  [1: n, 1: n] REAL y2; [1: n] INT i1; [1: m, 1: n ] INT i2; [1: n] COMPL z1;
PROC x or y = REF REAL: IF random < .5 THEN x ELSE y FI;
PROC ncos = (INT i)REAL: cos(2 * pi * i / n);
PROC nsin = (INT i)REAL: sin(2 * pi * i / n);
PROC finish = VOID: GO TO stop;
MODE BOOK = STRUCT(STRING text, REF BOOK next);
BOOK draft;
princeton: grenoble: st pierre de chartreuse: kootwijk: warsaw:
  zandvoort: amsterdam: tirrenia: north berwick: munich:
  finish 
. }
 
Next