Professional Documents
Culture Documents
Lect 07
Lect 07
Lect 07
Lecture 7
Kleenes Theorem
Regular Expression
GTG
TG
NFA-
NFA
Finite Automaton
How to convert a
Generalised Transition Graph
into a
Regular Expression
Make a unique
Start State
with no input
transitions
Are
YES
there any Final States
?
NO
Write
Eliminate
multiple loops
NO
Is the GTG
connected?
YES
Write the
label
Make a unique
Final State with no
output transitions
NO
Is
the number of states
> 2?
YES
Eliminate
multiple edges
Eliminate a
state which is
NOT
the Start state
or the
Final state
...
...
...
...
...
...
...
...
...
...
...
...
...
R1
...
R3
R1 + R2 + R3
...
...
R1
R2
...
R3
...
R1 + R2 + R3
...
State Elimination
Cases
1
2
3
4
5
6
Incoming edges
Outgoing edges
Loops
from a different state to a different state
1
1
NO
1
1
YES
1
More than 1
NO/YES
More than 1
More than 1
NO/YES
0
0, 1, or more
NO/YES
0, 1, or more
NO/YES
...
R1
...
R2
R1 R2
...
...
...
R1
...
R2
R1 (S)* R2
...
...
...
R2
R1
R3
...
...
...
R4
R1 (S )* R2
...
R1 (S )* R3
...
...
...
R1 (S )* R4
S
R1
...
R2
R3
...
...
R4
R1 (S )* R2
...
R1 (S )* R3
R1 (S )* R4
...
...
...
R1
R2
R3
...
R5
...
...
...
R4
R1 (S )* R2
...
...
R1 (S )* R3
R5 (S )* R3
R5 (S )* R4
...
R5 (S )* R2
3
...
...
R1 (S )* R4
...
R1
R2
R3
...
R5
...
...
...
...
...
R4
...
...
...
...
R1
R2
R3
...
R5
...
...
...
...
...
R4
...
...
...
EVEN-EVEN
aa
ab + ba
aa
bb
ab + ba
bb
Revision
Know Kleenes Theorem
Be able to convert FAs into Regular Expressions
Preparation
Read
Text Book Chapter 8