• No results found

M-systems – A Conformal Approach to Plant Morphogenesis

N/A
N/A
Protected

Academic year: 2022

Share "M-systems – A Conformal Approach to Plant Morphogenesis"

Copied!
70
0
0

Loading.... (view fulltext now)

Full text

(1)

M-systems

A Conformal Approach to Plant Morphogenesis

Samuel Envall

U.U.D.M. Project Report 2007:13

Examensarbete i matematik, 20 poäng

Handledare: Torbjörn Lundh, Chalmers och Göteborgs universitet Examinator: Erik Palmgren

April 2007

Department of Mathematics

Uppsala University

(2)
(3)

M-systems

A Conformal Approach to Plant Morphogenesis

Samuel Envall

(4)

Abstract

This essay concerns two approaches to mathematical modelling of plant morphogenesis: the tra- ditionally successful L-systems, and the recent invention M-systems. In regard to the former, we present basic aspects of L-system theory and its application to plant morphogenesis, as well as the possibility of considering L-systems in the setting of formal language theory, to which they, perhaps surprisingly, are related. As for M-systems, we dwell on computer experiments designed to test their applicability, in addition to purely theoretical arguments bearing on the same matter.

We end with a series of proposals for extensions of the unadorned variety of M-systems which this essay mainly pertains to, as an indication of potential avenues for further investigations of M-systems.

(5)

Contents

1 Introduction 3

2 Introducing L-systems 6

2.1 D0L-systems . . . . 6

2.1.1 Example . . . . 6

2.1.2 Comments on Preceding Example . . . . 6

2.1.3 Notation and Terminology . . . . 7

2.1.4 Formal Treatment of D0L-systems . . . . 7

2.1.5 Growth Functions . . . . 8

2.2 L-systems in General . . . . 10

2.2.1 Structures . . . . 10

2.2.2 Overview of Applications . . . . 11

2.3 Turtle Interpretation . . . . 11

2.3.1 2D . . . . 11

2.3.2 Branching Structures . . . . 12

2.3.3 3D . . . . 13

3 Other Facilities in L-systems 15 3.1 Stochastics . . . . 15

3.2 Interactions . . . . 16

3.2.1 DIL Growth Functions . . . . 18

3.2.2 Biological Relevancy . . . . 19

3.2.3 A Complication . . . . 20

3.3 Parametric L-systems . . . . 20

3.3.1 Parametric L-systems and the Turtle Interpretation . . . . 22

3.4 Timed L-systems . . . . 22

3.4.1 Growth Functions . . . . 23

3.5 Concluding Notes . . . . 23

4 Language-theoretical Aspects of L-systems 25 4.1 Introduction . . . . 25

4.1.1 A Brief Introduction to the Chomsky Hierarchy . . . . 25

4.2 0L-systems . . . . 27

4.2.1 Example . . . . 27

4.2.2 Closure Properties . . . . 27

4.3 E0L-systems . . . . 28

4.4 Adult Languages . . . . 29

4.5 Interactions . . . . 29

4.5.1 “Pure” IL languages . . . . 29

4.5.2 Extension and Adult Languages . . . . 30

4.5.3 Closure Properties . . . . 31

(6)

5 Preliminary Material for M-systems 32

5.1 Some Elements of Hyperbolic Geometry . . . . 32

5.1.1 The Hyperbolic Metric . . . . 32

5.1.2 Isometries . . . . 32

5.1.3 An Explicit Formula for the Hyperbolic Metric . . . . 33

5.1.4 Geodesics . . . . 34

5.1.5 Topology . . . . 34

5.2 More on Aut(∆) . . . . 35

5.2.1 Matrix Groups and Aut(∆) . . . . 35

5.2.2 Classification of Maps . . . . 35

5.2.3 Invariant Curves . . . . 38

5.3 General M¨obius Maps . . . . 38

6 M-systems in General 41 6.1 Conformal Patterns in Nature . . . . 41

6.2 Some Notes on Plant Growth . . . . 42

6.3 M¨obius Maps and Isotropic Growth . . . . 42

6.4 The Main Idea of M-systems . . . . 43

7 Simple M-systems 44 7.1 Definition . . . . 44

7.1.1 Commuting Maps in Aut(∆) Have Coincident Fixed Points . . . . 44

7.2 Computer Experiments . . . . 45

7.2.1 Format of Input . . . . 45

7.2.2 Types of Images . . . . 47

7.3 Applicability to Plant Modelling . . . . 48

8 Extensions of Simple M-systems 53 9 Conclusions 56 A Computer Software 59 A.1 Programing Environment and Tools . . . . 59

A.1.1 General Remarks . . . . 59

A.1.2 GUIDE . . . . 60

A.2 Cornerstones . . . . 60

A.3 Graphical Front-end . . . . 62

A.3.1 mapmaker . . . . 62

A.3.2 ranger . . . . 62

A.4 Helper Utilities . . . . 62

A.4.1 Structured Data Storage . . . . 62

A.4.2 Remote Operation . . . . 63

(7)

Chapter 1

Introduction

In this essay we shall treat of two different sets of methods for mathematical modelling of plant morphogenesis. The word ‘morphogenesis’ refers to the origination of (in this context) biological forms. (Please note that the expression signifies development of the form of individual organisms, as opposed to evolutionary changes of form.)

One of the celebrated classics of mathematical study of morphogenesis, held to be of pioneering importance, at least in the Anglophone world, is D’Arcy Wentworth Thompson’s On Growth and Form [33] from 1917. Mathematical patterns in the living world, however, had been observed much earlier. Most notably, phyllotaxis, referring to the regular arrangement of leafs and other plant parts, has been an interest of students of nature for a long time. Thompson notes that Leonardo da Vinci has been identified as the first person from whom thoughts on the matter have been preserved, but speculates that “the old Greek and Egyptian geometers are not likely to have left unstudied or unobserved the spiral traces of the leaves upon a palm-stem or the spiral curves of the petals of a lotus or the florets in a sunflower”.

