cl
Finite-State Machines (Automata) lecture 11
- a simple form of computation
- used widely
- one way to find patterns
- with thanks to Gérard Berry
1
cl a simple form of computation used widely one way to find - - PDF document
Finite-State Machines (Automata) lecture 11 cl a simple form of computation used widely one way to find patterns with thanks to Grard Berry 1 ATM wrong PIN insert card PIN ok withdraw e c n a l a b return card
1
£
yes choose a/c b a l a n c e withdraw insert card wrong PIN PIN ok amount no take money r e t u r n c a r d return card
2
withdraw
B axle sensor (detects passing wheels) from-a-to-b : a↓ ; b↓ ; a↑ ; b↑
a b
from-b-to-a : b↓ ; a↓ ; b↑ ; a↑
3
axle sensor inputs : a↑, a↓, b↑, b↓
from-a-to-b, from-b-to-a
a↓ b↓ a↑ b↑ / from-a-to-b b↓ a↓ b↑ a↑ / from-b-to-a b↑ a↑ a↓ b↑ a↑ b↓
a b
a a a b b b ab ba 4
carriage counter inputs : a2b, b2a
A2B, B2A
a2b a2b b2a
a2b / A2B
b2a b2a b2a
b2a / B2A
b2a b2a a2b a2b a2b a2b
b
B
a2b = from-a-to-b
5
Industry
Electronic circuits
Communication protocols
Language analysis
001
6
d d
+⎮−
d d d ε start end sta sta alternative paths repetition skip S
7
R S
8
R S
9
R S
10
R
11
12
s
<>
su sus s s u s u s
[]
s su sus • s s s sus • u
[]
su
[]
su
[^su] [] [] [] []
FSAs can be represented as:
If you’re in state s and you’re looking at a u, go to state su 13 [^su] stands for any character except s or u
[^su] [^s] [^su] [^su] [^su] stands for any character except s or u
r r a a r r S
14
r a r r S
15
f
fl []
fl(i|o)
16
w
[]
wha+ []
w wh wha+
w
[] []
[] h
[] wh [] []
a
[] []
wha+
wha+
m
[] [] []
h m a
a
S
17