Download presentation

Presentation is loading. Please wait.

Published byDaniela Lambert Modified over 2 years ago

1
L-System Aristid Lindenmayer (1968), biologist

2
L-System A method of constructing a FRACTAL that is also a MODEL for plant growth. The Computational Beauty of Nature – Gary William Flake

3
Fractal graphics

4
Plant model

5
L-System L-systems use an AXIOM as a starting STRING and ITERATIVELY apply a set of PARALLEL string substitution rules to yield one long string that can be used as instructions for drawing the fractal.

6
Production systems String : concatenation of alphabets (symbols). Axiom : the first initial symbol(s). Production rules : the description of how one string of symbols generate another.

7
An example Alphabets: a, b Axiom: b Rules: a -> ab b -> a

8
Test the generation StepResult 0b 1a 2ab 3aba 4abaab 5abaababa 6abaababaabaab

9
Another example Alphabets: a, b Axiom: b Rules: a -> ba b -> ab

10
Test the generation StepResult 0b 1ab 2baab 3abbabaab 4baababbaabbabaab

11
Terminal and non-terminal symbols We can use lower and UPPER case alphabets to represent the terminal and non-terminal symbols. Terminal symbols are those need no further expansion. Non-terminal symbols are those can further expand using the production rules.

12
Terminal and non-terminal symbols Rules: A -> b A -> bA In this case, A is a non-terminal symbol; b is a terminal symbol. The rules state that A can generate b and stop. A can also expand to bA where the A on the right hand side can expand again using the two rules.

13
Terminal and non-terminal symbols Rules: A -> b (terminal) A -> bA (non-terminal) The results will be, b, bb, bbb, bbbb, … Remember the regular expression last time, bb*

14
Exercise time Alphabets: A, a, b Axiom: A Rules: A -> ab (terminal) A -> aAb (non-terminal) Let’s see what can be generated.

15
Answer StepResult 0AA 1abaAb 2aabbaaAbb 3aaabbbaaaAbbb 4aaaabbbbaaaaAbbbb 5aaaaabbbbbaaaaaAbbbbb

16
Language Remember that the Finite State Automata can generate a language we called Regular Expression. The L-system can also generate another language we named Context-Free language.

17
Language According to Noam Chomsky, there are 4 types/hierarchies of Formal Language. We have learnt the, Regular expression, Context-free language. There are two more, namely the, Context-sensitive language, Unrestricted language.

18
Production rules Regular expression uses the rules, A -> b or A -> bC; While Context-Free language uses the rules like, A -> α; where α is any string of both terminal and non- terminal symbols.

19
Simple exercise Alphabets: F, -, + Axiom: F Rules: F -> F + F - - F + F We have only one production rule with the symbol F. Let’s see what happens.

20
Any meaning? We have not touched on any ideas about meaning – semantics yet. The language we generated is pure syntactic. We can, however, assign external meaning to the symbols and see what happens.

21
Any meaning?

24
The meaning Now we assign meaning to the symbols. F: draw a line segment forward +: turn anti-clockwise 60° -: turn clockwise 60 ° The rule F -> F + F - - F + F will become:

25
The meaning F F F F + -- +

26
Turtle graphics That is the Turtle Graphics (Logo) we learnt in primary school. The commands are, CommandTurtle action FDraw forward by a fixed length. fMove forward by a fixed length. +Turn anti-clockwise by a fixed angle. -Turn clockwise by a fixed angle. [Save the current location and orientation. ]Restore the last saved location and orientation.

27
L-system applet Try to create the graphics using the applet at http://www.cs.utah.edu/~jshepher/java/Lsystems/Lsystems.html

28
Exercise time Can you figure out the rule for this plant?

Similar presentations

OK

Describing Syntax and Semantics Chapter 3: Describing Syntax and Semantics Lectures # 6.

Describing Syntax and Semantics Chapter 3: Describing Syntax and Semantics Lectures # 6.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on synthesis and degradation of purines and pyrimidines nucleotides Ppt on safe abortion Ppt on measurement of price elasticity of demand Ppt on instrument landing system for sale A ppt on loch ness monster found Ppt on different occupations for kids Story ppt on leadership Ppt on market friendly state Download ppt on life cycle of butterfly Ppt on carl friedrich gauss discoveries