On Growth and Form is encompassing in scope and largely concentrated on bringing together multiple different ideas and approaches in regard to mathematical patterns in (living) nature, and on defending the overall point that mathematics is crucial for a proper understanding of biological forms. Later researchers have instead examined specific theories of morphogenesis. One of the most famous classics of mathematical biology is the reaction–diffusion hypothesis, developed by Alan Turing in the early 1950:s [34]. This model is primarily relevant to formation of coloured markings in patterned animals, and pictures patterns as resulting from concentrations of certain chemicals (‘morphogens’). The spread and interactions of the chemicals are in turn described by a system of differential equations.

Work in this area has continued after Turing; to name just one example, investigation of the implications of the theory for patterned tails has lead to an interesting result to the effect that an animal can have a spotted body and a striped tail, but the opposite situation is impossible. [22, p. 444]

One historically successful branch within the mathematical study of morphogenesis is the theory of L-systems, which is the subject for the first part of this essay. L-systems, more formally referred to as Lindenmayer systems, were introduced by the biologist Aristid Lindenmayer. His [19] from 1968 is commonly cited as the seminal work, though Lindenmayer had in fact made some of his ideas known even before. L-systems originated in a form somewhat dissimilar to the one in which they are ususally presented (and which is followed here). The changes concern both the applications and the abstract formulation of the theory. Study of the subject was first inspired by, and applied to, modelling of intercellular interactions. It was discovered only later that L-systems were very valuable tools in modelling of plant development, which eventually became the probably leading application. In the early days, L-systems were studied as systems of interconnected finite automata, which in the model corresponded to cells, and described interactions between them; it was therefore natural to view L-system theory as part of automata theory. As L-systems started to attract interest from specialists in discrete mathematics in the initial years of the 1970’s, it

(8)

was soon realized that another formulation of the theory, in the terms of formal language theory (a field of research which is closely related to automata theory, but has a rather different style and emphasis), was more convenient. This reformulation quickly became universally prevailing, (it is also followed in this essay), and the theoretical analysis of L-systems came to fall under the discipline of formal language theory1.

Resting on such foundations, the theory of L-systems itself and its underpinnings are almost completely products of the latter half of the twentieth century. On the other hand, the second main theme of the essay, M-systems, is based on the concept of M¨obius maps, which received research interest already in the nineteenth century; the maps themselves are named for the nineteenth- century mathematician and astronomer August Ferdinand M¨obius.

Whereas the building blocks of M-systems have a venerable history, the idea of M-systems is entirely new, having been invented recently by Torbj¨orn Lundh at Chalmers University in Gothenburg.

While M-systems are intended as an alternative to L-systems in plant modelling, the two are fairly different in character. In L-system modelling, the topology of plants lies at the centre, while exact geometrical information enters more as an additional feature. M-systems, in contrast, focus on the geometrical aspect. Specifically, growth is described by M¨obius maps in M-systems. As we shall see in Chapter 6, this sort of description may be motivated departing from quite simple assumptions.

At least for the time being, it may be profitable to regard M-systems as a fairly vague and general notion, rather than to reserve the term for a precise, technical meaning. Such a practice is observed with respect to the term ‘L-system’; it is also somewhat akin to how terms like ‘fractal’

are used by some mathematicians. Several more specific formalised concepts of M-system are conceivable as instantiations of the broader notion. We treat of one such formalisation in this essay: we call the M-systems in question simple M-systems. These actually determine a specific topology, but nevertheless, this is a secondary quality; the core idea of M-systems is about growth being described by M¨obius maps in a certain manner, not any particular topology.

Now that the strange abbreviations ‘L-system’ and ‘M-system’ have been at least partially demystified, let us proceed to a broad outline of the contents of this essay. The latter splits naturally into two major parts, the first one being about L-systems, and the subsequent one about M-systems. The following is a more detailed overview of the chapters.

Chapter 2 gives an introduction to L-systems, with a perspective towards application to plant modelling. Chapter 2 contains the most basic kinds of L-systems, some basic terminology and discussion of how L-systems are used to build plant models in practice.

Chapter 3 adds more components which may make L-system models more realistic. The mechanisms covered there may be regarded as mutually independent additions to the “bare”

version of L-systems presented in Chapter 2.

These two chapters outlined L-systems from a point of view connected to biological applica- tions, especially in botany. However, L-systems may also be studied from the viewpoint of formal language theory, and this is the subject of Chapter 4. Given space considerations, it is only pos- sible to scratch the surface of this field, but hopefully, the exposition will at least give an idea about what kind of properties can be explored, some of the differences between the various types of L-systems, and their connections to classical entities in formal language theory.

In Chapter 5, our attention shifts to the second of the two principal subjects of this text:

M-systems. Chapter 5 reviews preliminary material relating to M¨obius maps and hyperbolic geometry, which will be necessary for formulating and examining the concept of M-system.

In Chapter 6, we turn to the matter of M-systems proper. After setting out general motivations

1To include all of L-system theory within formal language theory is to a minor extent unfortunate, though. It is reasonable because formal language theory deals with strings, and L-systems also usually do. Notwithstanding, it is not necessary for L-systems to operate on strings, and although string L-systems have dominated the field from the outset, already in [19] is it made clear that string L-systems are but the simplest case among a set of typically more complicated structural arrangements. L-systems operating on more general graphs have indeed been devised, and have also been put to successful use for building models of biological structures which do not fit well into a string representation.

(9)

for why M¨obius maps may be useful as a tool for accurately capturing organic growth, an account of the fundamental idea of M-systems is provided, leaving the details open.

The next chapter, number 7, concerns a particular variety of M-systems: it is what we term simple M-systems, presumedly the most direct transformation to a precise construct of the more indeterminate idea presented in the preceding chapter. The computer experiments and their results are expounded, followed by a more theoretical section devoted to arguments about the realism of plant modelling founded on M-systems, based on certain technical properties.

Other variants of M-systems are imaginable, incorporating more machinery than simple M- systems, and Chapter 8 offers a range of proposals for such extensions. Some of these have undergone limited testing on the computer, while some are untried.

Finally, an appendix gives more information about the particularities of the computer tests, including both discussion of broad issues in the programming and source code excerpts.

To conclude this introduction, the author wishes to express his sincere gratitude to Vincent Moulton and Torbj¨orn Lundh, the inventor of M-systems, for assistance and support; and further- more, to Christer Modin for reading and commenting encouragingly on the essay.

(10)

Chapter 2

Introducing L-systems

2.1 D0L-systems

2.1.1 Example

Let s0 be the string aab, a string consisting of the letters a and b. From s0, we construct the string s1= bbab by simultaneously replacing a by b, and b by ab. The word ‘simultaneously’ is of extreme importance here. All occurrences of both a and b must be replaced, and the replacements must not affect the newly inserted letters. Thus it is not allowed e. g. to first replace the initial a by b and get bab, then replace the b:s and get abaab. The replacements must be applied to all occurrences of all letters, in parallel.

The next step is to do the same thing we just did to s0 to s1: simultaneously replace all occurrences of a by b etc. This produces s2, which undergoes the same procedure to give s3. And so the process continues.

To make it completely clear what is meant by ‘simultaneously’ in this context, set P (a) = b and P (b) = ab. We then go from s0= aab to s1= bbab by applying P to each letter in parallel:

s1= P (a)P (a)P (b) = bbab.

Generally, we get sk+1 from sk in the same manner. If sk = ω1...ωn (where each ωi is one of a and b, of course), then

sk+1= P (ω1)...P (ωn).

The outcome is an infinite sequence of strings, beginning like this:

s0= aab s1= bbab s2= ababbab ...

2.1.2 Comments on Preceding Example

The example above is an example of a D0L-system, a notion soon to be formally introduced. Until then, we now study the example in a more intuitive way.

A sequence of strings is constructed utilizing two data: the starting string s0= aab, which in these circumstances is called the axiom, and a set of rules for replacing letters by strings. These rules are referred to as rewrite rules or productions. In the usual notation, the productions of the example are written like this:

a → b b → ab.

(11)

For each letter, there is exactly one rewrite rule having that letter on the left side. This is not an accident of the example, but a defining characteristic of D0L-systems. The ’D’ in ’D0L-systems’

is for deterministic, indicating that there is exactly one valid replacement for each letter1. Readers acquainted with formal language theory may recognize this as the productions of that discipline2. Such readers may want to peek forward to section 2.2 on page 10 to find out about how L-systems are related to other rewrite rule-based concepts in formal language theory.

2.1.3 Notation and Terminology

To be able to talk about strings in a more precise and convenient fashion, let us establish some terms and notations. They are standard in formal language theory, and a reader familiar with that area may elect to skip forward to more rewarding reading.

We define an alphabet to be a finite set of symbols. Given an alphabet Σ, we define Σn to mean the set of strings of length n, made up of elements of Σ. Moreover, Σ+ denotes the union of all the Σn for n ≥ 1, i. e. Σ+=S

n≥1Σn. Extending this definition to include the case n = 0, we get Σ, which is equal to Σ+∪ {²}, where ² is the empty string, the unique string of length 0. (We also set Σ0= {²}.)

The general element of Σn will be written α1α2...αn, without parentheses and commas.

Given a string s ∈ Σ, we let |s| mean the length of s, which may be defined by the stipulation that |s| = n if and only if s ∈ Σn.

For a symbol α ∈ Σ, we define αn to be the repetition of α n times (i. e. α1 = α, and αn= αn−1α for n > 1).

2.1.4 Formal Treatment of D0L-systems

Armed with the terms and notations from the previous section, we can now formalize D0L-systems simply and efficiently. The following definition resembles that of [25, p. 4].

Definition 1. Let Σ be an alphabet, let ω ∈ Σ+, and let P be a subset of Σ × Σ such that for each α ∈ Σ, there exists exactly one (α, η) ∈ P . The triple hΣ, ω, P i is called a D0L-system. Its axiom is ω. P is a set of productions, and its elements (α, η) are written α → η.

For a symbol α, a production α → η with α as its left-hand side is referred to as a production for α. When specifying an L-system, we will not always write out all productions. It will be implicitly assumed that if there is no mention of a production with a symbol α as it left-hand side, the sole production for it is α → α. This convention also applies to other types of L-systems than D0L-systems, with appropriate modifications, which should never cause any ambiguity.

The ‘function’ or ‘operation’ of a D0L-system is, as we have seen, to generate a sequence of strings. We now present a notation for the generated strings, which is more efficient and generalizeable than referring to the sequence directly, with the associated fiddling with indices etc.

Definition 2. If φ = α1...αm and ψ = η1...ηm, and there exist productions αk → ηk for k = 1, ..., m, we say that φ directly derives ψ, and write φ ⇒ ψ. If either φ = ψ or there exist strings χ1, ..., χp such that χ1⇒ ... ⇒ χp and χ1= φ and χp= ψ, we say that φ derives ψ, and write φ⇒ ψ. If φ derives ψ and φ 6= ψ, then φ ⇒ ψ.+

These definitions extend to other types of L-systems with only slight modification.

