1 06/23/22 14:53 UML Simplicity in Complexity
104/20/23 04:55
UML
Simplicity in Complexity
204/20/23 04:55
UML
Rewriting SystemsClassic Example: Koch 1905
Initiator
Generator
304/20/23 04:55
UML
Rewriting Systems:Formal Grammars
0 Best understood rewriting systems are those that operate on character strings
0 Chomsky 1956: formal grammars applied to natural languages
0 Backus & Naur 1959: rewriting notation applied to formal definition of programming language (ALGOL-60)
0 Lindenmayer 1968 introduced a new type of rewriting system, subsequently termed L-systems- Essential difference between Chomsky grammars and L-
systems is that in L-systems productions are applied in parallel.
404/20/23 04:55
UML
Deterministic, Context Free L-Systems (DOL)
a ab
b a
b
b
a
ab
aba
abaab
abaababa
axiom:
Grammar:
Derivation:
504/20/23 04:55
UML
Formal Definition of L-System
Let denote an alphabet, the set of all words over , and the
set of all non empty words over . A is an ordered
triplet where is the of the system, is a
non - empty word called the , and is a finite set of
. A production is written: . The letter
and the word are called the and the of this
production, respectively. It is assumed that for any letter there is
at least one word such that . If no production i
V V V V
V string OL-system
G V P V alphabet V
axiom P V V
productions a P a
a predecessor successor
a V
V a
* +
+
, ,
( , )
*
s explicitly
defined for a given predecessor , the
is assumed to belong to the set of produtions . An OL system
is (noted DOL - system) if and only if for each
there is exactly one such that .
a V identity production
a a P
er istic a V
V a
det min*
100%RealMath
604/20/23 04:55
UML
Formal Definition of Derivation
Let = be an arbitrary word over . The word
is from (or by)
noted , if and only if for all A word
is generated by in a derivation of length n if there exists a
of words such that:
and
a a V
V directly derived generated
a i m
G
developmental sequence
m
m
i i
n
n n
1
1
0 1
0 0 1
1
, ,..., .
, ,...,
, ,
100%RealMath
704/20/23 04:55
UML
Turtle Interpretation of StringsAbelson & diSessa (MIT 1982)
The state of the turtle is defined as an orderedtriplet, where the cartesian coordinates represent the turtle’s position, and the angle , called the heading, is interpreted as the directionin which the turtle is facing.
( , , )x y ( , )x y
( , )x y
Where am I?
804/20/23 04:55
UML
Turtle Interpretation of Character String
Move forward a step of length . The state of the turtly changes to
A line segment between the point and
is drawn.
Move forward a step of length without drawing a line.
Turn left by angle . The next state of the turtle is
The positive orientation of angles is counter - clockwise.
Turn right by angle . The next state of the turtle is
The negative orientation of angles is clockwise.
d
(x+d a,y+d a) x y
(x+d a,y+d a)
d
x y
x y
cos sin ( , )
cos sin
( , , ).
( , , ).
Character Interpretation
F
f
+
-
904/20/23 04:55
UML
Turtle Interpretation of a String
FFF-FF-F-F+F+FF-F-FFFString:
+ -
1004/20/23 04:55
UML
Example of Turtle Interpretation:Quadratic Koch Island
The L-System: :
:
F F F F
p F F F F FF F F F
1104/20/23 04:55
UML
Sequence of Koch Curves Obtained byModification of Production Successor
1204/20/23 04:55
UML
General Edge Rewriting
The Koch constructions are a restricted case of general edgerewriting, where there can be more than one edge letter, interpretedby the turtle as “move forward”.
Examples:
1304/20/23 04:55
UML
Example of FASS Curves Generated byEdge-rewriting
FASS = space-filling, self-avoiding, simple, and self-similar
1404/20/23 04:55
UML
Node Rewriting:Turtle Interpretation
PA QA
P
A
Q
A
Aligned withturtle statehere:
Turtle resumeshere:Subfigure A
1504/20/23 04:55
UML
Node Rewriting Example:Hilbert Curve
:
:
:
L
p L RF LFL FR
p R LF RFR FL1
2
1604/20/23 04:55
UML
Modeling in Three Dimensions
U
H
L
R
R
R
U
L
H
( )
cos sin
sin cos
( )
cos sin
sin cos
( )cos sin
sin cos
0 0
0 0
0 0 1 0
0 0 0 1
0 0
0 1 0 0
0 0
0 0 0 1
1 0 0 0
0 0
0 0
0 0 0 1
H L U H L U R' ' '
1704/20/23 04:55
UML
Symbols to Control Turtle Orientation in Space
+ Turn left by angle , using rotation matrix Ru()
- Turn right by angle , using rotation matrix Ru(-)
& Pitch down by angle , using rotation matrix RL()
^ Pitch up by angle , using rotation matrix RL(-)
\ Roll left by angle , using rotation matrix RH()
/ Roll right by angle , using rotation matrix RH(-)
Symbol Turtle Semantics
1804/20/23 04:55
UML
Three Dimensional Hilbert Curve
1904/20/23 04:55
UML
Branching Structures:Axial Trees
•At each node at most one outgoing straight segment is distinguished
•The first segment in the sequence originates at the root of the tree or as a lateral segment at some node
•Each subsequent segment is a straight segment
•The last segment is not followed by any straight segments
2004/20/23 04:55
UML
Tree OL-Systems
A tree OL - System is specified by three components:
a set of edge labels an initial tree (axiom) with labels from
and a set of tree productions
V V
P
, ,
.
s
a
bc
de
s
T1 T2
a
bc
de
Production
2104/20/23 04:55
UML
Bracketed OL-Systems
Turtle semantics:
[ Push the current state of the turtle onto a stack. The information saved contains the turtle’s position andorientation, and possibly other attributes such as color,segment width
] Pop a state from the state and make it the current state of the turtle. No line is drawn, although in general theposition of the turtle changes
Example:F[+F][-F[-F]F]F[+F][-F]
2204/20/23 04:55
UML
Plant-Like Structures Generated byBracketed OL-Systems
2304/20/23 04:55
UML
Plant-Like Structures Generated byBracketed OL-Systems
2404/20/23 04:55
UML
Three Dimensional Bracketed OL-System
2504/20/23 04:55
UML
Stochastic OL-Systems
:
: [ ] [ ]
: [ ]
: [ ]
.
.
.
F
p F F F F F F
p F F F F
p F F F F
133
233
334
0.33 0.33 0.34
2604/20/23 04:55
UML
2704/20/23 04:55
UML
Example of Stochastic DOL-System
2804/20/23 04:55
UML
Parametric DOL-Systems
: ( ) ( , )
: ( , ): ( , )
: ( , ): ( ) ( , )
: ( ):
: ( ): ( )
B A
p A x y y A x x y
p A x y y B x A xy
p B x x C
p B x x B x
2 4 4
3 2
3 0
1
1 1
1
2
3
4
p A x y y A x x y1 3 2: ( , ): ( , )
Formal Parameters Actual Parameters
Condition
B A
B B A
B B A
CB A
CB A
( ) ( , )
( ) ( ) ( , )
( ) ( ) ( , )
( ) ( , )
( ) ( . , )
2 4 4
1 4 1 0
0 3 2 1
2 4 3
1 133 7
Derivation:L-System:
Module
2904/20/23 04:55
UML
Parametric DOL Systems
0 A production matches a nodule in a parametric word if the following conditions are met:- The letter in the module and the letter in the production
predecessor are the same- The number of actual parameters in the module is equal
to the number of formal parameters in the production predecessor
- The condition evaluates to true if the actual parameter values are substituted for the formal parameters in the production
3004/20/23 04:55
UML
Turtle Interpretation of Parametric Words
If one or more parameters are associated with a symbol interpreted by the turtle, the value of the first parameter controls the turtle’s state. If the symbol is not followed by any parameters, default values specified ooutside the L-system are used as in the non-parametric case. The basic set of symbols affected by the introduction of parameters is listed below:
F(a) Move forward a step of length a > 0.
f(a) Move forward a step of length a without drawing a line
+(a) Rotate around U by an angle of a degrees
&(a) Rotate around L by an angle of a degrees
/(a) Rotate around H by an angle of a degrees
3104/20/23 04:55
UML
Example of Textures and Parametric Surface Models
3204/20/23 04:55
UML
Developmental Surface Models
Consider the following L-system:
:
: |
:
L
p L FX X FX FX X FX
p X FX1
2
3304/20/23 04:55
UML
Fern Drawn Using Leaves Specified byPrevious L-System
3404/20/23 04:55
UML
Alternative Notation for Polygon Drawing
3504/20/23 04:55
UML
Parametric L-Systems Produce Varying Leaf Structures
3604/20/23 04:55
UML
3704/20/23 04:55
UML
Rose Leaves Generated by L-System ofPrevious Slide
3804/20/23 04:55
UML
Parametric L-System Used to GenerateCompound Leaves
3904/20/23 04:55
UML
Examples of Compound Leaves Generated byL-System of Slide 38
4004/20/23 04:55
UML
Examples of Compound Leaves Generated byL-System of Slide 38
4104/20/23 04:55
UML
General Branching Patterns
Let denote continuing apices, denote a terminal apex, and
I an internode, the terminal and sympoidal patterns are characterized
by rules of the form:
Monopoidal and polypoidal patterns have rules of the form:
A B C X
A I B X X
A I B X C
n m
n m
, ,
[ ] [ ]
[ ] [ ]
0 Terminal: main apex and all lateral apices terminate0 Sympoidal: main apex terminates; some lateral apices
continue0 Monopoidal: main apex continues; all lateral apices terminate0 Polypoidal: main apex continues; some lateral apices also
continue
4204/20/23 04:55
UML
Inflorescences: Compound Flowering StructuresRacemes: Monopoidal Inflorscences
:
: [ ]
: [ ]
: [ ]
a
p a I L a
p a I L A
p A I K A
1
2
3
Generating Partial L-System:
L: leafI: InternodeK: Flower
4304/20/23 04:55
UML
Pattern of Simple Racemes
4404/20/23 04:55
UML
Lily-of-the-ValleyExample of Simple Raceme
4504/20/23 04:55
UML
Development of Raceme:Capsella Bursa-Pastoris
4604/20/23 04:55
UML
L-System Generating Capsella Bursa-Pastoris