140 likes | 171 Views
Lindenmayer systems. Martijn van den Heuvel May 26th, 2011. Outline. Origin Definition Characteristics Extensions Comparision with other models Conclusion. Origin - Aristid Lindenmayer. 1925 – 1989 (63 years old) Hungarian/US Biologist at Utrecht University L-systems (1968)
E N D
Lindenmayer systems Martijn van den Heuvel May 26th, 2011
Outline • Origin • Definition • Characteristics • Extensions • Comparision with other models • Conclusion
Origin - Aristid Lindenmayer • 1925 – 1989 (63 years old) • Hungarian/US • Biologist at Utrecht University • L-systems (1968) • Biological development of multicellular organisms (algae) • Chomsky (formal) grammars (1957)
Definition • Rewriting system: • Define complex objects by rewriting simple objects • Tuple: G = (A,s,R) G = grammar A = alphabet (symbol set/states) s = starting axiom (seed) R = set of production/transition rules ‘Constants’ are identity functions; aa
Characteristics • Recursive • Parallel applying of productions • Rules can be deterministic/non-deterministic • Context-free / context sensitive states Name context <m,n>-system Rules 0L-system free <0,0>-L-system a z IL-system sensitive <m,n>-L-system <a1,..,am,b,c1…,cn>z 2L-system sensitive <1,1>-L-system <a1,b,c1>z
Example D0L-system Tuple: G = (A,s,R) G = grammar A = alphabet (symbol set/states) s = starting axiom (seed) R = set of production/transition rules States: { a,b,c,d,k } Rules: a cbc b dad c k d a k k a cbc kdadk kacbcak kcbckdadkcbck kkdadkkacbcakkdadkk kkacbcakkcbckdadkcbckkacbcakk … Repeating structure from 4th array: Sn = kSn-3Sn-2Sn-3k
Example D0L-system • Geometrical interpretation: • a and b are sharp tips • canddare lateral margins of lobes • k represents a notch
Geometrical extensions:Turtle graphics Turtle has: • A position (coordinates;x,y) • An orientation (angle; a) • A state s=(x,y,a) Also (possible): • Angle increment b • Step size d
Geometrical extensions:Turtle graphics • Example: Sierpinski triangle • variables: A Bboth mean “draw forward” • constants: +means “turn left by angle” − means “turn right by angle” • start: A • rules: (A → B−A−B), (B → A+B+A) • angle: 60° • Fixed step size (d), no angle increment (b)
Geometrical extensions:Turtle graphics Result for n=2, n=4, n=6 and n=8
Geometrical extensions:Bracketing • Extends previous turtle extension to split • Uses brackets [,] to delimit branches: • [ means “Pop a state from the stack and make it the current state of the turtle.” • ] means “Push the current state of the turtle onto a pushdown stack.”
Geometrical extensions:Bracketing Start: F Rule: F F[-F]F[+F][F] Angle: 25°
Comparision to other MOC • Very similar to semi-Thue & Markov systems • L-systems parallel/simultaneous, others sequential. • L-systems can be both deterministic/non-deterministic • All are Turing-complete • Cellular automata • Also simultaneous application of rules • Ozhigov proves: • The set of languages, computed in a polynomial time on L-systems, is exactly NP- languages. • Even states L-systems might be a more powerful MOC than a non-deterministic Turing machine
Conclusions • Powerful systems • Distinguishing by parallel appliance of rules • As formal language: • 0L-languages are context free type-2 in Chomsky hierarchy • IL-languages are context sensitive type-1 Chomsky hierarchy • Interesting readings: • The algorithmic beauty of plants – Lindenmayer & Prusinkiewicz (1990) • Lindenmayer systems as a model of computations – Y. Ozhigov (1998) • Parametric L-systems and their application to the modelling and visualization of plants – J.S. Hanan (1992) • http://www.kevs3d.co.uk/dev/lsystems/# (online L-system renderer)