1The reader probably wonders what the ‘0’ stands for. Time is not yet ripe to answer that question, but bear with us, it will all become clear when we deal with L-systems with interactions. For the impatient: the ‘0’

indicates the absence of interactions. For the formal-language-theory-informed: this means that the productions are context-free.

2The study of L-systems is part of formal language theory, but one which is less commonly encountered in introductory courses. The student is presumably more likely to meet with L-systems in a course on fractal geometry or biomathematics.

(12)

In some expositions, the notion of derivation is surrounded by much pomp and circumstance, being a complicated construct which contains complete information about how a string is generated by an L-system. In this essay, we will not need such detailed information, and will thus use the term more freely. In this looser sense, derivation means the process of generating a certain string.We will also employ the expression derivation step in the situation where φ ⇒ η.

As an example, consider the D0L-system h{a, b}, a, {a → b, b → a}i. It generates the sequence a, b, a, b, a, b, ..., so there are infinitely many derivations of each generated string. For instance, b can be derived as a ⇒ b or a ⇒ b ⇒ a ⇒ b. This is in contrast to our first example, where there is only one derivation for each generated string. The notion of derivation becomes fairly artificial in the deterministic case, but we nonetheless choose to mention it here, since it facilitates the following discussion somewhat.

2.1.5 Growth Functions

Let G be a D0L-system, and let (sk)k=0 be the sequence of strings it generates. The function fG, defined by fG(n) = |sn|, is called the growth function of G.

The concept of growth function soon leads to several interesting problems, one of which is the analysis problem, which is, given a D0L-system, to determine its growth function. Thus stated, the formulation of the problem is incomplete. Exactly what does it mean to determine the growth function? After all, it is trivial to see that the growth function is readily computable from the information specified in the D0L-system.

The problem can, not unexpectedly, be approached from several directions. For example, one possibility is to study the the formal power series F (x) = P

n=0fG(n)xn which is called the generating function of fG; interesting information can be harvested from this construct, but we will abstain from doing so here, since it would be more appropriate in a full-length monograph on L-systems.

Another alternative will be outlined in the following. Let G = hΣ, ω, P i be a D0L-system. We number the symbols of the alphabet Σ in some way, so that Σ = {α1, ..., αm}. Before we continue, we lay down a piece of notation which will soon be useful. Given a string s, we let #k(s) be the number of occurrences of αk in s. We let the numbering of the elements of Σ give rise to a numbering of the right-hand sides of the productions of G in the natural manner, that is to say, we let ηk be the string defined by the requirement that the production

αk → ηk

be in P .

We now consider the m2numbers #ji). Arranging these in a matrix M , with i as row index and j as column index, results in the growth matrix of G. It describes how the quantities of the symbols of the alphabet change in one derivation step. More precisely, the growth matrix has the property that if φ ⇒ ψ, then

(#1(φ) ... #m(φ))M = (#1(ψ) ... #m(ψ)),

which means that finding the number of occurrences of symbols in the next string generated can be done by matrix multiplication.

This points to a way of expressing the growth function. Let π = (#1(ω) ... #m(ω)), and let η be the column vector (1 ... 1)T. Then

fG(n) = πMnη.

This version of η could easily be replaced by some other column vector, to get a growth function where the different symbols are unequally weighted.

This expression is rather expected, but the growth matrix in fact leads to another, more surprising way to write fG(n), which is valid for values of n at least equal to the size of the alphabet.

(13)

Theorem 1. The growth function fG of a D0L-system G is of the form fG(n) =

Xs i=1

pi(n)ρni for n ≥ m, (2.1)

where m is the cardinality of the alphabet of G, the ρi are eigenvalues of the growth matrix of G and the pi are polynomials, the coefficients of which are determined from the initial values of fG. Proof. Let M be the growth matrix of G, and let

χM(x) = det(M − xE) = amxm+ ... + a1x + a0= 0

be the characteristic equation of M (naturally, E denotes the m × m identity matrix). By the Hamilton–Cayley theorem, M satisfies its characteristic equation:

amMm+ ... + a1M + a0E = 0. (2.2)

Let π and η be as in the text above. Multiplying (2.2) by Mn, and then multiplying the result from the left by π and from the right by η, yields

amf (n + m) + ... + a1f (n + 1) + a0f (n) = 0. (2.3) This is a linear recursion equation or linear homogeneous difference equation with constant coef- ficients. The solution of such an equation is of the form (2.1), according to e. g. [17].

For finding an expression of the form (2.1) for a D0L-system growth function, specifying the growth matrix and computing its characteristic polynomial may be unnecessarily laborious; it may be possible to establish an equation like (2.3) by simpler means, and continue from there.

As concerns biological relevance, the growth functions of D0L-systems are problematic. An often recurring pattern in plants and organisms in general is sigmoidal growth, which derives its name from that the graph of the size of the organism plotted against time is vaguely s-like.

Young plants grow quickly, often roughly exponentially, but as the plant ages, growth slackens, and eventually a phase of asymptotic growth enters.

The discrete nature of D0L-systems becomes somewhat inconvenient in relation to sigmoidal curves. Since fG(n) is always an integer, its only possibility to grow asymptotically toward an upper bound is to be eventually constant. Thus the growth seen in actual organisms, growth which perpetually decreases but never ends, is beyond the modelling capabilities of D0L-systems.

The problem goes deeper than that, though. Sigmoidal curves cannot be expressed by functions of the formP

pi(x)ρxi. This is not a problem in the sense that for obtaining a sigmoidal growth function, we only need an expression which behaves correctly in integral points. This position is in the vein of the biological study of growth curves, where no particular significance is assigned to the growth functions, what matters is that they match the data reasonably well and are reasonably easy to work with. However, this view violates the idea of L-systems, which are not simply devices for generating certain growth functions, but are also models with internal structure, which ought to have some counterpart in nature. If all we want is a growth function, a formula for it is sufficient, and in fact preferable to an L-system, since the former is simpler and more easily understood.

The fact that formula 2.1 only applies when n is at least equal to the size of the alphabet points to a way out. One could let the simulated organism grow exponentially at first, then let the pace of growth start to decay well before m. For this strategy to be meaningful, the alphabet has to be rather large. That in turn entails that the D0L-system is not very simple and comprehensible any longer. It would seem that the conceptual simplicity of D0L-systems is thus defeated, and that a more complicated framework might very well make the model less complex as a whole.

Another more fundamental objection is brought forth in [36]3. The introduction of large alpha- bets appears to have weak foundation in observations. “This seems not to be based on experimental

3The remedy proposed in [36] is essentially to do away with the presumption that rewriting takes place at regular intervals. More specifically, two different time scales are postulated, one physiological time which is innate to the organism, and one physical time, which is the usual time. Rewrite steps are taken to occur at equal intervals in physiological time. On the basis of certain assumptions, a relationship betwixt the two times can be derived, such that relative to physical time, growth will be sigmoidal. This method seems to have had little influence on work in L-systems, but the idea of the two time scales seemingly has some biological justification.

(14)

evidence. The biologist observes very little real differences in cell types/states (e. g., cells with distinct stereotype behavior).” (The numbers of different states/symbols in the examples reported in [36] are two and four; the latter being chosen not on grounds of “observed characteristics but according to ancestry and position only”. ) The discussion in [36] is confined to filamentous organisms, but the notion that models of development should reflect physiological reality, not only produce an acceptable growth function, would seem have some bearing on tree modelling as well. If we introduce extra, biologically unwarranted, states for the sake of tuning numerical behaviour in some sense, we should be ready to investigate the possibility that our modelling framework needs revision. No model can capture all the complexity of a natural organism, and so a reasonable level of detail and correspondence with nature must be chosen. Depending on ends and circumstances, a relatively simple model which provides a satisfactory growth function but does not faithfully represent the inner workings of the organism may be desirable, but such a model should then not contain extraneous complications.

Briefly put: complexity in a model should correspond to the object of which the model is a model. Unnecessary complexity should be wrung out, and a model which does not capture significant complexity of the object should make it up by being simpler to a comparable degree.

The inability to capture sigmoidal growth make D0L-systems unattractive for modelling of many growth processes. This does not mean that D0L-systems are totally useless in plant mod- elling. They may still be of value for producing models of trees frozen at an instant in their development. For just making still images, what matters is only that the model of a tree at a particular point in time is reasonable, not whether the process leading up to that point was.

2.2 L-systems in General

Before now, our treatment of L-systems has been limited to the pedagogically grateful special case of D0L-systems. The time has now come to discuss the matter of L-systems in the main, and to give some inkling of its relations to other parts of mathematics.

The basic idea which underlies L-systems is that of rewriting, which has been demonstrated by example: for D0L-systems we have seen how letters are rewritten as strings. The notion of rewriting is much more general than has been indicated so far. The core theme of putting in new parts in lieu of old ones is invariant, but the specifics of the rules for doing that differ. We shall see some variations further on, when we widen our lookout on L-systems from the realm of D0L-systems. To give a preliminary impression of what could be different, we point out that in D0L-systems, the rewriting of a letter is not affected by who its neighbours are, which is possible in other instances.

The property which sets L-systems apart from other versions of rewriting is the parallelism.

The meaning of this word has been carefully explained already, so we shall not spend more ink on it here. In other systems founded on rewriting which are commonly considered in formal language theory, productions, by the first sentence of this paragraph, are not applied in parallel.

For example, the productions of context-free grammars are the same as the productions of D0L- systems, but in a derivation in a context-free grammar, rewriting proceeds sequentially: in each step in the derivation, only one letter is rewritten.

Another property of D0L-systems is contingent but symptomatic: that the rewriting acts on strings. This is not essential to L-systems, but very common in practice. This topic we turn to next.

2.2.1 Structures

It is most common for L-systems to operate on strings, but not at all necessary. L-systems are often used to describe geometrical configurations, hence if string-based L-systems are used, there must be some way to relate strings to the intended geometrical states of affairs. This suggests the idea of letting rewriting act on (some descriptions of) geometrical objects directly instead. That is certainly a possibility, but a less commonly utilized one.

(15)

L-systems operating on graphs are another important case. The string-based approach works well for modelling essentially one-dimensional objects, like filamentous organisms, or such which are one-dimensional-with-branchings, like trees. Modelling of truly two- or three-dimensional entities calls for other structures, however. It is for such applications, e. g. modelling of cell layers, that graph L-systems have been developed.

2.2.2 Overview of Applications

The L-systems formalism has found applications in multiple areas. The most prominent are within biology, its discipline of origin. Most famous of all is the use of L-systems for modelling of higher plants. Apart from that, they have been utilized to describe filamentous microorganisms, cell lay- ers, and other biological phenomena. L-systems are also used in connections with art, for example the Kolam patterns of traditional south Indian art, and even music! In pure mathematics, we find that L-systems are popular as a tool in fractal geometry, for drawing fractal curves and plane filling curves. Further, L-systems have been found useful by researchers studying the travelling salesman problem4. In view of the generality and simplicity of L-systems, the list above is almost certainly not exhaustive, but it should give some idea about the most well-known applications (and a few less known ones).

2.3 Turtle Interpretation

We have mentioned that the foremost application of L-systems today is the modelling of plants, including graphical rendering of plants with varying degree of realism. We have also noted that string L-systems are by far the most common, and they are the only ones we consider in this essay.

What is not obvious is how the strings relate to pictures. It is to that question we now turn.

Multiple schemes for interpreting strings generated by L-systems geometrically have been pro- posed in the past. The most influential one is the turtle interpretation, which is the only one we concern ourselves with in this essay.

2.3.1 2D

The turtle interpretation is based on an imaginary turtle which lives on the computer screen (or some other plane surface on which we are drawing, such as a paper). The turtle has a position and a heading. It is invisible, but may manifest its existence by drawing lines in its path as it moves over the screen. A string generated by an L-system functions as a sequence of commands to the turtle. The turtle obeys the following commands:

Symbol Meaning

F Move forward, leaving trace

f Move forward without leaving a trace

+ Turn left

Turn right

The F command could be explained thus: move forward, and draw a line segment from the old position to the new one.

The table says nothing about telling the turtle how far forward it should go, or by what angle it should turn. These are hidden parameters: it is assumed that a certain distance be supplied, which is used every time an F or f is encountered in the string, and similarly an angle to use for + and −.

As a quick illustration of what has been said, assume that the turtle starts at (0,0), headed toward (1,0), and assume that the distance is set to 1 and the turning angle is set to π2. Then the

4Or so I gather. The only reference I have, except some broken links from the web, refers to a Brazilian publication, in Portuguese (which I do not master).

(16)

string F+F+F+F will make the turtle draw the square with corners at (0,0), (1,0), (1,1), (0,1), in that order. The turtle will end in (0,0), headed towards (0,-1).

Let us now consider an example of an L-system which generates strings meant for turtle interpretation. The images created will be successively closer approximations of Koch’s curve.

The alphabet will be {F,+,−}, where we have left out f since it won’t be used. The L-system has the following production:

F → F + F − −F + F.

The axiom is F−−F−−F and the angle is π3. Figure 2.1 demonstrates the appearance of the first few resulting pictures. (Note that the distance by which the turtle moves in reaction to an F is constant, so the size of the images will be steadily increasing. In some implementations, this phenomenon is countered by continually shrinking the distance, so that the size of all the images will be roughly the same. This has been done in figure 2.1.)

Figure 2.1: Finite polygons approximating Koch’s curve.

2.3.2 Branching Structures

Strings are inherently linear objects. For specifying branching structures, there is however a special notation which is often used in L-systems: bracketed strings. This technique is independent of the turtle interpretation, but it makes sense to introduce the former in the context of the latter, since the brackets have a special meaning in the turtle interpretation.

The idea of bracketed strings is simple enough. Branching structures are specified by enclosing secondary branches in square brackets (‘[’ and ‘]’). Please refer to figure 2.2 while reading the following example. The significance of the string ab[aba]cb[ab[b]c]a is that to a ‘main axis’ or

‘top-level filament’ σ0= abcba, two branches are connected. One is aba, which is connected to the first b of σ0, the other is σ2= abc, which is connected to the second b of σ0. In its turn, σ2has a branch on it, consisting of a lone b.

b

b c a

a a

c a b

b b a

Figure 2.2: Sample branching structure.

In terms of the turtle interpretation, the brackets function as follows. When a ‘[’ is encountered in the command string, the position and heading of the turtle are saved on a stack5. When a ‘]’

is confronted, the location and direction are restored from the stack, returning the turtle to a previously recorded state.

5A stack is a kind of list, which derives its name from its similarity to a stack of objects piled up on each other:

at any time, only the topmost object is accessible. Stacks are useful in processing recursive structures.

(17)

As an example, consider the D0L-system where the alphabet is {F, +, −, [, ]}, the axiom is F , and the only non-trivial production is

F → F [+F ]F [−F ]F F.

The first strings generated are (the right-alignment of some lines means continuation of previous line):

F

F [+F ]F [−F ]F F

F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]

F [+F ]F [−F ]F F F [+F ]F [−F ]F F F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ]F [−F ]F

F F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F [+F [+F ]F [

− F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F F [+F ]F [−F ]F F ]F [+F ]F [

− F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F F [+F ]F [−F ]F F F [+F ]F [−F ]F F [+F [+F ]F [−F ]F F ]F [+F ]F [−F ]F F [−F [+F ]F [−F ]F F ]F [+F ] F [−F ]F F F [+F ]F [−F ]F F

The turtle interpretation, with angle π3, gives the pictures in figure 2.3, where we have again adjusted the size of the pictures to make them fit on the paper. The growth is clearly exponential, the number of symbols increasing by about a factor 6 each step, so we would soon have trouble finding room for the strings as well.

Figure 2.3: Some vaguely tree-like pictures generated by means of an L-system and the turtle interpretation of strings.

2.3.3 3D

The two-dimensional turtle interpretation can be extended to the three-dimensional case. The heading, which can be perceived either as an angle or a non-zero vector, is then replaced by a triple of pairwise orthogonal vectors of length 1. The whole arrangement resembles a Frenet frame. The + and − commands correspond to rotations around one of the vectors, as do the new commands introduced in the three-dimensional turtle interpretation. (This may be compared to

(18)

the two-dimensional case, where + and − stand for rotations about a vector orthogonal to the screen.)

The vectors of the frame are denoted ~H, ~L, and ~U , respectively. The letters indicate the words heading (forward direction), left, and up. The triple ( ~H, ~L, ~U ) is taken to have the same orientation as the standard basis, i. e. ~H × ~L = ~U .

The vector which the commands + and − rotate about, as mentioned above, is ~U . In a sense, the extension from two to three dimensions consists of adding rotations around ~H and ~L as well;

and the ~H-~L plane corresponds to the plane of the two-dimensional case.

There is a set of commands for the three-dimensional turtle interpretation akin to that pre- sented for the two-dimensional one, but we have little reason to report it here, being concerned only with the principle; the interested reader is referred to [25, pp. 18f].

(19)

Chapter 3

Other Facilities in L-systems

3.1 Stochastics

Our definition of D0L-system includes the requirement that there be only one production for each symbol. It is natural to generalize the notion by removing that restriction. The result is the class of 0L-systems, in which a given string in general can derive many different strings in one step1. It is not immediately clear how an L-system with multiple productions for one symbol should function. The correct interpretation is as follows. Distinct occurrences of the same symbol should be rewritten independently, i. e. two occurrences of a symbol could be rewritten differently, even if they are in the same string2.

The extension from D0L to 0L may be a natural one, but it is problematic for plant modelling.

The problem is that there is too much arbitrariness. In a D0L-system, our freedom of choice is limited to choosing the n:th string from a sequence. The strings generated by a 0L-system however, are usually not organized in a sequence in a natural way. Contrarily, for each string s, there are typically more than one string t such that s ⇒ t. Thus a tree structure suggests itself.

But such a structure is large and unwieldy. For practical purposes, it is necessary to impose new restrictions. The road taken in stochastic L-systems is to provide a framework for a random choice by assigning probabilities to the productions. The introduction of stochastics is thus the provision of systematic means for picking out one derivation from a perhaps vast space of possible derivations.

The naturalness of the construct is demonstrated by the fact that it has been proposed in- dependently by several persons. The exact details of how randomness is introduced differ. The definition below resembles that of [7], and all the more [41].

Definition 3 (Stochastic 0L-system). Let Σ be an alphabet, and let P ⊂ Σ × Σ be such that for each α ∈ Σ, there exists at least one hα, ηi in P . Let p : P −→ (0, 1] be such that for each

α ∈ Σ, X

π∈P π=hα,ηi

p(π) = 1,

in other words, the probabilities of all productions for a given symbol should sum to one. The quadruple hΣ, P, ω, pi is called a stochastic 0L-system.

1The reader is warned to take the remarks suggesting a chronological order in the elaboration and modification of the various kinds of L-systems too literally. As is so often the case in mathematics, the pedagogically sound order for presenting the concepts differs considerably from the historical development.

2The other option, i. e. allowing more than one production per symbol and dictating that all occurrences of a given symbol in a given string must be rewritten according to the same rewrite rule, may be realized in a DT0L- system (‘DT’ is for deterministic table). This latter notion is actually more general. A set of productions which contains exactly one production for each symbol of the alphabet is in these circumstances called a deterministic table; a DT0L-system can have more than one of these (a D0L-system is equivalent to a DT0L-system with only one table). A derivation step in a table L-system consists of two steps, (i) choosing a table and (ii) rewriting according to it. It is rather easy to see that this concept includes the case we mentioned.

(20)

The elements of P are called productions, and an element π = hα, ηi ∈ P is written αp(π)→ η.

The string ω is called the axiom.

We again emphasise that the occurrences of a symbol in a string are rewritten independently.

In the stochastic setting, it is reasonable to espouse the view that this rewriting independence also entails stochastic independence, more precisely that if φ = α1...αn and there exist productions πk = hαk, ηki for k = 1, ..., n, then the probability for φ being rewritten according to these productions is equal to the productQn

k=1p(πk) of the probabilities of the productions.

(Of course, there may be other ways to rewrite φ as ψ = η1...ηn, so the probability of φ ⇒ ψ is not necessarily equal toQ

p(πk). The correct probability is instead obtained by summing the probabilities for the different possible ways to directly derive ψ from φ. As an example, assume a stochastic 0L-system has the productions a0.4→ a, a0.6→ aa, b0.25→ b, and b0.75→ ab. Then aab can be directly derived from ab in two ways: either using the first production for a and the second for b, or the other way around. The probability for the first possibility is 0.4·0.75 = 0.30, the probability of the second is 0.6 · 0.25 = 0.15. The total probability for ab ⇒ aab then is 0.30 + 0.15 = 0.45.)

The primary difference between the definitions of [7] and [41] is that in the case of the former, randomness affects not only the productions, but also the axiom; instead of a fixed axiom, an array of axioms, together with a probability distribution, is postulated. It is easy to see that the two approaches are equivalent in the sense that a stochastic 0L-system according to the first definition can be transformed to one of the second sort. If the axioms are ω1, ..., ωm with the probabilities p1, ..., pm, we introduce a new symbol σ not in Σ, and let the new axiom be σ. The only productions for σ are σ→ ωpk kfor k = 1, ..., m. The result is a stochastic 0L-system conforming to our definition, for which all strings generated by the original L-system are generated by the new one, with the same probability. In the new one, the derivations are one step longer, and the extra string σ is always generated.

From the perspective of realistic plant modelling, stochastic L-systems are also natural. The shapes generated by a D0L-system are all identical in the n:th step (assuming that the geometric interpretation of the underlying strings is also deterministic), but in reality, we cannot expect that any two plants of the same species will be equal, not even if they are of the same clone, for the development of a plant is influenced by a great many random events.

From the artistic point of view, the determinism of D0L-systems is equally unhelpful. In cre- ating natural scenes, the presence of exactly similar plants make for an eerily artificial impression.

Stochastic L-systems resolve these issues well. For an example, see figure 3.1. It is taken from [25], which requests us to “[n]ote that these structures look like different specimens of the same (albeit fictitious) species”. The axiom of the L-system is F , and the productions are

F 0.33→ F [+F ]F [−F ]F F 0.33→ F [+F ]F F 0.34→ F [−F ]F.

3.2 Interactions

That part of the audience which has experience with formal language theory will have noted the similarity between context-free grammars and D0L-systems, and may also have foreseen that they would encounter an L-systems counterpart of context-sensitive grammars. Such a forecast would indeed have been correct.

L-systems with interactions are L-systems in which the application of a rewrite rule to an occurrence of a symbol may be governed by a which the neighbours of the symbol are.

In our original example, we studied a D0L-system with the axiom aab and the productions a → b

b → ab.

(21)

Figure 3.1: Images generated by a stochastic L-system.

Let us modify the example by requiring that an a should be rewritten as ba if it has an a to its left, and as b otherwise. (‘Otherwise’ here refers both to the case where the letter to the left is a b and that where the a in question is the leftmost letter in the string.)

Let us see how the axiom is rewritten. The first a should be rewritten as b, since there is nothing to the left of it. The second a however, has an a to its left, and is therefore rewritten ba.

Finally, the b in the axiom is rewritten as ab. The resulting string is bbaab. This string contains the sequence aa, so also in the next derivation step, both the alternative productions for a will be used.

What we have just seen is an example of an L-system with interactions. Such L-systems are characterized by the property that different occurrences of the same symbol may be rewrit- ten differently depending on which its neighbours are. In language common in other parts of formal language theory, the productions are context-sensitive. Alongside with ‘L-system with interactions’, the expression ‘context-sensitive L-system’ is also used.

We also note that the L-system above is deterministic: for each string s there is only one t such that s ⇒ t. This is an accident, or rather a pedagogical feature, of the example. A deterministic L- system was chosen to avoid polluting the example with a multitude of cases and thereby obscuring the core idea with oodles of irrelevant information. Determinism and interactions are actually completely autonomous concepts.

In the example, the rewriting of a symbol depends (at most) only on the symbol immediately to its left. This is expressed symbolically by stating that the L-system in question is a (1,0)L-system.

More generally, an (m, n)L-system is an L-system where the productions may depend on at most m symbols to the left (the left context) and n symbols to the right (the right context). It is clear that (0,0)L-systems are the 0L-systems we already know and love. (1,0)L-systems and (0,1)L-

(22)

systems are together called ‘1L-systems’, while ‘2L-systems’ is another name for (1,1)L-systems.

All the (m, n)L-systems are collectively referred to as IL-systems.

The new rules for rewriting a in the example may be written like this:

a < a → ba

a → b. (3.1)

The first rule states that an a with an a to its left side should be rewritten as ba. The second rule does not mention any context at all. As the reader surely observes, a production where no context is specified functions as a default case which is used when none of the more specific productions apply.

In the example rewrite rule below, both the left and right contexts are of length two.

ab < c > de → f.

Here, the left context is ab, and the right context is de. The meaning of the production may be phrased as: when a c has ab to its left and de to its right, it may be rewritten as f . As we have already seen, either the left or the right context may be missing from this general pattern.

We have chosen to adopt the notation of [25]. It deviates from the usual one in the literature, but has the double virtues of making the examples more succinct and easy to read, and being more similar to notation common in other branches of formal language theory, thus more readable to those who are accustomed to the latter.

Some indication of the alternative notation should probably be provided. It requires produc- tions to be written in the following form:

(α, φ, β) → ψ,

where α and β denote the left and right context, respectively. In (m, 0)L-systems and (0, n)L- systems, it is allowed to write productions in the forms

(α, φ) → ψ (φ, β) → ψ

respectively, which causes no ambiguity. The aforementioned default case principle is not hon- oured. Instead, in an (m, n)L-system a production with a left context of length less than m may match only at the beginning of a string. The preceding statement concerns left context, but it, as well as all of the next paragraph, extend to the right context in the obvious way.

One very common variation is to require the left contexts of all productions to be of the same length and use a special symbol as an explicit end marker. If the end marker is $, the string s is considered as the string $ms$n for purposes of context-sensitive rewriting, and productions which match only at the beginning of a string will have a left context beginning with a sequence of $’s.

3.2.1 DIL Growth Functions

To a DIL-system, a growth function may be associated the same way as in the D0L case. The DIL growth functions are, however, appreciably more complicated. The growth matrix representation obviously hinges on the absence of interactions. Much more general growth functions are known for DIL-systems than D0L-systems, e. g. growth functions of type xr, where r is rational. Growth functions of D0L-systems are either exponential (i. e. there exists constants c and d such that fG(n) ≥ cdn) or polynomially bounded (i. e. there exists a polynomial p such that fG(n) ≤ p(n));

this is not true for DIL growth functions, which may lie in between these classes.

While we cannot give a general characterisation similar to that for D0L growth functions, certain outer demarcations are easily obtained. Firstly, a DIL growth function fG cannot grow faster than exponentially, stated otherwise,

fG(n) ≤ cdn

References

Related documents

Consumers tend to share their negative experiences with a company directly with the company instead of sharing it publicly, which does not affect the perception of the brand

Ett annat intressant perspektivskifte sker i den löpande texten, också från Septimus och Rezia till Peter, och inträffar i samma avsnitt som togs upp i samband med stegring

When Stora Enso analyzed the success factors and what makes employees &#34;long-term healthy&#34; - in contrast to long-term sick - they found that it was all about having a

Detta medför inte enbart att hon har ett förhållande till elever och personal utan även att hon under sin praktik också fick uppleva hur stor inverkan idrott (i detta fall

In our research at Astra, we are going to try to understand how people apprehend their situation in the process oriented organization, and how they can/should use IS/IT to support

Taking basis in the fact that the studied town district is an already working and well-functioning organisation, and that the lack of financial resources should not be

Eftersom det är heterogen grupp av praktiker och experter på flera angränsande fält täcker vår undersökning många olika aspekter av arbetet mot sexuell trafficking,

People who make their own clothes make a statement – “I go my own way.“ This can be grounded in political views, a lack of economical funds or simply for loving the craft.Because