34 van Wijngaarden, et al.j) WHETHER (ALPHAI NOTETYI) begins with(ALPHA2 NOTETY2){g,j,m} :WHETHER (ALPHAI) coincides with (ALPHA2) in(abcdefghijklmnopqrstuvwxyz){k,l,-}and (NOTETY I) begins with (NOTETY2){h,i,j}.k) where (ALPHA) coincides with (AI.PHA) in (NOTION){j} :where true{a}.I) unless (ALPHAI) coincides with (ALPHA2) in (NOTION){j} :where CNOTION) contains (ALPIIAI NOTETY ALPHA2){m}or (NOTION) contains CALPHA2 NOTETY ALPHAI){m}.m) WHETHER (ALPHA NOTETY) contains (NOTION){I,m} :WHETHER (ALPHA NOTETY) begins with (NOTION){j}or (NOTETY) contains (NOTION){m,n}.n) WHETHER (EMPTY) contains (NOTION){m} : WHETHER false{b,-}.{The small syntactic marks "(" and ")" are used to ensure, in a simpleway, the unambiguous application of these predicates.}1.3.2. The holding of predicatesA "predicate" is a protonotion which begins with "where" or 'unless"{unified into 'WHETHER'}. For a predicate P, either one or moreproduction trees may be produced {1.1.3.2.f} {all of which are theninvisible}, in which case P "holds", or no production tree may be produced{since each attempt to produce one runs into blind alleys}, and then P"does not hold".{For example, the predicate 'where (ab) is (ab)" holds. Its productiontree may be depicted thus:'where (ab) is (ab)"I'where (ab) begins with (ab) and Cab) begins with Cab)"II'where (ab) begins with (ab)'I"where (ab) begins with (ab)"(same as left branch)'where (a) coincides with (a) in (abc...z) and (b) begins with (b)'II'where Ca) coincides with (a) in (abc...z)'I'where true'['where (b) coincides with (b) in (abc...z)'I'where true"I'where (b) begins with (b)"1I'where () begins with ()'l'where true'ALGOL <strong>68</strong> Revised Report 35If a predicate holds, then its production tree always terminates via'where true' or 'unless false'. If it does not hold, then, in general, the blindalleys are 'where false' and 'unless true'. Although almost all the hyperrulesconcerned are for hypernotions beginning with "WHETHER" and soprovide, each time, production rules for pairs of predicates such as "whereTHINGI' and "unless THINGI', this does not mean that in each such caseone of the pair must hold. For example, 'where digit four counts iii"(4.3.1.c) does not hold, but no care has been taken to make "unless digitfour counts iii' hold either, since there is no application for it in thisReport.In the semantics, no meaning is ascribed to constructs whose originalsare predicates. They serve purely syntactical purposes.}1.3.3. Syntax of general constructionsA) STYLE :: brief ; bold ; style TALLY..a) NOTION option : NOTION ; EMPTY.b) NOTION sequence{b} : NOTION ; NOTION, NOTION sequence{b}.c) NOTION list{c} :NOTION ; NOTION, and also{94f} token, NOTION list{c}.d) NOTETY STYLE pack :STYLE begin{94f,-} token, NOTETY, STYLE end{94f,-} token.e) NOTION STYLE bracket :STYLE sub{94f,-} token, NOTION, STYI.E bus{94f,-} token.f) THINGI or alternatively THING2 : THINGI ; THING2.{It follows from this syntax that production rules such asdigit cypher sequence :digit cypher ; digit cypher, digit cypher sequence.(which was used in the production of the example in I.I.3.2.f, but forwhich no more explicit hyper-rule is given) are immediately available.Thus the number of hyper-rules actually written in this Report has beenreduced and those that remain have, hopefully, been made more readable,since these general constructions are so worded as to suggest what theirproductions should be.For this reason, cross-references (I.I.3.4.f) to these rules have beenreplaced by more helpful references; e.g., in 8.1.1.I.b, instead of "digitcypher sequence{133b}", the more helpful "digit cypher{c} sequence" isgiven. Likewise, references within the general constructions themselveshave been restricted to a bare minimum.}2. The computer and the programThe meaning of a program in the strict language is explained in termsof a hypothetical computer which performs the set of actions {2.1.4} whichconstitute the elaboration {2.1.4.1} of that program. The computer dealswith a set of "objects" {2.1.1}.
36van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report 372.1. Terminology2.1.1. Objects{"When I use a word," Humpty Dumpty said, in rather ascornful tone, "it means just what I choose it to mean -neither more nor less."Through the Looking-glass,Lewis Carroll.}An "object" is a construct {1.1.3.2.e}, a "value" {2.1.1.l.a},{2.1.1.l.b}, an "environ" {2.1.1.1.c} or a "scene" {2.1.1.1.d}.a "locale"{Constructs may be classified as "external objects", since theycorrespond to the text of the program, which, in a more realisticcomputer, would be compiled into some internal form in which it couldoperate upon the "internal objects", namely the values, the locales, theenvirons and the scenes. However, the hypothetical computer has no needof a compilation phase, it being presumed able to examine the programand all of its descendent constructs at the same time as it is manipulatingthe internal objects.}2.1.1.1. Values, locales, environs and scenesa) A "value" is a "plain value" {2.1.3.1}, a "name" {2.1.3.2}, a "stowedvalue" (i.e., a "structured value" {2.1.3.3} or a "multiple value" {2.1.3.4}) ora "routine" {2.1.3.5}.{For example, a real number is a plain value. A special font is used forvalues appearing in the text of this Report, thus: 3.14, true. This is not tobe confused with the italic and bold fonts used for constructs. This samespecial font is also used for letters designating such things as constructsand protonotions.}b) A "locale" {is an internal object which} corresponds to some'DECSETY LABSETY" {1.2.3.C,I}. A "vacant locale" is one for which that'DECSETY LABSETY" is 'EMPTY'.{Each 'QUALITY TAX' (4.8A.F,G) enveloped by that "I)ECSET~LABSETY" corresponds to a QllALIT'¥-defining-indicator-with-TAX (i.e., toan identifier, operator or mode-indication) declared in the construct whoseelaboration caused that locale to be created. Such a 'QIiAIA'I'~ TAX' maybe made to "access" a value or a scene "inside" that locale (2.1.2.c).A locale may be thought of as a number of storage cells, into whichsuch accessed objects are placed.}{The terminal metaproductions of the metanotions "I)EC", "l.AIt" and"FIELD" (or of the more frequently used "PtlOP", which includes them all)are all of the form "QUALITY' TAX'. These "properties" are used in thesyntax and semantics concerned with nests and locales in order toassociate, in a particular situation, some quality with that 'TAX'.}c) An "environ" is either empty, or is composed of an environ and alocale.{Hence, each environ is derived from a series of other environs,stemming ultimately from the empty "primal environ" in which theprogram is elaborated (2.2.2.a).}d) A "scene" S is an object which is composed of a construct C{1.1.3.2.e} and an environ E. C is said to be the construct, and E theenviron, "of" S.{Scenes may be accessed inside locales (2.1.2.c) by "LAB's or "DEC'sarising from label.identifiers or from mode-indications, and they may alsobe values (2.1.3.5).}2.1.1.2. Modes{Each value has an attribute, termed its "mode", which defines howthat value relates to other values and which actions may be applied to it.This attribute is described, or "spelled", by means of some "MOll}'(I.2.1.R) (thus there is a mode spelled "real', and there is a mode spelled'structured with real field letter r letter e real field letter i letter mmode'). Since it is intended that the modes specified by the modeindicationsa and b inmode a = struct (rata b),mode b = struct (ref struct (rat b b) b)should in fact be the same mode, it is necessary that both the "MOLD''mui definition of structured with reference to mui applicationfield letter b mode'and the 'MOll)''muii definition of structured with reference to structured withreference to muii application field letter b modefield letter b mode'(and indeed many others) should be alternative spellings of that samemode. Similarly, the mode specified by the declarer union (int, real) maybe spelled as either *union of integral real mode" or "union of real integralmode'. All those 'MOlD's which are spellings of one same mode are said tobe "equivalent to" one another (a).Certain 'MOII)'s, such as 'reference to muiii application', "reference tomuiiii definition of reference to muiiii application', 'union of real referenceto real mode', and 'structured with integral field letter a real field letter amode', are ill formed (7A, 4.7.1.f, 4.8.1.c) and do not spell any mode.Although for most practical purposes a "mode" can be regarded assimply a 'MOll)', its rigorous definition therefore involves the whole classof 'MOlD's, equivalent to each other, any of which could describe it.}a) 'MOII)l' {I.2.1.R} is "equivalent to" 'MOIl)2" if the predicate "whereMOII)I equivalent MOIl)2" {7.3.1.a} holds {1.3.2}.{A well formed "MOll)" is always equivalent to itself: "union of inWgralreal mode" is equivalent to 'union of real integral mode'.}
- Page 2 and 3: van Wijngaarden, et al.1.1.4.2. Par
- Page 4: Acknowledgements{Habent sua fata li
- Page 8 and 9: 14 van Wijngaarden, et al.0.3.4. Mo
- Page 10 and 11: . . . . . . . 4 " ' 0 . . . . . . .
- Page 12 and 13: 22 van Wijngaarden, et al.• let P
- Page 14 and 15: 26 van Wijngaarden, et al.{Since so
- Page 16 and 17: 30 van Wijngaarden, et aLloperandfo
- Page 20 and 21: 38 van Wijngaarden, et al.A protono
- Page 22 and 23: 42 van Wijngaarden, et al.d) If N i
- Page 24 and 25: 46 van Wijngaarden, et al.c) {There
- Page 26 and 27: 50 van Wijngaarden, et al.c) The ph
- Page 28 and 29: 54 van Wijngaarden, et al.3.1.1. Sy
- Page 30 and 31: 58 van Wijngaarden, et al.where (RO
- Page 32 and 33: 62 van Wijngaarden, et al.1) SOlD N
- Page 34 and 35: 66 van Wijngaarden, et al.ALGOL 68
- Page 36 and 37: 70 van Wijngaarden, et el.For each
- Page 38 and 39: 74 van Wijngaarden, et al.If 'MODE"
- Page 40 and 41: 78 J van Wijngaarden, et al.C) SECO
- Page 42 and 43: 82 van Wijngaarden, et al.ALGOL 68
- Page 44 and 45: 86 van Wijngaarden. et al.ALGOL 68
- Page 46 and 47: 90 van Wijngaarden, et al.5.4.4.1.
- Page 48 and 49: 94van Wijngaarden, et al.ALGOL 68 R
- Page 50 and 51: 98 van Wijngaarden, et al.Assignati
- Page 52 and 53: 102 van Wijngaarden, et at.{A nest,
- Page 54 and 55: 106 van Wijngaarden, et al.'HEAD's
- Page 56 and 57: 110 van Wijngaarden, et al.ALGOL 68
- Page 58 and 59: 114van Wijngaarden, et al.ALGOL 68
- Page 60 and 61: 118 van Wijngaarden, et al.ALGOL 68
- Page 62 and 63: 122 van Wijngaarden, et al.style ii
- Page 64 and 65: 126 van Wijngaarden, et al.b) The c
- Page 66 and 67: 130van Wijngaarden, et al.ALGOL 68
- Page 68 and 69:
134van Wijngaarden, et al.ALGOL 68
- Page 70 and 71:
138d)e)f)g)h)i)J)k)1)m)n)van Wijnga
- Page 72 and 73:
142 van Wijngaarden, et al.physics
- Page 74 and 75:
146 van Wijngaarden, et al.gg) On s
- Page 76 and 77:
150van Wijngaarden, et al.ALGOL 68
- Page 78 and 79:
154/van Wijngaarden, et al.ALGOL 68
- Page 80 and 81:
158 van Wijngaarden, et el.fi;ref p
- Page 82 and 83:
162van Wijngaarden, et al.ALGOL 68
- Page 84 and 85:
166van Wijngaarden, et al.ALGOL 68
- Page 86 and 87:
170/van Wijngaarden, etal.ALGOL 68
- Page 88 and 89:
174J)K)L)M)N)O)P)a)b)c)d)e)van Wijn
- Page 90 and 91:
178/van Wijngaarden, et al.ALGOL 68
- Page 92 and 93:
182 van Wijngaarden, et al.• let
- Page 94 and 95:
186van Wijngaarden, et al./ALGOL 68
- Page 96 and 97:
190 van Wijngaarden, etal.composed
- Page 98 and 99:
194h)i)J)van Wijngaa(rden, et al.pr
- Page 100 and 101:
198 van Wijngaarden, et al.¢ strin
- Page 102 and 103:
202tvan Wijngaarden, et al.ALGOL 68
- Page 104 and 105:
206 van Wijngaa~den. et al.10.3.6.1
- Page 106 and 107:
210 van Wijngaarden, et al.!ALGOL 6
- Page 108 and 109:
214 van Wijngaarden, et al.inoperat
- Page 110 and 111:
218fvan Wijngaarden, et al.¢ move
- Page 112 and 113:
222 van Wijngaarden, etaL{overflow}
- Page 114 and 115:
226 van Wijngaarden, et al.ALGOL 68
- Page 116 and 117:
230max int 10.2.1.cmax real 10.2.l.
- Page 118 and 119:
234 van Wijngaarden, et al.ALGOL 68