102 van Wijngaarden, et at.{A nest, except the primal one (which is just 'new'), is some 'NESTLAYER' (i.e., some 'NEST new PROPSETY'). A 'PROP' is identified byfirst looking for it in that 'LAYER' (rule a). If the 'PROP' is some "labelTAX' or 'DYADIC TAX', then a simple match of the 'PROP's is a sufficienttest (rule e). If the "PROP" is some 'MOLD TALLETY TAX', then the modeequivaleneing mechanism must be invoked (rule c). If it is not found inthe 'LAYER', then the search continues with the "NEST' (without that'LAYER'), provided that it is independent of all 'PROP's in that 'LAYER';otherwise the search is abandoned (rule a). Note that rules b and c dodouble duty in that they are also used to check the validity of applied-fieldselectors(4.8.1.d) .}7.2.2. Semanticsa) If some NEST-range R {3.0.I.f} contains an applied-indicator I{4.8.1.b} of which there is a descendent where-PROP-identified-in-NEST-LAYER, but no descendent where-PROP-identified-in-NEST, then R is the"defining range" of that I. {Note that "NEST' is always the nest in forcejust outside the range.}b) A QUALITY-applied-indicator-with-TAX I whose defining NESTrange{a} is R "identifies" the QUALITY-NEST-LAYER-defining-indicatorwith-TAXcontained in R.{For example, in(¢1¢ real i = 2.0; (¢2¢ int i = 1; (¢3¢ real x; print (i) ¢3¢) ¢2¢) ¢1¢)there are three ranges. The applied-identifier i in print (i) is forced, by thesyntax, to be an integral-NEST-new-real-letter-i-new-integral-letter-i-newreferenee-to-real-letter-x-applied-identifier-with-letter-i(4.8.1.b). Itsdefining range is the NEST-new-real-letter-i-serial-clause-defining-newintegral-letter-i(3.2.1.a) numbered ¢2¢, it identifies the defining-identifier icontained in int i (not the one in real i), and its mode is 'integral'.}{By a similar mechanism, a DYADiC-formula (5.4.2.1.a) may be said to"identify" that DYADiC-defining-operator (4.8.1.a) which determines itspriority.}c) The environ E "necessary for" a construct C in an environ E1 isdetermined as follows:If E1 is the primal environ {2.2.2.a},then E is El;otherwise, letting E1 be composed of a locale L corresponding to some'PROPSETY" and another environ E2,If C contains any QUALiTY-applied-indicator-with-TAX• which does not identify {b} a defining.indicator contained in C,• which is not a mode-indication directly descended from a formalorvirtual-declarer, and• which is such that the predicate 'where QUALITY TAX resides inPROPSETY' {7.2.1.b} holds,then E is El:ALGOL <strong>68</strong> Revised Report 103otherwise, {L is not necessary for C and} E is the environ necessary forC in E2.{The environ necessary for a construct is used in the semantics ofroutine-texts (5.4.1.2) and in "establishing" (3.2.2.b). For example, in¢2¢ proc void pp; int n; (¢I¢ proc p = void : print (n); pp := p)if E1 and E2 are the environs established by the elaboration of the serialclausesmarked by the comments ¢I¢ and ¢2¢, then E2 is the environnecessary in E1 for the routine.text void: print (n), and so the routineyielded by p in E1 is composed of that routine-text together with E2(5.4.1.2). Therefore, the scope of that routine is the scope of E2 (2.1.3.5.c)and hence the assignment (5.2.1.2.b) invoked by pp := p is well defined.}7.3. Equivalence of modes{The equivalence or nonequivalence of 'MOlD's is determined in thissection. For a discussion of equivalent 'MOlD's see 2.1.1.2.}{One way of viewing recursive modes is to consider them as infinitetrees. Such a "mode tree" is obtained by repeatedly substituting in somespelling, for each 'MU application', the 'MODE' of the corresponding 'MUdefinition of MODE'. Thus, the spelling 'mui definition of structured withintegral field letter i reference to mui application field letter n mode'would give rise to the following mode tree:'structured with"I I J'integral" 'field" 'letter i'"structured with"I [ I"integral' 'field" "letter i'II'reference to"I'reference to"II''mode'I I"field" "letter n'II'field" "letter n'I(et cetera).''mode'Two spellings are equivalent if and only if they give rise to identical modetrees. The equivalence syntax tests the equivalence of two spellings by, asit were, simultaneously developing the two trees until a difference is found(resulting in a blind alley) or until it becomes apparent that no differencecan be found. The growing production tree reflects to some extent thestructure of the mode trees.}7.3.1. SyntaxA) SAFE :: safe ; MU has MODE SAFE ; yin SAFE ; yang SAFE ;remember MOIDI MOLD2 SAFE.
104B)C)D)E)a)b)c)d)e)f)van Wijngaarden, et al.HEAD :: PLAIN ; PREF{71A} ; structured with ;FLEXETY ROWS of ; procedure with ; union of ; void.TAILETY :: MOlD ; FIELDS mode ; PARAMETERS yielding MOlD ;MOODS mode ; EMPTY.PARTS :: PART ; PARTS PART.PART :: FIELD ; PARAMETER.WHETHER MOIDI equivalent MOID2{64b,71m,72c} :WHETHER safe MOIDI equivalent safe MOII)2{b}.WHETHER SAFEI MOIDI equivalent SAFE2 MOID2{a,b,e,i,j,n} :where (SAFEI) contains (remember MOIDI MOLD2)or (SAFE2) contains (remember MOLD2 MOIDI),WHETHER true ;unless (SAFEI) contains (remember MOIDI MOLD2)or (SAFE2) contains (remember MOLD2 MOiDI),WHETHER (HEAD3) is (HEAD4)and remember MOIDI MOLD2 SAFE3 TAILETY3equivalent SAFE4 TAILETY4{b,d,e,k,q,-},where SAFE3 HEAD3 TAILETY3 develops fromSAFEI MOIDI{c}and SAFE4 HEAD4 TAILETY4 develops fromSAFE2 MOID2{c}.WHETHER SAFE2 HEAD TAILETY develops fromSAFEI MOID{b,e} :where (MOLD) is (HEAD TAILETY),WHETHER (HEAD) shields SAFEI to SAFE2{74a,b,e,d,-} ;where (MOLD) is (MU definition of MODE),unless (SAFEI) contains (MU has),WHETHER SAFE2 HEAD TAILETY develops fromMU has MODE SAFEI MODE{c} ;where (MOLD) is (MU application)and (SAFEI) is (NOTION MU has MODE SAFE3)and (NOTION) contains (yin) and (NOTION) contains (yang),WHETHER SAFE2 HEAD TAILETY develops fromSAFEI MODE{e}.WHETHER SAFEI FIELDSI modeequivalent SAFE2 FIELDS2 mode{b} :WHETHER SAFEI FIELDSI equivalent SAFE2 FIELDS2{f,g,h,i}.WHETHER SAFEI PARAMETERSI yielding MOLD!equivalent SAFE2 PARAMETERS2 yielding MOID2{b} :WHETHER SAFEI PARAMETERSIequivalent SAFE2 PARAMETERS2{f,g,h,j}and SAFEI MOIDI equivalent SAFE2 MOII)2{b}.WHETHER SAFE1 PARTSI PARTIequivalent SAFE2 PARTS2 PART2{d,e,f} :WHETHER SAFEI PARTSI equivalent SAFE2 PARTS2{f,g,h,i,j]and SAFE1 PARTI equivalent SAFE2 PART2{i,j}.g)b)i)J)k)m)n)o)p)ALGOL <strong>68</strong> Revised ReportWHETHER SAFEI PARTSI PARTI equivalentSAFE2 PART2{d,e,f} : WHETHER false.WHETHER SAFEI PARTI equivalentSAFE2 PARTS2 PART2{d,e,f} : WHETHER false.WHETHER SAFEI MODEl field TAGIequivalent SAFE2 MODE2 field TAG2{d,f} :WHETHER (TAGI) is (TAG2)and SAFEI MODEl equivalent SAFE2 MOI)E2{b}.WHETHER SAFEI MODEl parameterequivalent SAFE2 MODE2 parameter{e,f} :WHETHER SAFEI MODEl equivalent SAFE2 MODE2{b}.WHETHER SAFEI MOODS1 mode equivalentSAFE2 MOODS2 mode{b} :WHETHER SAFEI MOODSI subset of SAFE2 MOOI)S2{I,m,n}and SAFE2 MOODS2 subset of SAFEI MOOI)SI{l,m,n}and MOODSI number equals MOOI)S2 number{o,p}.WHETHER SAFEI MOODSI MOODIsubset of SAFE2 MOODS2{k,l,46s,64b} :WHETHER SAFEI MOODSI subset of SAFE2 MOODS2{1,m,n}and SAFEI MOODI subset of SAFE2 MOODS2{m,n}.WHETHER SAFEI MOODIsubset of SAFE2 MOODS2 MOOD2{k,l,m,46s,64b} :WHETHER SAFEI MOODI subset of SAFE2 MOODS2{m,n}or SAFEI MOODI subset of SAFE2 MOOD2{n}.WHETHER SAFEI MOODI subset of SAFE2 MOOD2{k,l,m,64b} :WHETHER SAFEI MOODI equivalent SAFE2 MOOD2{b}.WHETHER MOODSI MOODI number equalsMOODS2 MOOD2 number{k,o} :WHETHER MOODSI number equals MOODS2 number{o,p,-}.WHETHER MOODI number equals MOOD2 number{k,o} :WHETHER true.q) WHETHER SAFEI EMPTY equivalent SAFE2 EMPTY{b} :WHETHER true.{Rule a introduces the "SAFE's which are used as associative memoriesduring the determination of equivalence. There are two of them, onebelonging to each mode. Rule b draws an immediate conclusion if the'MOlD's under consideration are already remembered (see below) in anappropriate 'SAFE' in the form 'remember MOIDI MOLD2". If this is notthe case, then the two 'MOlD's are first remembered in a 'SAFE" (the oneon the left) and then each "MOLD" is developed (rule c) and split into its"HEAD' and its 'TAILETY', e.g., 'reference to real' is split into referenceto" and 'real'.if the 'HEAD's differ, then the matter is settled (rule b): otherwise the'TAILETY's are analyzed according to their structure (which must be thesame if the "HEAD's are identical). In each case, except where the105
- 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 18 and 19: 34 van Wijngaarden, et al.j) WHETHE
- 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 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