1.1.3. The syntax of the strict language
1.1.3.1. Protonotions a) In the definition of the syntax of the strict language, a formal grammar is used in which certain syntactic marks appear. These may be classified as follows:
b) A "protonotion" is a possibly empty sequence of small syntactic marks.
c) A "notion" is a {nonempty} protonotion for which a production rule can be derived {1.1.3.2.a , 1.1.3.4.d}.
d) A "metanotion" is a {nonempty} sequence of large syntactic marks for which a metaproduction rule is given or created {1.1.3.3.a }.
e) A "hypernotion" is a possibly empty sequence each of whose elements either is a small syntactic mark or is a metanotion.
{Thus the class of protonotions {b} is a subclass of the class of hypernotions. Hypernotions are used in metaproduction rules {1.1.3.3 }, in hyper-rules {1.1.3.4 }, as paranotions {1.1.4.2} and, in their own right, to "designate" certain classes of protonotions {1.1.4.1 }.}
{A "paranotion" is a hypernotion to which certain special conventions and interpretations apply, as detailed in 1.1.4.2 .}
f) A "symbol" is a protonotion ending with 'symbol'. {Note that the paranotion symbol {9.1.1.h } designates a particular occurrence of such a protonotion.}
{Examples:
Note that the protonotion 'twas brillig and the slithy toves' is neither a symbol nor a notion, in that it does not end with 'symbol' and no production rule can be derived for it. Likewise, "LEWIS" and "CAROLL" are not metanotions in that no metaproduction rules are given for them.
g) In order to distinguish the various usages in the text of this Report of the terms defined above, the following conventions are adopted:
1.1.3.2. Production rules and production trees a) The {derived} "production rules" {b} of the language are those production rules which can be derived from the "hyper-rules" {1.1.3.4 }, together with those specified informally in 8.1.4.1.d and 9.2.1.d .
b) A "production rule" consists of the following items, in order:
{The optional asterisk, if present, signifies that the notion is not used in other production rules, but is provided to facilitate discussion in the semantics. It also signifies that that notion may be used as an "abstraction" {1.1.4.2.b } of one of its alternatives.}
c) An "alternative" is a nonempty sequence of "members" separated by commas.
{Examples:
e) A "construct in the strict language" is any "production tree" {f} that may be "produced" from a production rule of the language.
f) A "production tree" T for a notion N, which is termed the "original" of T, is "produced" as follows:
The "terminal production" of a production tree T is a sequence consisting of the terminal productions of the direct descendents of T, taken in order.
The "terminal production" of a production tree consisting only of a symbol is that symbol.
Example:
{The terminal production of this tree is the sequence of symbols at the bottom of the tree. In the reference language, its representation would be e+02.}
A "terminal production" of a notion is the terminal production of some production tree for that notion {thus there are many other terminal productions of 'exponent part' besides the one shown}.
{The syntax of the strict language has been chosen in such a way that a given sequence of symbols which is a terminal production of some notion is so by virtue of a unique production tree, or by a set of production trees which differ only in such a way that the result of their elaboration is the same (e.g., production trees derived from rules 3.2.1.e (balancing), 1.3.1.d,e (predicates) and 6.7.1.a,b (choice of spelling of the mode of a coercend to be voided); see also 2.2.2.a ).
Therefore, in practice, terminal productions (or representations thereof) are used, in this Report and elsewhere, in place of production trees. Nevertheless, it is really the production trees in terms of which the elaboration of programs is defined by the semantics of this Report, which is concerned with explaining the meaning of those constructs whose originals are the notion 'program'.}
g) A production tree P is a "descendent" of a production tree Q if it is a direct descendent {f} either of Q or of a descendent of Q. Q is said to "contain" its descendents and those descendents are said to be "smaller" than Q. {For example, the production tree
FIXME
occurs as a descendent in (and is contained within and is smaller than) the production tree for 'exponent part' given above.}
h) A "visible" ("invisible") production tree is one whose terminal production is not (is) empty.
i) A descendent {g}U of a production tree T is "before" ("after") a descendent V of T if the terminal production {f} of U is before (after) that of V in the terminal production of T. The {partial} ordering of the descendents of T thus defined is termed the "textual order". {In the example production tree for 'exponent part' {f}, the production tree whose original is 'plusminus' is before that whose original is 'digit two'.}
j) A descendent A of a production tree "follows" ("precedes") another descendent B in some textual order if A is after (before) B in that textual order, and there exists no visible {h} descendent C which comes between A and B. {Thus "immediately" following (preceding) is implied.}
k) A production tree A is "akin" to a production tree B if the terminal production {f} of A is identical to the terminal production of B.
1.1.3.3. Metaproduction rules and simple substitution {The metaproduction rules of the language form a set of context-free grammars defining a "metalanguage".}
a) The "metaproduction rules" {b} of the language are those given in the sections of this Report whose heading begins with "Syntax", " Metasyntax" or "Metaproduction rules", together with those obtained as follows:
b) A "metaproduction rule" consists of the following items, in order:
{The asterisk, if present, signifies that the metanotion is not used in other metaproduction rules or in hyper-rules, but is provided to facilitate discussion in the semantics.}
{Examples:
}
INTREAL :: SIZETY integral ; SIZETY real. {1.2.1.C }·
SIZETY :: long LONGSETY ; short SHORTSETY ; EMPTY. {1.2.1.D }
c) A "terminal metaproduction" of a metanotion M is any protonotion which is a "simple substitute" {d} for one of the hypernotions {on the right hand side} of the metaproduction rule for M.
d) A protonotion P is a "simple substitute" for a hypernotion H if a copy of H can be transformed into a copy of P by replacing eaclo metanotion M in the copy by some terminal metaproduction of M.
{Thus two possible terminal metaproductions {c} of "INTREAL" are 'integral' and 'long long real'. This is because the hypernotions 'SIZETY integral' and 'SIZETY real' (the hypernotions of the metaproduction rule for "INTREAL") may, upon simple substitution {d}, give rise to 'integral' and 'long long real', which, in turn, is because '' (the empty protonotion) and 'long long' are terminal metaproductions of "SIZETY".}
{The metanotions used in this Report have been so chosen that no concatenation of one or more of them gives the same sequence of large syntactic marks as any other such concatenation. Thus a source of possible ambiguity has been avoided.
Although the recursive nature of some of the metaproduction rules makes it possible to produce terminal metaproductions of arbitrary length, the length of the terminal metaproductions necessarily involved in the production of any given program is finite.}
1.1.3.4. Hyper-rules and consistent substitution a) The hyper-rules {b} of the language are those given in the sections of this Report whose heading begins with "Syntax".
b) A "hyper-rule" consists of the following items, in order:
c) A "hyperalternative" is a nonempty sequence of hypernotions separated by commas.
{Examples:
d) A production rule PR {1.1.3.2.b } is derived from a hyper-rule H R if a copy of HR can be transformed into a copy of PR by replacing the set of all the hypernotions in the copy by a "consistent substitute" {e} for that set.
e) A set of {one or more} protonotions PP is a "consistent substitute" for a corresponding set of hypernotions HH if a copy of HH can be transformed into a copy of PP by means of the following step:
{Since some metanotions have an infinite number of terminal metaproductions, the number of production rules which may be derived is infinite. The language is, however, so designed that, for the production of any program of finite length, only a finite number of those production rules is needed.}
{
f) The rules under Syntax are provided with "cross-references" to be interpreted as follows.
Each hypernotion H of a hyperalternative of a hyper-rule A is followed by a reference to those hyper-rules B whose derived production rules are for notions which could be substituted for that H. Likewise, the hypernotions of each hyper-rule B are followed by a reference back to A. Alternatively, if H is to be replaced by a symbol, then it is followed by a reference to its representation in section 9.4.1 . Moreover, in some cases, it is more convenient to give a cross-reference to one metaproduction rule rather than to many hyper-rules, and in these cases the missing cross-references will be found in the metaproduction rule.
Such a reference is, in principle, the section number followed by a letter indicating the line where the rule or representation appears, with the following conventions: