Lindenmayer system

Lindenmayer system

Definition

Lindenmayer systems

, or L-systems for short, are a variant of general

rewriting systems

. Like a rewriting system, an L-system is also a

language

generator

, where words are generated by applications of finite numbers of rewriting steps to some initial word given in advance. However, unlike a rewriting system, rewriting

occurs in

parallel

in an L-system. The notion of L-system was introduced by plant biologist Aristid Lindenmayer when he was studying the growth

development

of red algae.

Formally, an

L-system

is a triple

G

=

(

Σ

,

P

,

w

)

, where

1.

Σ

is an

alphabet

,

2.

w

is a word over

Σ

, and

3.

P

is a finite subset of

Σ

×

Σ

*

such that for every

a

∈

Σ

, there is at least one

u

∈

Σ

*

such that

(

a

,

u

)

∈

P

.

w

is called the

start word

, or the

axiom

of

G

, and elements of

P

are called

productions

of the L-system

G

, and are written

a

→

u

instead of

(

a

,

u

)

.

As stated above, an L-system is a language generator, where words are generated from the axiom

w

by repeated applications of productions of

P

. Let us see how this is done. Define a

binary relation

⇒

on

Σ

*

as follows: for words

u

,

v

∈

Σ

*

,

u

⇒

v

iff either

u

=

a

1

⁢

⋯

⁢

a

n

and

v

=

v

1

⁢

⋯

⁢

v

n

, where

a

i

→

v

i

∈

P

, or

u

=

v

.

Now, take the

transitive closure

⇒

*

of

⇒

and set

L

⁢

(

G

)

:=

{

u

∣

w

⇒

*

u

}

.

Then

L

⁢

(

G

)

is called the

language generated

by the L-system

G

. An L-language is

L

⁢

(

G

)

for some L-system

G

.

Examples

1.

Let

G

=

(

{

a

}

,

{

a

→

a

2

}

,

a

)

. In two

derivations

, we get

a

⇒

a

2

⇒

a

2

⁢

a

2

=

a

4

. It is easy to see that after

n

derivations, we get

a

⇒

*

a

2

n

, and that

L

⁢

(

G

)

=

{

a

2

n

∣

n

≥

1

}

. Note that if parallel rewriting is not required then

a

3

may be derived in three steps:

a

⇒

a

2

⇒

(

a

2

)

⁢

a

=

a

3

.

2.

Let

G

=

(

{

a

}

,

{

a

→

a

,

a

→

a

2

}

,

a

)

. Then

L

⁢

(

G

)

=

{

a

}

+

.

3.

Let

G

=

(

{

a

}

,

{

a

→

λ

,

a

→

a

2

}

,

a

)

. Then

L

⁢

(

G

)

=

{

a

2

⁢

n

∣

n

≥

0

}

∪

{

a

}

.

4.

Let

G

=

(

{

a

,

b

}

,

{

a

→

a

b

,

b

→

b

a

}

,

a

)

. Then we get a

sequence

of words

a

⇒

a

⁢

b

⇒

a

⁢

b

⁢

b

⁢

a

⇒

a

⁢

b

⁢

b

⁢

a

⁢

b

⁢

a

⁢

a

⁢

b

⇒

⋯

, and

L

⁢

(

G

)

is the set containing words in the sequence. Note the

recursive

nature of the sequence: if

u

n

is the

n

th word in the sequence, then

u

1

=

a

and

u

n

+

1

=

u

n

⁢

h

⁢

(

u

n

)

, where

h

is the

homomorphism

given by

h

⁢

(

a

)

=

b

and

h

⁢

(

b

)

=

a

.

5.

L-systems can be used to generate graphs. Usually, symbols in

Σ

represent instructions on how to construct the graph. For example,

G

=

(

{

a

,

b

,

c

}

,

{

a

→

a

,

b

→

b

,

c

→

c

a

c

b

b

c

a

c

}

,

c

)

generates the famous Koch curve. If

u

∈

L

⁢

(

G

)

is derived from

c

in

n

steps, then

u

represents the

n

-th

iteration

of the Koch curve. To draw the

n

-th iteration based on

u

, we do the following:

(a)

write

u

=

d

1

⁢

⋯

⁢

d

m

, where

d

i

∈

Σ

(it is easy to see that

m

=

2

n

-

1

).

(b)

at each

d

i

, a current position

z

