You are on page 1of 43

Kleene’s Theorem

Lecture 11

Faryal Shamsi
Lecturer Computer Science

Sukkur IBA University


Kleene’s Theorem
• This theorem is the most important and fundamental result in the
Theory of Finite Automata.

• Any regular language that can be defined by –

1. regular expression or
2. finite automaton or
3. transition graph

can be defined by all three methods.


Proof
• The three sections of our proof will be –

1. Part 1 – Every language that can be defined by a finite automaton can also
be defined by a transition graph.

2. Part 2 – Every language that can be defined by a transition graph can also
be defined by a regular expression.

3. Part 3 – Every language that can be defined by a regular expression can also
be defined by a finite automaton. When we have proven these three parts,
we have finished our theorem.
Proof – Part 1 ( FA  TG)

• This is the easiest part.

• Every finite automaton is itself a transition graph.

• Therefore, any language that has been defined by a finite automaton


has already been defined by a transition graph.

• Done 
Proof – Part 2 ( TG  RE)

• Step. 1 – Converting DFA into NFA


Step 1

Step. 1 – Converting DFA into NFA


Step. 1 – Converting DFA into NFA
Step 2

• Step. 2 – Replace more than one incoming edges to any state with
single edge
Step. 2 – Replace more than one incoming edges to any state with single edge
Proof – Part 2 ( TG  RE)

• Step. 3 – Eliminate state by using concatenation operation


• Repeat step 3 again and again until we have eliminated all possible
states and we have distinct initial state and final state
Step 4

• Step. 4 – If there are more than one edges between initial start state
and final state make is one. (by using Union operation on regular
expressions)
Let’s see an example
State Elimination
Another example
Another example
Another example
Another example
TG for EVEN-EVEN
DFA for EVEN-EVEN
a

q1 q2
a

b b b
b
a

q3
q4
a
RE for EVEN-EVEN

• (aa + bb)* + ( (ab+ba) (aa+bb)* (ab+ba) )*


Proof – Part 3 ( RE  FA)
• Proof by recursive definition –
UNION – r1 + r2
FA1
FA2
• FA2 = EVEN-EVEN
FA3 = FA1 + FA2
a b a b
 Z1 Z2 Z3 + Z7 + Z4 + Z11

Z2 + Z4 Z5 + Z8 + Z11 + Z4

Z3 Z6  Z1 Z9 + Z11 Z1

+ Z4 + Z7 + Z8 Z10 + Z12 Z5

Z5 Z9 Z10 + Z11 + Z8 + Z7

Z6 + Z8 Z10 + Z12 + Z7 Z3
Concatenation – r1.r2
Concatenation – r1.r2
Example – r1.r2
Resultant FA
Closure – r1*
r = a* + aa*b r* = (a* + aa*b)*
=?

• The language defined by r* must


always contain the null word.
• To accept the null string A we must
indicate that the start state is also a
final state.

• (That’s already done in our case)


r = a* + aa*b r* = (a* + aa*b)*
=?
X1 X1

• The language defined by r*, the r


must be concatenated with r itself.

• Every final state is mapped to initial


state.

• In this case x2 = x1 and x2 both,


• Also x3 = x1 and x3 both
(a* + aa*b)*
Closure – r1*
(aa*bb*)*

You might also like