CGT 581 G Procedural Methods L systems Bedrich Benes, Ph.D. Purdue University Department of Computer Graphics Technology L systems Lindenmayer systems Lindenmayer system or D0L systems [d zero l system] is a parallel string rewriting system is an ordered triple :, a finite non empty set called an alphabet is so called axiom (starting symbol) a finite set of production rules Aristid Lindenmayer (1925-1989) Production Rules Production rules have form, where * denotes reflexive transitive closure of the set i.e., a set of words that can be composed from the alphabet, including an empty word (non empty words) Derivation Derivation denoted by A derivation of the L system is rewriting all symbols in the word by the new symbols from the right hand side of the corresponding production rules. Note: If a rule is not present, we perform a copy of the symbol.
L systems Example: L systems Example (contd.) First derivation: Second derivation: Interpretation What if each symbol has a geometric meaning? Let s use (logo like) turtle graphics The turtle is an abstract geometrical automaton With the state is the position, is the orientation Can interpret commands L systems interpretation For example: a V Turtle command F go forward distance + turn left 60 - turn right 60 It reads the string and interprets each letter as a command
Example More examples 1 st derivation 2 nd derivation More examples More examples
Bracketed L systems Invented by Prusinkiewicz in 1992 Extends the L system by special symbols [ and ] and the turtle by two special commands a V Turtle command F go forward distance + turn left 60 - turn right 60 [ Store the status, on a stack ] Pick the status from the stack Bracketed L systems Example:,,,,, //,, // productions: Bracketed L systems the first string from the example is interpreted: Bracketed L systems Bracketed rules are useful for generating branching structures F [ + F ] F
Bracketed L systems Bracketed L systems Stochastic L systems Allow for multiple rules for one symbol Each rule has a label and a probability fired of being 1L L systems and 1R L systems Context sensitive Lindenmayer's systems 1L L systems include context sensitive rewriting 1L L systems one element from the left side is considered as the context The rules have a new form and are left and right context respectively Rewriting occurs only if is within the context from P. Prusinkiewicz and A.Lindenmayer. 1990. The Algorithmic Beauty of Plants. Springer-Verlag
1L L systems and 1R L systems Example pl systems Parametric Lindenmayer's systems Symbols can have parameter Symbols are called modules (parameterized symbols) It simulates propagation of a signal from the root! 1RL systems propagation from leaves down 1L1RL systems both directions Also called attributes (from attributed grammars) pl systems Example: pl systems pl systems also introduce conditional rule rewriting is the length of the step 8 4 2 2 2 4 2 2 2 lateral branches are getting smaller Step shortening
pl systems pl systems Example: stem, leaf, blossom, bud A(0)-> FA(1)-> F[-L]FA(2)->F[-L]F[+L]FA(3)->F[-L]F[+L]FB Open L systems Introduced in 1998 by Měch and Prusinkiewicz Can interact with surrounding environment Open L systems Example 1 2 query modules set exogenous parameters Could give: Depending on the values of
Open L systems L systems vs. Grammars L systems are parallel string rewriting systems All symbols are rewritten at once (Chomsky) Grammars rewrite sequentially Reading P. Prusinkiewicz and A.Lindenmayer. 1990. The Algorithmic Beauty of Plants. Springer Verlag www.algorithmicbotany.org