i

, and current direction

θ

i

, are given.

(c)

start at the origin on the

Euclidean plane

in the

positive

x

direction, so that

z

0

=

(

0

,

0

)

and

θ

0

=

0

.

(d)

upon reading

d

i

, where

i

>

0

:

*

if

d

i

=

a

, set

z

i

=

z

i

-

1

and

θ

i

=

θ

i

-

1

+

60

,

*

if

d

i

=

b

, set

z

i

=

z

i

-

1

and

θ

i

=

θ

i

-

1

-

60

,

*

if

d

i

=

c

, draw a

line segment

of unit length from

z

i

-

1

to a point

P

based on

θ

i

-

1

, and set

z

i

=

P

and

θ

i

=

θ

i

-

1

.

A production

b

→

u

is said to correspond to

a

∈

Σ

if

b

=

a

. Both productions in Example 2 correspond to

a

. A production is said to be a

constant

production if it has the form

a

→

a

. A symbol in

Σ

is called a

constant

if the only corresponding production is the constant production. In the last example above,

a

,

b

are both constants.

a

is not a constant in Example 2, even though it has a corresponding constant production.

Properties

Given an L-system

G

=

(

Σ

,

P

,

w

)

, we can associate a

function

f

G

:

Σ

→

2

Σ

*

as follows: for each

a

∈

Σ

, set

f

G

⁢

(

a

)

:=

{

u

∣

a

→

u

∈

P

}

.

Then

f

G

extends to a

substitution

s

G

:

Σ

*

→

2

Σ

*

. It is easy to see that

s

G

⁢

(

w

)

is just the set of words derivable from

w

in one step:

s

G

⁢

(

w

)

=

{

u

∣

w

⇒

u

}

. In fact,

L

⁢

(

G

)

=

⋃

{

s

G

n

⁢

(

w

)

∣

n

≥

0

}

,

where

s

G

0

⁢

(

w

)

=

{

w

}

, and

s

G

n

+

1

⁢

(

w

)

=

s

G

⁢

(

s

G

n

⁢

(

w

)

)

.

In

relation

to languages described by the

Chomsky hierarchy

, we have the following results:

1.

Every L-language is

context-free

.

2.

If an L-system

G

=

(

Σ

,

P

,

w

)

contains a constant production for each symbol in

Σ

, then

L

⁢

(

G

)

is context-free.

3.

Denote the families of

regular

, context-free,

context-sensitive

, and L-languages by

ℛ

,

ℱ

,

𝒮

,

ℒ

, and set

𝒳

1

=

ℛ

,

𝒳

2

=

ℱ

-

ℛ

, and

𝒳

2

=

𝒮

-

ℱ

. Then

ℒ

∩

𝒳

i

and

ℒ

¯

∩

𝒳

i

are non-empty for

i

=

1

,

2

,

3

. Here,

ℒ

¯

is the

complement

of

ℒ

in

2

Σ

*

, the family of all languages over

Σ

.

Subsystems

An L-system is said to be

deterministic

if every symbol in

Σ

has at most one (hence exactly one) production corresponding to it. A deterministic L-system is also called a DL-system. Examples 1,4,5 above are DL-systems. For a DL-system, the associated substitution is a homomorphism, which means that for each

n

≥

0

, the set

s

G

n

⁢

(

w

)

is a

singleton

, so we get a unique sequence of words

w

0

,

w

1

,

…

, such that

w

n

⇒

w

n

+

1

. If

|

w

n

|

<

|

w

n

+

1

|

for some

n

, then the word sequence is

infinite

. In particular, if

w

n

is a prefix of

w

n

+

1

for all large enough

n

, and the lengths of the words have the

property

that

|

w

n

|

=

|

w

n

+

1

|

implies

|

w

m

|

<

|

w

m

+

1

|

for some

m

>

n

, then the DL-system defines a unique infinite word (by taking the union of all finite words). In Example 4 above, the infinite word we obtain is the famous

Thue-Morse sequence

(an infinite word is an infinite sequence).

An L-system is said to be

propagating

if no productions are of the form

a

→

λ

. A propagating L-system is also called a PL-system. All examples above, except 3, are propagating. A DPL-system is a deterministic propagating L-system. In a DPL-system, the lengths of the words in the corresponding sequence are non-decreasing, and one may classify DPL-systems by how fast these lengths grow.

Variations

There are also ways one can extend the generative capacity of an L-system by generalizing some or all of the criteria defining an L-system. Below are some:

1.

Create a

partition

of

Σ

=

N

∪

T

, the set

N

of non-terminals and the set

T

of terminals, so that only terminal words are allowed in

L

⁢

(

G

)

. Such a system is called an EL-system. Formally, an EL-system is a 4-tuple

H

=

(

N

,

T

,

P

,

w

)

such that

G

H

=

(

N

∪

T

,

P

,

w

)

is an L-system, and

L

⁢

(

H

)

=

L

⁢

(

G

H

)

∩

T

*

.

2.

Notice that the productions in an L-system are context-free in the sense that during a rewriting step, the rewriting of a symbol does not depend on the “

context

” of the symbol (its neighboring symbols). This is the reason why an L-system is also known as a 0L-system. We can generalize an 0L-system by permitting context-sensitivity in the productions. If the rewriting of a symbol depends both on its left and right neighboring symbols, the resulting system is called a 2L-system. On the other hand, a 1L-system is a system such that dependency is one-sided.

Formally, a 2L-system is a quadruple

(

Σ

,

P

,

w

,

⊔

)

.

Both

Σ

and

w

are defined as in an L-system.

⊔

is a symbol not in

Σ

, denoting a blank space.

P

is a subset of

Σ

1

×

Σ

×

Σ

1

×

Σ

*

, where

Σ

1

=

Σ

∪

{

⊔

}

, such that for every

(

a

,

b

,

c

)

∈

Σ

1

×

Σ

×

Σ

1

, there is a

u

∈

Σ

*

such that

(

a

,

b

,

c

,

u

)

∈

P

. Elements of

P

are called productions, and are written

a

⁢

b

⁢

c

→

u

instead of

(

a

,

b

,

c

,

u

)

. Rewriting works as follows: the binary relation

⇒

on

Σ

*

called a rewriting step, is given by

u

⇒

v

iff either

u

=

v

, or

u

=

a

1

⁢

⋯

⁢

a

n

and

v

=

v

1

⁢

⋯

⁢

v

n

, such that

(a)

⊔

a

1

⁢

a

2

→

v

1

,

(b)

a

i

-

1

⁢

a

i

⁢

a

i

+

1

→

v

i

where

i

=

2

,

⋯

,

n

-

1

, and

(c)

a

n

-

1

⁢

a

n

⊔

→

v

n

.

If

n

=

2

, then productions of the second form above do not apply. If

n

=

1

, then

⊔

a

1

⊔

→

v

1

are the only productions.

A 1L-system is then a 2L-system such that either,

a

⁢

b

⁢

c

→

u

for some

c

∈

Σ

1

implies

a

⁢

b

⁢

d

→

u

for all

d

∈

Σ

1

, or

c

⁢

a

⁢

b

→

u

for some

c

∈

Σ

1

implies

d

⁢

a

⁢

b

→

u

for all

d

∈

Σ

1

.

It is easy to see that an L-system is a 2L-system such that if

a

⁢

b

⁢

c

→

u

for some

a

,

c

∈

Σ

1

, then

d

⁢

b

⁢

e

→

u

for all

d

,

e

∈

Σ

1

.

3.

Allow the possibility that not all of the symbols may be rewritten. This means that

u

⇒

v

iff either

u

=

v

, or

u

=

a

1

⁢

⋯

⁢

a

n

and

v

=

v

1

⁢

⋯

⁢

v

n

, and either

a

i

=

v

i

or

a

i

→

v

i

∈

P

.

4.

Allow more than one axiom. In other words, the single axiom word

w

is replaced by a set

W

of axioms.

References

1

A. Salomaa,

Formal Languages

, Academic Press, New York (1973).

Title

Lindenmayer system

Canonical

name

LindenmayerSystem

Date of creation

2013-03-22 18:57:31

Last modified on

2013-03-22 18:57:31

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

11

Author

CWoo (3771)

Entry type

Definition

Classification

msc 92C80

Classification

msc 68Q45

Synonym

L system

Synonym

DL-system

Synonym

PL-system

Defines

L-system

Defines

start word

Defines

deterministic L-system

Defines

propagating L-system

Defines

L-language

Defines

EL-system

Defines

2L-system

Defines

1L-system

Generated on Sat Feb 10 13:39:54 2018 by

LaTeXML