J. theor. Biol. (1971) 30, 455-484
Developmental Systems without Cellular Interactions, their Languages and Grammars ARISTID
LINDENMAYER
Centrale Interfaculteit der Rijksuniversiteit, Heidelberglaan Utrecht, The Netherlands
2,
(Received 31 March 1970) Formal systems are proposed and constructed to generate cellular arrays corresponding to developmental stages of some simple organisms: lower plants, snail embryos and leaves. Sets of these arrays are construed as developmental languages, and their complexity properties and generating grammars are compared with the classes of languages in the Chomsky hierarchy. Various branching patterns are compared with respect to such complexity classes. Theorems were obtained concerning partial characterizations of the class of developmental systems without cellular interactions, and some of the mathematical properties of this class are discussed.
1. Introduction Development at the multicellular level consists of the generation of strictures by cell division, cell enlargement, and cell death taking place at determined times and places in the entire life span of the organism. To regard cells as units in developmental processes follows naturally from their established autonomy of metabolic function and from their preservation of hereditary continuity. The recording of the fate of each cell throughout the life of the organism can be done either continuously in time or at discrete instants of time. The former approach has been pursued for some years, and results are available for the trajectories of cells in the course of growth. The latter approach, describing development in discrete time steps and in terms of discrete cellular arrays, has not been adopted yet by biologists to any appreciable extent, although the recent advances in finite mathematical methods, like those of automata and language theory, have provided rich foundations for such an investigation. Such developmental descriptions appear to be closer to our intuitive understanding of an organism, gained by looking at its structure from time to time on one hand, and by obtaining recordings of various aspects of its function on the other. In a similar way, the automata
or language theoretical 455
models of developing organisms
456
A.
LINDENMAYER
have instantaneous descriptions coupled with transition functions corresponding to the local transformations taking place. These local transition rules may eventually also be interpreted in terms of the unit roles played by individual genes in development. It is proposed, therefore, to represent developing organisms at given instants of time by arrays of symbols in one, two or three dimensions, each symbol corresponding to a cell. The organism in its entire life extent [the “complete biont” as defined by Woodger (1968)] is taken then as a sequence of such arrays, the first array to refer to the beginning of a fertilized egg. and the subsequent arrays to undergo changes of state in each cell and to increase in size, or eventually decrease. An organism of determinate life span has, in general, an infinite sequence of arrays (if the instantaneous descriptions are obtained frequently enough), of which a finite subsequence can be chosen to represent the organism for any practical purposes. Different organisms of a genetically homogeneous group will have sequences of somewhat different arrays due to differences in environmental factors and to indeterminacy of the developmental process. We shall consider here the set of all arrays which are found among the descriptions of the organisms of a homogeneous population, and call this set a developmental language. Another approach would be to consider the set of all sequences of arrays found in such a population, but we shall not pursue this at the present time. The set of all arrays can be infinitely large in each developmental language. for we do not place any limitation on the number and ultimate size of the organisms belonging to a group, even though each organism is represented by only a finite number of different arrays. At this stage we shall restrict ourselves to the development of organisms essentially one-dimensional in nature. Thus the correspondence between the cellular arrays we wish to consider and the strings of symbols one uses in abstract language theory is very close. Just as the theoretical linguists are concerned with production rules or transformation rules by which certain types of words or sentences can be generated, so are we concerned with finding developmental instructions with which known kinds of organisms can be generated. Thus we shall consider the generating constructs of linguists, called grammars, in relation to our systems. It is very helpful, furthermore, that an ordering relation exists already with respect to abstract grammars and languages (the Chomsky hierarchy of grammars), which we can utilize to provide us with an ordering of developmental generating systems and languages, giving us a measure of complexity in distinguishing primitive vs. advanced characters, whereas no such measure has been available before to biologists. In previous papers (Lindenmayer, 1968a,b; Surapipith & Lindenmayer,
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
451
1969) developmental stages of filamentous organisms were considered as expanding arrays of automata, with or without inputs coming from neighbouring cells. The systems considered in this paper (the OL-systems) are only those in which no communication takes place among the cells, or between the cells and the environment. Development with interaction among cells, in systems designated 1L or 2L according to whether inputs are passing in one or two directions along the array, was subject of formal studies by Herman (1969, 1970), Laing (1969) and van Dalen (1970). They pointed out, among other things, that every language which can be accepted by a Turing machine can be generated by one of these stronger systems. The OL-systems (without cellular interactions) are not as powerful as the 1L or 2L systems and some results will be mentioned in this paper concerning their formal properties. The language- and automata-theoretical definitions and results which are to be mentioned can be found mostly in the review article of Aho & Ullman (I968), and the relationship between these constructs and those of system and control theory in the book by Kalman, Falb & Arbib (1969). 2. Definitions
Dejinition I An alphabet is a finite set of symbols. The set of all finite strings formed from members of alphabet A is designated A*. The empty string e, the string of zero length, is also to be a member of A*. The set of strings over A without the empty string is designated A+, thus A’ = A*- {e>. If an alphabet consists of symbols 0 and I, G = (0, l}, then G* is the set of all finitely long sequences of O’s and l’s plus the empty string, thus G* = {e,0,1,00,01,10,11,000, . . . }. This set is infinitely large. Definition 2 A language over an alphabet A is any subset of A*, or, L is a language over A if and only if L c A*. A language may be empty, that is have no strings as members, or be finite or infinite. Dejinition 3 If x and y are strings from A* then their concatenated product xy is also to be a member of A*. Concatenation is to be associative, and the empty string e is to serve as the identity element with respect to concatenation, thus to give, for all x in A*, xe = ex = x. Under these assumptions A* with respect to the concatenation operator is a free semigroup. The n-times repeated concatenation of a string p is to be written as p”, and defined
458
A. LINDENMAYEK
recursively as: p” = e and p”+ ’ = p”p, for all integers n 2 1. The concatenation of sets of strings P and Q is defined by: PQ = {pqJp E P and qE Qh Definition 4
A grammar is a set of production rules (P) over a set of non-terminal (N) and a set of terminal (2”) symbols of an alphabet, with a certain non-terminal symbol (S) being designated as the starting symbol. More formally, a grammar G = (N, T, P, S> is a construct in which N and T are finite, disjoint sets, S E N, and Pis a set of ordered pairs (x-+v) such that x E (N u T)*N(N u T)* and y E (N u T)*. In this definition (N u T)* is the set of strings formed of any combination of non-terminal and terminal symbols. The set of which x must be a member is the set of all strings which contain at least one nonterminal symbol, and this is the only restriction put on the construction of the production rules in P. Dejinition 5
It is possible to define three main types of grammars, namely regular, context-free, and context-sensitive grammars, all of which are properly included in each other in this order and in the general class of grammars defined above (called the O-type grammars). The four types of grammars together form the Chomsky hierarchy, as discussed further below. A context-sensitive grammar G = (N, T, P, S) is a grammar such that every production rule in P is of the form (xaz -+ xyz), where x and z are members of T*, a is a member of N, and y is a member of (N u T)+. A context-free grammar G = (N, T, P, S) is a grammar in which all of the rules in P are of the kind (a + x), where a is a member of N and x is a member of (N u T)*. A regular grammar G = (N, T, P, S> is a grammar in which all of the rules in P are of the kind (a --+ b) or (a -+ bc), where a and c are members of N, and b is a member of T or b = e. In this paper we are concerned only with context-free and regular grammars. In these grammars the production rules must be such that there are single non-terminal symbols on their left-hand side. Thus the substitution which is allowed for a symbol depends only on that symbol and not on its context in the string. In regular grammars there are further restrictions on the type of terms which may occur on the right-hand side of the production rules. Dejnition 6
The language generated by a grammar is defined as follows. First we define a relation between strings p and q such that: p 2 q if and only if
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
459
there are strings X, y, z and w in (N u T)* for which it is the case that rule of G. Repeated application of the 2 relation gives us a sequence p. --+p, 2 pz 2 . . . ; pn,
p = xyz, q = xwz and (y + w) is a production
for which we shall write p 2 q whenever p,, = p and p. = q for some n 2 0. The relation 2 defined in this way is a reflexive, transitive closure of the previous relation 2. The language generated by the grammar G = (N, T, P, S) is now defined as L(G) = {plS-$ p and p E T*}. In other words, the language generated by a grammar is the set of all strings consisting of only terminal symbols which can be obtained from the starting symbol by a finite number of consecutive applications of the production rules to the strings, one at each time. Thus, in the case of a context-free grammar, in each step substitution is made for one non-terminal symbol in the string. The languages generated by certain types of grammar are called that particular type of language. Thus context-free grammars generate the set of context-free languages, and so on. It can be shown, then, that for all L: (1) if L is a regular language then it is context-free ; (2) if L is a context-free language then L- {e} is a context-sensitive language; and (3) if L is a context-sensitive language then it is an O-type language. Furthermore, the converses of these statements are not true. Thus these sets represent an ordering of languages, which is commonly referred to as the Chomsky hierarchy of languages. Regular languages can also be characterized algebraically, such as by Nerode’s theorem [cf. section 3(c)]. No such characterizations are known for context-free or context-sensitive languages, but there are partial results which can be used for our purposes (cf. Appendix, theorem 1). As an example for a language generated by a regular grammar, we can take the set of strings {(Ol)“ln 2 l}, i.e. the infinite set (01, 0101, 010101, . . . }. This language is generated by the grammar G, = (N,, T, P,, S), where N, = {S, a, b}, T = (0, l}, P, = - {(S + Oa), (S -+ Ob), (a -+ lS), (b -+ 1% An example for context-free but not regular languages is the set {O”l”ln > 1). which is the set composed of strings 01, 0011, 000111, and so on. This language is generated by the grammar G, = (N2, T, P,, S), where T is the same set as before, NZ = (S}, and Pz = ((S -+ OSl), (S -+ 01)). Dejinition
7
Systems are now introduced which generate linear arrays corresponding to the development of filamentous organisms. They are based on develop-
460
A.
LINDENMAYER
mental systems defined in previous papers (Lindenmayer, 1968a,b), and are distinguished from the grammars introduced above by the property that their production rules are to be applied sirnultaneousl~~ to all symbols in each array, and that all stritlgs generated from the starting symbol are to be in the language of the system, not only those which consist entirely of terminal symbols. The biological justifications for these innovations are given in section 3. The main difference from my previous definitions (Lindenmayer, 1968a,6) is in the fact that for each cell the output is now identified with the state, thus requiring no separate output function any more. Since the next-state function and the output function were both defined previously to range over the same arguments, a single function is substituted for both of them and this substitution is satisfactory for our present purposes. We define now only developmental systems for filaments without cellular interactions, to be called OL-systems [an abbreviation proposed by van Dalen (1970) to stand for “Lindenmayer-systems with zero-sided inputs”] as follows : An OL-system r = (G, g, S) is a construct such that G (the alphabet OI the generating set of strings) is a finite, non-empty set, g (the starting symbol or symbols) is a non-empty string of members of G. and 6 is a (transition) function first taken as a mapping from G into finite non-empty subsetsof G*, then extended to be a function from G* into finite non-empty subsets of G* by the rules: 6(pa)
= (qrJq E 6(p) and r E 6(a)) for all p in G* and all a in G,
d(e) = (e>, and for which the powers are defined by the further rules: and q E6(r))) 6’(p) = (p} for allp in G*.
P+l(p)
= {q1(3r)(r&‘(p)
for all (p) in G* and all II 2 I,
The language generated by an OL-system r = (G, g, S), the L(r), defined as L(T) = {p[(3n)(n 2 0 and p E S”(g))>,
is
or by the equivalent expression m-1 = “‘; ,(6”(g)). . The set of terminal symbols of an OL-system I? = (G, g, S) is defined as T = {ala E G and 6(a) = {u}}. The set of non-terminal symbols is then N = G-T, and we have G = NU T. Often we shall use the formalism (p -+ q) instead of q E 6(p) with reference to OL-systems in order to exhibit analogies with production rules and derivations in grammatical systems.
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
461
DeJinition 8
We also introduce certain particular types of OL-system with the following definitions: The OL-system IY = (G, g, S) is a propagating or POL-system if for all a in G, e $6(a); in other words, if the empty string e cannot be substituted for any symbol. The strings generated by such systems cannot decrease from one step to the next. The OL-system r = (G, g, S) is a determinate or DOL-system if for all a in G there is a stringp in G* such that 6(a) = {pj; in other words, if there is only one transition rule for every symbol of the alphabet. In these systems the 6 function is defined first as a mapping from G into G*, and then extended to be a mapping from G* into G* by the rules: 6(pa) = 6(p)6(u), 6(e) = e, for all p in G*, and a in G. and its powers are defined by the rules: h”+l(p) = &P(p)), So(p) = p, for all p in G*. The language of a DOL-system L = (G, g, S} may be defined as: L(T) = {6”(g)ln
2 0:.
If an OL-system is both determinate and propagating, it is then designated a DPOL-system. It is clear from the definitions that for all OL-systems (POL u DOL) c OL and DPOL = (POL n DOL). To each class of OL-systems a cIass of languages can be assigned, generated by those systems. Thus, we shall speak of OL, DOL, POL and DPOL languages as well as systems. 3. Developmental Systems and Languages We have defined a particular class of systems which we propose to use for generating certain kinds of developmental patterns, or better formulated, which are to be used to generate sequences of cellular descriptions of developing organisms. These systems differ from generating grammars in two important respects, namely the production rules (which we shall also call instructions) are to be applied simultaneously to all elements of a string, and the set of all strings generated is to be considered the language generated by the system. We can justify the first of these differences by pointing to the fact that in a growing organism development proceeds simultaneously everywhere. The various parts of a developing organism may or may not be in communication with each other, but that is a different matter. In the case of OL-systems we assume no communication among the cells, while in systems with one- or T.B. 30
462
A.
LINDENMAYER
two-sided inputs (Lindenmayer, 1968a,b)-to be called lL- and 2L-systems -communication was assumed. In all these systems the substitutions are to be made simultaneously. The justification of the second difference is as follows. Terminal symbols. i.e. symbols which remain the same in all further strings, can be interpreted as either irreversibly differentiated cells or as dead ones which remain permanently fixed in their places in the organism (if a dead cell is eventually to disappear from the organism then it should be represented by the empty string e). Irreversibly differentiated cells are, of course, known to be present in most higher plants and animals, the best examples being those cells which lose their nuclei in the course of development, like the phloem sieve cells or the red blood cells. But all living plants or animals seem always to contain some cells which are capable of division, and thereby capable of giving rise to other cells which in turn may differentiate or dedifferentiate as the case may be. In animals, regeneration processes go on even in old age, and in plants, some apices do not lose this capacity, even though they may become dormant, until the whole plant dies. Thus it would not make much sense to construct sequences of descriptions which are to be representative of organisms through their entire life span in which only terminal strings would be taken into account. In order to demonstrate the use of the mathematical concepts we defined, and to exhibit their properties and relationships, we proceed to a discussion of several concrete developmental systems and languages. (A)
THE
DEVELOPMENT
OF CALLITHAMNION
ROSEUM
(A
RED
ALGA)
On the basis of a detailed description of the development and cytology of CuZlithumnion roseum by Konrad-Hawkins (1964a,b, 1968) two systems have been proposed in a previous paper (Lindenmayer, 1968b) in which expressions could be generated corresponding to the development of branches in this alga. One of the systems proposed was one with two-sided inputs, while the other one was a DOL-system according to our present definition. Let us now consider a somewhat modified DOL-system for this alga, one which takes into account the progression from transverse to oblique cell walls which is so characteristic for this organism. This system C = (G. g, S) is to be such that its generating set G is composed of the numerals from 1 to 9 (except 3) for states of left and right parentheses for indicating the branches, and of two additional symbols 1 and / to indicate the presence of transverse or oblique walls between cells; the numeral 1 is to be the starting symbol, g = 1; and the 6 function is given by the following transition matrix: 12
* I v-7
4 215 ---..
5
67
615
7
8 8
9(l)
9 9
( (
1 )
j /
I i
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
463
This 6 function has one substitution rule (or instruction) for every symbol, thus it is deterministic. The set of terminal symbols consists of 2 and 9, the two parentheses and the two wall symbols since they are all transformed into themselves by the 6 function. The instruction (1 --t 214) is to be interpreted as a rule for every cell in state 1 to undergo division and give rise to two new cells in states 2 and 4 separated by a transverse wall. Similarly, the instruction (8 + 9(l)) means that every cell in state 8 divides and gives rise to a basal cell in state 9 and a branch cell in state 1. Since the empty string does not appear among the values of the 6 function, this system is a propagating OL-system. An infinite sequence of strings can be generated by this OL-system, beginning with the following six strings: so = 1 S, = 214 S2 = 21215 S, = 21216/5 S, = 21217/6/5 S, = 212/8/7/6/5 S, = 21219(1)/8/7/6/5 It can be seen that further strings are described by the formula, for all n 2 0, Sn+6 = 2~2~%%)/%%h/g. . . /g(s,>/g(s,>/8/7/6/5. This recursive formula, together with the expressions for the first six strings, actually defines the developmental language of C. roseum, i.e. according to our notation the L(C). The figure below shows the developmental stage corresponding to S14. The following assumptions are made when going from the strings of symbols to the drawings: The oblique walls are drawn alternately right and left
FIG.
1. Callithamnion
roseunr.
464
A.
LINDENMAYER
inclined (in nature they are usually arranged in a spiral fashion), the branches are shown as attached at 45” angles on alternate sides of the branch on which they are borne, and the branches originate where there is a left parenthesis in the string and terminate where there is a right parenthesis. The representation we get from the developmental system and the coding proposed here of young organisms of this species is not too unrealistic. We may consider the set L(C) from the point of view of the Chomsky hierarchy of languages and ask where it fits into the hierarchy. We can answer this question in the following way. We can easily prove that each string S,,, in L(C), for all in 2 6, is composed of a 2121portion, followed by the string S,,,-, preceded by 9 and left parenthesis and ended by right parenthesis and /, which is then followed by string S,,-, but without the 2121 portion at its left end. Symbolically this statement can be expressed as s, = 21219(~,-,)/K-, + 4311~ where the arrow operator between two strings gives rise to the remainder of the first string after the second string has been subtracted from its left end. This operator was defined previously (definition A13b of Lindenmayer, 196&z) : s=ptq if and only if p = qs. From the formula for S,,, it follows that the length of each string S,,, in L(C), for all m 2 6, can be expressed as I(&)
= Z(S,-,)+I(&-,)+8-4.
We can assume a homomorphism h which assigns a particular symbol, say a, to every symbol in the strings of L(C). Thus the set h(L(C)) consists of strings of a’s the lengths of which are given by the last formula. If this set is context-free, then the set of numbers expressing the lengths of the member strings must be an ultimately periodic set of integers (cf. theorem 3.1.2 and corollary 3.1.1 of Ginsburg, 1966), since this is a language over a one-letter alphabet. But it can be directly seen from the last formula that the set of lengths of h@(C)) cannot ultimately be periodic (for definition of an ultimately periodic set see Ginsburg, 1966, p. 3). Thus h(L(C)) is not a context-free language, and neither is L(C). This last step follows from the theorem (theorem 7.5 of Aho & Ullman, 1968) that the set of context-free languages is closed under arbitrary homomorphisms. Therefore, if L(C) is context-free then h@(C)) must also be context-free, and conversely, if the latter set is not context-free then the former cannot be either. We can thus conclude that the language of developmental system C is not context-free. Since a theorem is available (Rozenberg & Doucet, manuscript in preparation) stating that all OL-languages are context-sensitive,
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
465
we can say that L(C) is a context-sensitive but not context-free language. It should be pointed out here, however, that the non-context-free nature of this language can be attributed to the synchrony imposed upon divisions and changes of states by the determinate set of instructions of C. If the synchrony requirement were relaxed by using a certain non-determinate set of instructions, as in the following section, the language would be contextfree. The conclusion at which we shall arrive (see theorem 3 in the Appendix) will be that developmental systems without cellular interactions and without synchrony always generate context-free languages. This conclusion will furnish us with the intuitively satisfying connection between context-freeness and lack of cellular interactions in developmental systems, The branching pattern generated by this system under our conventions is a type of monopodial branching which we shall call “recursive monopodial branching”. The proof used above in establishing L(C) as a non-context-free language was suggested by J. van Leeuwen, and the same method could be used to prove theorem 1 in the Appendix as well. (B)
LEAF
DEVELOPMENT
IN PHASCUM
CUSPIDATCJM
(A MOSS)
As another instructive example we may consider an early description by Nageli (1845) of the development of leaves in the moss Phascum cuspidatum. This case is the more interesting because Nageli gave a set of formal developmental instructions in his paper which can be regarded as the forerunners of the language-theoretical systems we are discussing. Nageli gave a diagrammatic figure of the apical part of a Phascum leaf (his Fig. 17, Plate II) which we reproduce below with his symbols in a slightly modified form.
FIG.
2. Leaf
of Phascum
cuspidatum.
Nageli recognized three kinds of cells in such a leaf according to position: primary (I), secondary (II) and tertiary (III) cells. The superscripts on his
466
A.
LINDENMAYER
symbols indicate the kind of division which gives rise to a particular cell: the left superscript is increased by one each time an anticlinal division occurs (division plane perpendicular to the outline of the leaf), and the right superscript is increased by one each time a periclinal division takes place (division plane parallel to the outline). The general formulae (or instructions) he gave were as follows (in our slightly modified form): I + *II’ + I “II” + III” + YI”+ t “II” -+ m+I~~ll+m+l~y~
or
Thus, a primary cell always gives rise to another primary cell and to a secondary cell of order (1, 1). A secondary cell of order (m, n) has a choice: it can either give rise to a tertiary cell of order II and to a secondary cell of order (m, II + 1) by a periclinal division, or it can produce two new secondary cells of order (m + 1, n) by an anticlinal division. According to him the tertiary cells also divide occasionally, but he did not carry the scheme far enough to include them (this is why tertiary cells have only one superscript). In constructing our developmental system for this type of leaves, we propose to keep Nageli’s distinction of primary, secondary and tertiary cells, to be designated 1, 2 and 3, but we introduce two essential modifications to his system. The first of these concerns the method by which positions of cells and division planes are to be indicated. We shall use parentheses to delimit imaginary branches within the leaf in alternating left and right positions along the midrib. Thus the instructions of our OL-system P for H~~sntnz leaf development include the following ones, directly comparable to Nageli’s instructions above: I -+ (2)l. 2 -+ 32, 2 -+ (2)(2). We also must have instructions
for the terminal
symbols:
3 -+ 3, ( -+ (, > -+ ). The second essential deviation from the original system lies in the fact that we also assume two identity rules for the two non-terminal symbols: 1 --) 1, 2 --f 2. These additional rules are necessary because of the problem of synchronous cell divisions. When we produce strings of symbols in OL-systems, it is assumed that the changes in state and the divisions take place more or less synchronously. In contrast, Nageli’s rules were only meant to determine which cell type gave rise to which other cell types by what kind of division, and not the time at which these changes were to take place. In order to provide a system which would produce the same cell arrays that Nageli drew
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
467
in his diagrams we must allow each cell in state 1 or 2 to remain in that state in each computation, or to divide, in a non-deterministic fashion. Thus the whole 6 function of the OL-system P consists of the following: &l) = {W, 11, h(2) = (32, (2)(2), 2), 6(3) = {3}, and &left parenthesis) = (left parenthesis), @right parenthesis) = {right parenthesis}. Taking 1 as the starting symbol, in each computation we get several strings from each previous string, which can be arranged in a tree-like structure:
One of the strings produced in seven steps is the one that corresponds to Fig. 2, namely: (3(32)(32))(3(32)(32))(3(2)(2))(3(2)(2))(32)(2)(2)1. In this leaf there are seven imaginary branches alternately on either side of the midrib, each indicated by a pair of parentheses in the outermost positions. The first four of these branches have each branched dichotomously, representing the anticlinal divisions. The periclinal divisions are not marked by parentheses, they are assumed to produce rows of cells along the branches. The divisions of the apical cells (the primary cells) may be considered to give rise to monopodial branching. The representation by drawing we chose for the strings is clearly not a unique one. Neither are the string expressions unique representations of the drawings. Nevertheless, as long as the conventions for preparing the drawings are followed consistently, the strings produced by the OL-system can be converted into unique and distinguishable drawings and thereby the performance of the OL-system can be tested against nature. There is no recursive formula we can offer for the language of this OLsystem, the set L(P). We can state, however, that this language is contextfree. This follows from theorem 3 (in the Appendix), which states that every OL-system which has identity instructions of the form (a --t a) for every symbol c1in its alphabet generates a context-free language. Thus we see that by introducing the identity rules in order to relax the synchrony requirements, and thereby allowing a much wider selection of leaf forms, we have also
468
A.
LINDENMAYER
reduced the complexity of the resulting developmental language from context-sensitive to context-free. It is the case, namely, that without the identity rules this system would essentially be a recursive dichotomous branching system [to be discussed in section 3(c)], the language of which would be context-sensitive but not context-free according to theorem 1 [see example (3) to that theorem]. (C)
COMPARISON
OF BRANCHING
SYMPODIAL
AND
SYSTEMS:
MONOPODIAL,
DICHOTOMOUS
Branching patterns can be generated by OL-systems, as we have seen, on the basis of certain conventions for the translation of parenthesiscontaining strings into drawings. The conventions are consistent with those we used in the previous two sections, and can be briefly restated as follows: (1) a branch is drawn attached to a cell following which there is a left parenthesis in the string; (2) a branch terminates where there is a right parenthesis in the string; (3) whenever there is an expression . . .a(p)b(q). . . in the string, the branches p and q are drawn at some constant angle on alternate sides of the branch on which they are borne (to which cells a and b belong); and (4) whenever there is an expression , . . a(p)(q). . . in the string, the branches p and q are drawn on opposite sides of the branch to which a belongs. If these conventions seem to be inadequate since, for instance, they do not permit the occurrence of two consecutive branches on the same side of a main branch, then one could introduce two kinds of left parentheses, (L and (R, with which any left or right sequences of branches could be coded. Or, if one wishes to represent branching patterns other than those on the plane, then one can introduce even further auxiliary symbols, e.g. three different kinds of left parentheses for three-ranked positions of branches. Development of branching systems in which mutual inhibition of branches takes place cannot be programmed by OL-systems, however, since in these cases one must provide for the effect of the environment on the cells. We have mentioned in section 3(~) that recursive monopodial branching patterns can be obtained by OL-systems like C. We may elaborate here on the generation of such branching patterns, and their comparison with recursive dichotomous branching. Let us make an OL-system l’, = (G, g, 6,) with an alphabet G = {g, d, (, )>, and with the instructions g --, d(g)g, d -+ d, (-+(. ) -+ ). Let us furthermore construct another OL-system I2 = (G, g, S,) with the same alphabet and the same three terminal symbols, but with a different instruction for the non-terminal symbol g -+ d(g)(g). We claim that I1 generates recursive monopodial branching, while I2 generates recursive dichotomous
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
469
branching under our conventions. To show this, we show first a few initial strings produced by these systems, and then the corresponding drawings (for the fourth string in each language, labelling each segment with its symbol). a-1):
FIG.
g dkk 44dgMglg
3. Recursive monopodial
and dichotomous branching.
Of course, recursive monopodial and dichotomous patterns can be produced by many other OL-systems, with more intermediate symbols, such as the Callithamnion and Phascum systems. For the simple synchronous systems given here we can definitely state that their languages are not context-free. This follows from theorem 1 (Appendix). In the case of I1 the symbols a, b and c of the theorem can be substituted as follows: a = [d(], b = [)], and c = e. In the case of I2 the substitutions are: a = [d(], b = ()(] and c = D]. Since all of the symbols substituted for a, b and c are terminal symbols in F1 and F,, they satisfy the requirements of the theorem, and so do the instructions of these systems. Thus the statement of the theorem is applicable to their languages. There are also non-recursive monopodial and dichotomous branching patterns. We obtain the non-recursive monopodial system by substituting a terminal symbol f for one of the g’s in the instruction g + d(g)g, thus obtaining g -+ d(f)g as the instruction of OL-system I3 = (G’, g, S,), where G’ = {g, d,f, (, )}. If we substitute f for the other g in the first
470
A.
LINDENMAYEK
instruction then we obtain g -+ d(gyof system lY4 = (G’, g, 8,). As we shall see, this system produces a branching pattern commonly known as sympodial or cymose branching. The substitution off’s for g’s in the instruction of the recursive dichotomous system r2 does not produce any growing pattern. We show below the first few strings generated by r3 and ra, and the corresponding drawings, obtained as previously.
FIG.
4. Monopodial
and sympodial branching.
As to the complexity of L(T,) and L(I’,), we can state the following. The language of the monopodial system can be expressedas wd = U4f)l%l~ 2 01, while the language of the sympodial system is meaning that the portions in brackets are repeated n-times in the strings which are generated by these systems. The language of lY3 is very similar to sets of expressions for banded patterns. These patterns are, of course, wide-spread in nature, from alternating nodal and inter-nodal cells in algal filaments, to segmentedbodies of worms and insects, and to the series of vertebral elements in the vertebrates. A language for a banded pattern has already been introduced in definition 6 in section 2 as an example for regular languages: the set {[Ol]“jn 2 11. From the similarity between this set and L(lY,) it is already apparent that L(T’,) should also be a regular language. This can be proven however, using theorem 4 (Appendix). In contrast, the language of the sympodial system can be proven to be not regular, and to be context-free. To prove that L(T,) is not regular, we can
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
471
make use of a theorem due to Nerode, as formulated by Rabin & Scott (1959). This states: Given an alphabet A and a set of strings U which is a subset of A*, U is a regular set (this term is taken to be synonymous to their term “definable set”) if and only if the following conditions hold: there is a right-invariant equivalence relation E,, defined by the following formula for all x and y in A* xEuy = (Vz)(z E A* 1 (xz E U = yz E U)),
and E, is of finite index. Thus, if I&,) is a regular language, there must be a right-invariant equivalence relation ELI of finite index for U = L(T,) of the kind specified. Since E, must be of finite index, there must be two natural numbers WI and n such that FH + n and it is the case that unEu~rm, and therefore lfgv” E u 52 urngunE u, where u = [d(] and z) = [)/-I which are the terms which occur in the definition of L(T,). Since we know from this definition that, for all n, u”gu” E L(T,), the above statement would require that some string zPga”, where m + n, should also be a member of L(T,). But this would contradict the definition of L(T,). Thus there is no such relation ELI which satisfies the theorem for U = L(T,), and consequently L(T,) is not a regular language. To prove that L(T,) is context-free one would need either to construct a context-free grammar which would generate this language, or to construct a push-down automaton which would accept this language. These constructions can be carried out but are not included here. Thus these considerations indicate that under our present coding conventions simple monopodial branching patterns correspond to regular languages, while sympodial branching patterns correspond to context-free but not regular languages. One must be very cautious about the possible evolutionary interpretation of this result, in the sense that this would show that monopodial branching is a more “primitive” pattern, and sympodial branching a more “advanced” one, because the result depends on the particular coding of the two-dimensional representations of branched figures into onedimensional strings of symbols. There are other conceivable coding conventions under which both monopodial and sympodial patterns would correspond to context-free but not regular languages, and there are even some codings under which the monopodial pattern would be non-regular and the sympodial pattern regular. But these latter conventions are unsatisfactory to code for complicated branching patterns in general. The coding conventions we have chosen for presentation above are satisfactory for an unique one-to-one encoding for a wide variety of branching structures, and they are also able to provide the shortest string descriptions of any coding
A. LINDENMAYER
472
found so far. Thus there is an intuitive sense according to which the coding presented at the beginning of the section is as good or better than any other, but this intuition would have to be based on firmer formal grounds before valid conclusions can be drawn about the complexity classes of branching patterns. Similarly we must emphasize that the fact that recursive monopodial and dichotomous branching patterns appear to be related to noncontext-free languages is also attributable partly to the same coding conventions, and partly to the synchrony requirement in the deterministic OL-systems which was mentioned already in the previous two sections. Definitely further work is necessary before complexity classes can be assigned to branching developmental systems. The same problems do not affect. however, the non-branching systems, of which two examples are presented in the following. (D) CELL LINEAGE OF RADIALIZED EMBRYOS OF LIMNAEA STAGNALIS (POND SNAIL)
Raven (1968) gave sets of instructions for cell division and differentiation processes to describe the development through the first seven cleavages of lithium treated embryos of this species. Lithium treatment suppresses the development of bilateral symmetry in this organism, and gives rise to radialized larvae. System I of Raven can be readily construed as an OLsystem L with which we can generate the lineage of these embryos as given in Fig. 4 in Raven’s paper. There are to be 15 symbols in the alphabet of L, of which two are terminal: p-for prototroch cells and a-for apical plate cells, and i is the starting symbol (the ovum). The simplified symbols used here differ from those in the paper in the following way: the numerals 1 to 9 stand for symbols q1 to q9, p stands for both qlo and P, a stands for both qlr and A, and the letters b, c, d and f stand for symbols q12 to q15. The 6 function given here deviates from the original instructions in the rule for f due to a correction by Raven (personal communication), and by adding the (c --f c) rule to relax synchrony. 6
I
1
2
3
4
5
6
7
8
9
a
b
c
c
d
.f
p
22
33
45
67
dc
89
pp
ab
67
a
ac
cc
c
fc
7c
p
The first three cleavage divisions sequence : s, = 1
are represented
s, = 22 s, = 3333 s, = 45454545
by the following
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
473
The cells labelled 4 are the micromeres and those labelled 5 are the macromeres. The development of the four micromeres is identical in radialized embryos, and so is that of the four macromeres. Thus we need to compute the subsequent strings for only one “45” pair of cells, and form the complete strings by repeating these four times. s3 S, S, s, s,
= = = = =
[45]4 [67dc14 {[89ppfc~+]~) {[&7pp7cc+c+]4) {[uucacppppppc+c+c+]4},
After the seventh cleavage according to these instructions growth consists only of divisions of c cells. In the above strings the notation c+ was used to indicate that the number of c cells produced is indeterminate since at each computation each c cell may or may not divide. The language of system L consists then of sets of strings, one set for each n 2 0, described by the formula : Sn+, = ([aac+ac+ppppppc+c+c+14), where the length of each cf portion can range from one up to a value related to 2”. This language is regular since it is quite easy to construct a regular grammar which generates this language. It is closely related to the language (g}’ which is mentioned in the example to theorem 3 (Appendix). Without the c + c rule in the 6 function of the Limnaea system one would have a much more restricted deterministic developmental language resulting from strictly repeated c + cc divisions, and its language would be neither regular nor even context-free. The present example demonstrates how cell lineages can be constructed by sets of instructions which can be handled formally in a more efficient and concise way than the original lineage diagrams could be. Raven’s system II provides instructions not only for division and differentiation steps, but also for the spatial directions in which the divisions should take place, such as dorsoventral, sinistrodextral, dextrotropic and laevotropic divisions. These terms refer to the orientation of division planes, and in this sense are comparable to the transverse and oblique division instructions which were used in section 3(~). However, the development of a snail embryo is a truly three-dimensional process while the development of this red alga is an essentially one-dimensional one, although branching takes place in two or three dimensions. The present OL-systems, acting on linear strings with or without parentheses, cannot handle truly two- or three-dimensional structures. They may, however, be extended to cover such structures.
474
A. (E)
THE
DEVELOPMENT
LINDENMAYER
OF A LEAF
WITH
LOBES:
TERMINATING
GROWTH
Let us consider the general case of the development of a leaf of a higher plant, paying attention to the margin of the leaf and neglecting the growth of the lamina. We assume a string of cells to correspond to the margin of the leaf, first this string to grow in length, and successively all the cells in it to become differentiated into three terminal types of cells. These types are to be: l-the cells at the tips of lobes, O-the cells at the notches between the lobes, and 2-non-dividing cells elsewhere on the margin. We want development to progress until five lobes are produced and then cease. Figure 5 shows a leaf corresponding to the terminal string. In this example we programmed only for two type-2 cells to occupy the space between each tip and notch of a lobe, but we could have made their number larger, or different for each lobe (to correspond to size differences between lobes), without changing the principles of the system. The same goes for the number of lobes as well, and for systems producing leaves with multiply dissected lobes or leaflets. The OL-system T gives rise to this leaf under the above interpretation Its alphabet has 16 symbols, the letters from a to 111,except I, plus S, and the numerals 0, 1, 2, which are the terminal symbols. The 6 function is: Sabcdef’ghij ab dg e0 22 Oe cf I
lc
-__hb di jk
_ ml
k..- Ill CO Oc
The language generated by T consists of the following nine strings (the vertical lines indicate the position of the central growing point of the leaf, and the horizontal marks show the lobes as they appear in Fig. 5): :‘b d glee Oe]hibcf0 ,
ofi;p
0221220221& 022122022122022
1220221220221220 1 220221220221220
t
The reason that a 16 symbol alphabet is needed for a system to produce so few simple strings is, first of all, that the growth process has to be stopped at a predetermined stage, and second, that the resulting final string has to be a symmetrical structure. These objectives could be accomplished with fewer symbols and instructions if interaction among the cells were allowed, or if instructions of the form a --+ bed were admitted (substitutions of three cells for one). Because substitutions of two cells for one are considered natural as standing for cell divisions, the former kinds of instructions were ruled out.
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
475
The language generated by this system is regular, since it consists of finitely many strings. We could also regard this case as an example of a determinate grammar, which, as all such grammars, has a single string of terminal symbols in its language, namely the final string. The requirement that all substitutions must be of strings not longer than two results in an asymmetric development of the leaf, in spite of the fact that the final string is symmetrical. This seems to be a general characteristic of leaf development, as was illustrated in great detail by Heidenhain (1932). Another biologically interesting aspect of this system is that if the central growing point of the leaf should die at some intermediate stage, the lobes which by then have been initiated will continue to expand. In this case the system will produce a truncated leaf with one or more fully expanded lobes in the basal part of the leaf, an example being given in Fig. 5. Such shapes are familiar to everyone who has seen leaves the tips of which have been damaged by a late frost in the spring.
FIG. 5. Outlines of fully developed leaf and of leaf with dead growing point.
4. Conclusions The biologically important conclusions of this work appear to be, first, that with appropriately constructed formal systems expressions can be generated which when translated into drawings on the basis of explicit conventions are found to represent more or less accurately the development at the cellular level of a variety of simple organisms. The developmental systems discussed here were all essentially of one-dimensional nature, simple or branching filaments of algae mosses or fungi, and cell sequences corresponding to levels in lineage diagrams of snails or along the outlines of leaves. The method has been extended to two-dimensional structures, such as phyllotactic patterns on shoot apices, the results of which will be reported elsewhere. Further work will also be reported on one-dimensional systems with inputs among the cells. This approach is not directly applicable to development with cell or tissue movement, such as is the case in many animal embryos, but it might be modified to allow for that, too. Neither is it able to account for cell enlargement or changes in cell shape.
476
A.
LINDENMAYER
From a biochemical point of view, the states associated with each cell in the course of development may be construed as the presence or absence of metabolites, their concentrations (including gradients), or the presence of inert structural elements in the cells. On the other hand, the instructions which determine the state transitions or divisions may be construed as the activity or inactivity of certain genes or protein synthesizing systems, the presence of particular enzymes, or the inherent polarity of the cells. In this way, it is thought that the role of controlled gene activity in development can be expressed, and the power of various developmental models can be compared on the basis of these formal systems. The OL-systems introduced here seem to be interesting to mathematicians because of the properties of the class of languages generated by them. This class of OL-languages has non-empty intersections with three of the main language classes, the regular, context-free, and context-sensitive languages. It can also be shown that there are languages in each of these classes which cannot be generated by OL-systems. Theorem 3 states that OL-systems with identity rules for all symbols in their alphabets generate only context-free languages. The presence of identity rules for all symbols means that in these systems there is no requirement to change any particular symbol at any particular step, thus it abolishes the synchrony for changes of states and cell divisions. It is clear that in a living cellular system synchrony can only be maintained over a longer period of time if there is some mechanism for communications among the cells. But developmental systems with cellular communications would intuitively be considered context-sensitive. The result of theorem 3 is thus in agreement with our intuition that development without cellular interactions and without synchrony should generate context-free sets of organismic descriptions or patterns. By theorem 2 we also know that canonical extensions of all context-free languages can be generated by OL-systems. This means that although many context-free languages cannot be generated directly, one can always find an OL-system which will generate a language that contains any particular context-free language L(G) together with some other strings in which not all symbols belong to the terminal alphabet of G. Thus a developmental system without cellular interactions, i.e. an OL-system, can generate a canonical extension of such a well-known context-free language as the set of all symmetrical strings over some alphabet A (palindromes): (wwR(w E A*}, where wR is the string w written in reverse. The language of the OL-system will be: {w(S or e)wRlw E A*}, if constructed in accordance with theorem 2, from a grammar containing productions (S -+ a&z) for all symbols a in its alphabet, and the production (S -+ e).
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
477
Theorem 4 states that OL-systems with all instructions of the form (a + t) or (a + tb), where t is a terminal symbol in the system (its only instruction is 2 + t), generate only regular languages. The condition imposed here is that strings can grow at one end only, in this case at their right end. As examples we may mention the linear growth pattern shown in Fig. 6 of Lindenmayer (196&z), which can be generated by an OL-system with the instructions (1 + 01) and (0 --t 0); or simple banded patterns, which can be produced by OL-systems like the one with the following instructions: (1 + 23), (2 + 2), (3 --) 41), (4 + 4). Both of these systems satisfy the above condition, and their languages are regular. These theorems define some OL-systems which generate context-free or regular languages. There are no normal form theorems available for OL-systems; however, theorems which would state what kind of instructions an OL-system must have to generate a particular class of languages are conceivable. If such theorems could be found, they would enable us to state what types of instructions, leading to divisions or to differentiation, an organism must have in order for the developmental language of that organism to fall into a given complexity class. As far as the weaker subclasses of OLsystems are concerned, the DOL, POL and PDOL systems, it can be shown that their languages are not included in regular or in context-free languages (Doucet, unpublished work). DOL and POL languages are also incomparable with each other, i.e. there are some members in each set which are not in the other set (also Doucet’s results). Finally, we have made use of recent results of Rozenberg & Doucet (manuscript in preparation) stating that all OL-languages are contextsensitive. This is the only definite inclusion relationship that has been found so far with respect to OL-languages and the Chomsky hierarchy of languages. This result implies that the membership question is solvable for OL-languages, i.e. it can be effectively decided whether a given string is in a given OLlanguage or not. Rozenberg & Doucet have also obtained results showing that the class of OL-languages is not closed under any of the usual operations on languages (union, intersection, etc.) and thus it is not an abstract family of languages. I am very grateful for the constant help and criticism received on the mathematical aspects of this work from Dr D. van Dalen, Dr G. Rozenberg, Mr P. G. Doucet and Mr J. van Leeuwen, all of the University of Utrecht, and from Dr G. T. Herman of the State University of New York at Buffalo. I also deeply appreciated the use of the physical facilities and the stimulating company of the developmental biologists that I enjoyed in 1968-69 at the Hubrecht Laboratory of the Royal Netherlands Academy of Sciences and Letters, in Utrecht. This work was supported partly by grant GM 12547 from the U.S. Public Health Service. T.B. 31
478
A.
LINDENMAYER
REFERENCES AHO, A. V. & ULLMAN, J. D. (1968). Math. Syst. Theory 2, 97. DALEN, D. VAN (1970). Math. Syst. Theory (in the press). GINSBURG, S. (1966). The Mathematical Theory of Context-Free Languages. New York: McGraw-Hill. HEIDENHAIN, M. (1932). Die Spaltungsgesetze der B/titter. Jena: G. Fischer Verlag. HERMAN, G. T. (1969). J. theor. Biol. 25, 421. HERMAN, G. T. (1970). J. theor. Biol. 29, 329. KALMAN, R. E., FALB, P. L. & ARBIB, M. A. (1969). Topics in ~u/hemuticaZ System Theory. New York: McGraw-Hill Book Co. KONRAD-HAWKINS, E. (1964a). Protoplasma 58, 42. KONRAD-HAWKINS, E. (19646). Protoplasma 58, 60. KONRAD-HAWKINS, E. (1968). Am. J. Bot. 55, 255. LAING, R. A. (1969). Univ. Mich. tech. Rep. 08226-8-T. LINDENMAYER, A. (1968~). J. theor. Biol. 18, 280. LINDENMAYER, A. (19686). J. theor. Biol. 18, 300. MINSKY, M. (I 967). Computntion: Finite and Itzfinite Machines. Englewood Cliffs : PrenticeHall, Inc. N.‘&GELI,C. (1845). Z. tviss. Bot., Ziirich, 2, 138. RABIN, M. 0. & SCOTT, D. (1959). IBM Jl Res. Dev. 3, 114. RAVEN, C. P. (1968). Acta biotheor. 18, 316. SURAPIPITH, V. & LINDENMAYER, A. (1969). J. gen. Microhiol. 57, 227. WOODGER, J. H. (1968). Acta biotheor. IS, 125.
Appendix Lemma I Given any deterministic OL-system r = (G, g, S) such that the alphabet G consists only of symbols g, a, b and c, of which a or b or c may be (individually or in any combinations) identical to the empty string, and the 6 function consists only of the following rules: (g + agbgc), (a --+a), (b + b), (c + c). Then the language of IY is identical with the set of strings S,, for all n 2 0, such that S, = g and S,,, r = a&b&c. Proof First we prove by mathematical induction that, for all n 2 0, P+‘(g) = aS”(g)bd”(g)c. Since we are dealing with a deterministic OL-system, the term P(g) designatesa single string rather than a set of strings. From the instruction (g + agbgc) we can obtain al(g) = agbgc. By definition we also have 6’(g) = g. Thus we obtain the first step of the induction : &l(g) = a6°(g)bd0(g)c. We then assume that 6”(g) = aa”-‘(g)ba”-‘(g)c, similar statement holds for P+l(g).
and try to show that a
DEVELOPMENTAL 6" + '(g)
LANGUAGES = &Y(g))
= &z6"-
AND '(g)bP
GRAMMARS
479
- l(g)c>
= s(a)s(sn-yg))6(b)6(6"-yg))6(c) = uG"(g)bS"(g)c.
Since by definition the language of a DOL-system is the set {P(g)jn 2 0}, and since we can designate each string as S, = P(g), we have now proved that languages of the DOL-systems defined above, for any substitutions for a, b and c, are the sets {&In 2 0} where S, = g and S,,, , = aS,bS,c. Theorem 1 If r = (G, g, S) is a DOL-system as defined in lemma 1, then the language of r is not context-free. Proof Use is made of a theorem of Bar-Hillel, in the form given by Aho & Ullman (1968) : If L is a context-free language, then there is a natural number p such that if string z is in L, and the length of z is greater than or equal to p, then z can be written as a composite string uuwxy, where the length of uwx is less than or equal top, strings u and x are not both identical with the empty string, and for all positive integers k, the strings uv”wx”y are in L, We assume that L(T) is context-free. Then, according to the theorem, there must be a positive integer p which satisfies the theorem. In particular, for any string z in L(T), if Z(z) 2 p then there is a decomposition z = uvwxy such that Z(vwx) I p, either v f e or x f e, and for all k the strings uvkwxky are in L(T). We choose such an integer p > 0. According to lemma 1, if S, = g and S,, i = aS,bS,c, then L(I) = {S,ln 2 O}. We choose a string S,, in L(I) such that I(&) 2 p, and we apply the decomposition to this string. s, = U7WXJ’. (Al) Then, by the definition of L(I), Sn+l = aS,,bS,c (A-2) Sn+2 = a&+ ,bS,,, 1 c = aaS,,bS,,cbaS,,bS,,cc. (A3) We can state then for all 1 2 n +2 that SI = a’-“S nbS“C.. . aS,,bS,c’-“. C.44) Since, for all k the string uvkwxky must be in L(T), zro3wjx3ymust also be in L(T). Also, according to the lemma all strings in L(T) are uniquely numbered, therefore there must be an integer n1 such that s, = uv3wx34’. (A3
480
A.
LINDENMAYER
We can show that this integer m must be greater than or equal to tz + 2. This follows from the requirement that either v f e or x =l=e, by which we know that Z(uv3wx3y) > I(uo2~~x2y) > I(uvwxy). But then there must be an integer q such that m > q > IZand f(S,,,) > &S,) > I(S,). This is only possible if m 2 n +2. Thus by lines (A4) and (A5) we get S,,, = uv3wx3y = a”-“&b&c.
. .aS,,bS,,c”-“.
646)
Then we take string S,, out of string S,,, and find that the length of the remaining string must be greater than or equal to 3p if the length of S,, is greater than or equal to p, as it was assumed at the beginning. I(&)-I(&)
= l(v*x*)
= Z(a”‘-“bS,c.
. .aS,,bS,c”-“)
2 3p.
647)
If ~(v*x*) furthermore I(VWX) 5 p. the theorem, Note that
2 3p, and p is a positive integer, then Z(vx) 2 sp > p, and Z(vwx) > p. But this contradicts the initial assumption that Thus we must conclude that there is no such p which satisfies and therefore L(I) is not a context-free language. we could not derive this contradiction if we took s, = uv*wx*y because then we would get l(S,,,) -l(S,)
= Z(vx) = &urn-“b. . .&cm-“)
2 p,
from which it would follow that Z(vwx) 2 p, but this does not contradict I(vwx)
5 p.
Examples
Examples for languages generated by DOL-systems with instructions of the form g -+ agbgc, a + a, b --, b, c + c, where a or b or c may be identical to the empty string. As shown above, none of these languages are contextfree. (1) Let a be identical to the left parenthesis, b be identical to the right parenthesis, and c = e. The instruction for g is then of the form g -+ (g)g. The language generated by this system is similar to that of recursive monopodial branching [cf. section 3(c)], and can be defined as follows: if S, = g and, for all n 2 0, S,,, = (SJS, = (S,)(S,- i). . . (S,)S,, then this language is the set (S&z 2 01. (2) Let a be the left parenthesis, b = e, c be the right parenthesis, and the instruction for g be g + (gg). Then the language generated is similar to that of recursive dichotomous branching [cf. section 3(c)], and is defined by the set {&In 2 O> if we take S, = g and, for all n 2 0. S,,, = (S,S,). (3) Another recursive dichotomous branching language is generated by the instruction g -+ (g)(g). Here we take the same substitutions for a and c as in the previous example, and take b to be identical with )( as a single
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
481
symbol. Then the language is the set (S&r 2 0} if S, = g and, for all n 2 0, S,+ 1 = tS,>tSJ. (4) The instruction g + gg gives rise to the language (g’“ln 2 01. Here it is the case that a = e and b = e and c = e. There are several other combinations in which a, b or c can be identical to the empty strings. Altogether by these combinations eight classes of noncontext-free languages can be generated. Another three classes of languages may be defined by taking g to be identical to the empty string, requiring that at least one of the symbols a, b or c be non-empty, and using recursive definitions similar to the ones given in the above examples. With proper substitution of symbols for a, b and c we can then generate languages in which the strings consist of balanced parentheses without any other symbols. These languages are also non-context-free, but they cannot be generated by OL-systems since their strings contain only terminal symbols. Theorem 2
Given a context-free grammar G = (N, T, P, S) there always exists an OL-system r = (G, g, S) such that the language of I? is a canonical extension of the language of G over its terminal alphabet T, or, in other words, L(G) = L(I) n T*. For definition of canonical extensions, see Minsky (1967, p. 236). Proof
Construct the OL-system I in such a way that its alphabet be G = N u T, its starting symbol be g = S, and its 6 function be the following: (i) for all a, if a E T then 6(a) = {a}, (ii) for all b, if b E N then 6(b) = (w[(b -+ w) E P} u (b). Let us designate by S(G) the set of all strings (terminal or non-terminal) produced by the grammar G. By definition, the language of G is the set S(G) n T*, in other words, S(G) is a canonical extension of L(G) over T. If we can prove that L(r) = S(G) then the theorem follows immediately. Consider first whether L(T) E S(G). If a string p can be generated by simultaneous use of the production rules of r, then p can also be generated by using the same production rules one at a step in the generating sequence of G. Thus, if p occurs in L(I), it also occurs in S(G). Next we ask whether S(G) c L(I). The derivation of each string by G can be copied by I? if we realize that for each symbol a of its alphabet I has a production rule (a + a). These identity rules of I can be employed for all symbols of a given string except for the one for which a substitution is made in the derivation by G.
482
A.
LINDENMAYER
A similar proof can be provided for this theorem by constructing another OL-system the language of which is also a canonical extension of the language of the grammar but where we do not require that for each symbol a in the alphabet an (a --t a) rule be added to the 6 function. Example Let G = (N, T, P, S) be the following context-free grammar: N = {S, A, B), T = {a, b}, P = ((S -+ AB), (A --+ aA), (A -+ e), (B + Bb), (B -+ e)). The language of G can be shown to be: L(G) = (ambnlm, n 2 01. Let us then construct an OL-system I = (G, g, S) such that G = N u T, g = S, and the 6 function to consist of the instructions: Pu It can be shown L(r) Therefore,
((14 + A), (B -+ B), (a -+ a), (b -+ b), (S --f s,,\. then that: = S(G) = {a”‘(,4 or e)(B or e)b”jm, n 2 0} u {S].
it is clearly the case that L(G) = L(I)
A T*.
Theorem 3 For any OL-system I = (G, g, S) such that for all a in G there is an instruction in S of the kind a -+ a, the language of I is context-free. Proof We show how to construct a grammar G = (N, T, P, S) which is contextfree and the language of which is identical with the language of I. We take that T = G. We construct N of new symbols a’ for all a in G, and assume that S = g’. The set of production rules P is constructed in the following way: for each (a + a) instruction in 6 we assume one of the form (a’ --f a) in P, and for every other instruction (a + w) in 6 we assume one of the form (a’ + MJ’) in P, where w’ is obtained from w by replacing each symbol in w by the corresponding symbol from N, or if w = e then IV’ = e. To show that L(I) c L(G) let us take a string p which has been derived in L(I). Whatever instructions of the type (a -+ w) have been used in the simultaneous fashion in this derivation, there are corresponding instructions of the type (a’ --f w’) in G which can be applied sequentially in the same order as the (a --+ w)-type instructions are applied in I. This derivation in G yields a string p’ from which it is easy to get to p by applying the (a’ -+ a)type instructions of G. Next, for showing that L(G) s L(I), we take a (terminal) string q in L(G), and take any step in its derivation in G from string II to string v. If in this
DEVELOPMENTAL
LANGUAGES
AND
GRAMMARS
step an instruction of the kind (a’ --f w’) is used then we imitate in I by using the (a + w) instruction together with the identity all other symbols in U. If an (a’ + a) instruction is used in the u then we imitate this in I by using the (a --) a) rule as well as all identity rules. Thus all steps from g’ to q in G can be imitated from g to q in I, and therefore q is in L(T).
483
this step rules for to 1)step, the other by steps
Example
Take the OL-system I = (G, g, S) such that G = (g, a, 6, c) and the (5function consists of the instructions (g -+ agbgc), (g -+ g), (a + a), (b + b), (C -+ c). This is the system defined in lemma 1 with the identity instruction (g + g) added. While the language of the original system was not contextfree, as proven in theorem 1, the language of this modified system is contextfree. The grammar which generates the same language, and which is contextfree, is the following one: G = (N, T. P, S) where T = G = (g, a, b, cJ, N = {g’, a’, b’, c’}, S = g’, and P = ((g’ + a’g’b’g’c’), (g’ --) g), (a’ -+ a), (b’ + b), (c’ -+ c)].
The simplest subcase of the OL-system introduced in lemma 1 is the one where a = e, b = e, and c = e, and the sole instruction is (g -+ gg). As we have pointed out among the examples to theorem 2, this system I7 generates the language L(T) = (g’“ln 2 0} which is clearly non-context-free. If we define another OL-system I’ by adding the instruction (g -+ g) to the previous one, then we find that its language L(T’) = {g) ‘. This language consists of all non-empty strings of any finite number of g’s and is not only context-free but also regular. The grammar which generates this language is
G = ({S), (g}, ((S --, W, (S --f gll3 S> where S = g’ as before. Theorem 4
Given any OL-system I = (G, g, S) such that all instructions in 6 are of the form (a + t) or (a + tb), where a and b are non-terminal symbols not necessarily distinct from each other and t is either a terminal symbol or the empty symbol, then the language of lY is regular. Proof
Let us designate the set of non-terminal symbols of I as N, and the set of terminal symbols of r as T (a terminal symbol x of an OL-system is defined by the condition that 6(x) = {x}). Thus G = N u T. We now construct a grammar G =
484
A.
LINDENMAYER
instructions of the form (a’ --f a) for all a’ in N’ and instructions of the form (a’ -+ t) or (a’ + tb’) for all corresponding instructions in I except for (a --f a) instructions. This grammar G satisfies the definition of a regular grammar, and we can show that L(G) = L(I). To prove that L(I) c L(G), we take a string w in L(I). Whatever (a --f p) instructions are used in the stepwise derivation of w in l? (only one nonidentity instruction can occur in any step), there are instructions (a’ -+ p’) in G which produce w’ from which w is obtained by an instruction of the form (a’ -+ a). A string w’ is obtained from string w by replacing every nonterminal symbol a in w by a’. Conversely, to prove that L(G) c L(I), we take a string v in L(G). We can simulate the derivation of I; in G by using the (a + p) instruction in I for every (a’ --f p’) used in G. Since there is only one non-terminal symbol in each string of I, all other instructions are identity instructions in the derivation in I. When an (a’ -+ a) instruction is used (in the last step) of the derivation of z’, the I’ derivation simply uses the (a -+ a) rule. Corollary
Given an OL-system as defined in theorem 4, the addition or omission of identity instructions of the type (a -+ a) to or from its 6 function does not change its language. This statement follows directly from the method of construction given for the regular grammar in the proof of theorem 4. The presence or absence of identity rules in the OL-system did not affect the structure of the grammar. Thus the same language is generated by OL-systems of this type with or without any one of the identity rules in their 6 functions. Example
Take OL-system I = (G, g, S) such that G = {a, g, (,)} where the symbol a and the left and right parentheses are terminal symbols, and the 6 function for the only non-terminal symbol g consists of the instructions k j (4d and k + a). Its language is: L(r) = {[(u)l”uln 2 O} u ([(u)3”gln 2 0:. This OL-system satisfies the conditions of theorem 4, thus its language is regular. This can be demonstrated by constructing a regular grammar G = (N, T, P, S) such that L(G) = L(I). We assume for G that N = (S},
T = G, P = ((S -+ (u)S),
(S + a), (S --, g)}.
Furthermore, it can be easily shown that the OL-system I’ which is obtained from I by adding the instruction (g --f g) is such that UT’) = L(T) = L(G).