Previous

2.2. The program

2.2.1. Syntax

a) program : strong void new closed clause{31a } . {See also 10.1 .}

2.2.2. Semantics

{``I can explain all the poems that ever were invented - and a good many that haven't been invented just yet.'' Through the Looking-glass, Lewis Carroll.}

a) The elaboration of a program is the elaboration of its strong-void-new-closed-clause in an empty environ {2.1.1.1.c } termed the "primal environ".

{Although the purpose of this Report is to define the meaning of a particular-program {10.1.1.g }, that meaning is established only by first defining the meaning of a program in which that particular-program is embedded {10.1.2 }.}

{In this Report, the syntax says which sequences of symbols are terminal productions of 'program', and the semantics which actions are performed by the computer when elaborating a program. Both syntax and semantics are recursive. Though certain sequences of symbols may be terminal productions of 'program' in more than one way (see also 1.1.3.2.f ), this syntactic ambiguity does not lead to a semantic ambiguity.}

b) In ALGOL 68, a specific syntax for constructs is provided which, together with its recursive definition, makes it possible to describe and to distinguish between arbitrarily large production trees, to distinguish between arbitrarily many different values of a given mode (except certain modes like 'boolean' and 'void') and to distinguish between arbitrarily many modes, which allows arbitrarily many objects to exist within the computer and which allows the elaboration of a program to involve an arbitrarily large, not necessarily finite, number of actions. This is not meant to imply that the notation of the objects in the computer is that used in this Report nor that it has the same possibilities. It is not assumed that these two notations are the same nor even that a one-to-one correspondence exists between them; in fact, the set of different notations of objects of a given category may be finite. It is not assumed that the computer can handle arbitrary amounts of presented information. It is not assumed that the speed of the computer is sufficient to elaborate a given program within a prescribed lapse of time, nor that the number of objects and relationships that can be established is sufficient to elaborate it at all.

c) A model of the hypothetical computer, using a physical machine, is said to be an "implementation" of ALGOL 68 if it does not restrict the use of the language in other respects than those mentioned above. Furthermore, if a language A is defined whose particular-programs are also particular-programs of a language B, and if each such particular-program for which a meaning is defined in A has the same defined meaning in B, then A is said to be a "sublanguage" of B, and B a "superlanguage" of A.

{Thus a sublanguage of ALGOL 68 might be defined by omitting some part of the syntax, by omitting some part of the standard-prelude, and/or by leaving undefined something which is defined in this Report, so as to enable more efficient solutions to certain classes of problem or to permit implementation on smaller machines.

Likewise, a superlanguage of ALGOL 68 might be defined by additions to the syntax, semantics or standard-prelude, so as to improve efficiency (by allowing the user to provide additional information) or to permit the solution of problems not readily amenable to ALGOL 68.}

A model is said to be an implementation of a sublanguage if it does not restrict the use of the sublanguage in other respects than those mentioned above.

{See 9.3.c for the term "implementation of the reference language".}

{A sequence of symbols which is not a particular-program but can be turned into one by deleting or inserting a certain number of symbols and not a smaller number could be regarded as a particular-program with that number of syntactical errors. Any particular-program that can be obtained by deleting or inserting that number of symbols may be termed a "possibly intended" particular-program. Whether a particular-program or one of the possibly intended particular-programs has the effect its author in fact intended it to have is a matter which falls outside this Report.}

{In an implementation, the particular-program may be "compiled", i.e., translated into an "object program" in the code of the physical machine. Under certain circumstances, it may be advantageous to compile parts of the particular-program independently, e.g., parts which are common to several particular-programs. If such a part contains applied-indicators which identify defining-indicators not contained in that part, then compilation into an efficient object program may be assured by preceding the part by a sequence of declarations containing those defining-indicators.}

{The definition of specific sublanguages and also the specification of actions not definable by any program (e.g., compilation or initiation of the elaboration) is not given in this Report. See, however, 9.2 for the suggested use of pragmats to control such actions.}
 
Next