0% found this document useful (0 votes)
643 views

Kleene's Theorem - Part 1: The Recursive Definition of Regular Language

Kleene's theorem states that (1) any regular language is accepted by a finite automaton and (2) any language accepted by a finite automaton is regular. The proof of part 1 constructs finite automata to accept operations on regular languages like union, concatenation, and Kleene star. Part 2 proves any language accepted by a finite automaton is regular by showing the sets of strings from state to state can be described by regular expressions.

Uploaded by

Nehal Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
643 views

Kleene's Theorem - Part 1: The Recursive Definition of Regular Language

Kleene's theorem states that (1) any regular language is accepted by a finite automaton and (2) any language accepted by a finite automaton is regular. The proof of part 1 constructs finite automata to accept operations on regular languages like union, concatenation, and Kleene star. Part 2 proves any language accepted by a finite automaton is regular by showing the sets of strings from state to state can be described by regular expressions.

Uploaded by

Nehal Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Kleene's Theorem --- Part 1

It states that any regular language is accepted by an FA and conversely that any
language accepted by an FA is regular.

Theorem 1 (Part 1 of Kleene's theorem): Any regular language is accepted by a


finite automaton.

Proof: This is going to be proven by (general) induction following the recursive


definition of regular language.

Basis Step: As shown below the languages ,{ } and { a } for any symbol a
in are accepted by an FA.

Inductive Step: We are going to show that for any languages L1 and L2 if they are
accepted by FAs, then L1 L2 , L1L2 and L1* are accepted by FAs. Since any
regular language is obtained from { } and { a } for any symbol a in by using
union, concatenation and Kleene star operations, that together with the Basis Step
would prove the theorem.

Suppose that L1 and L2 are accepted by FAs M1 = < Q1 , , q1,0 , 1 , A1 > and

M2 = < Q2 , , q2,0 , 2 , A2 > , respectively. We assume that Q1 Q2 =


without loss of generality since states can be renamed if necessary.
Then L1 L2 , L1L2 and L1* are accepted by the FAs Mu = < Qu , , qu,0 , u ,
Au > , Mc = < Qc , , qc,0 , c , Ac > and Mk = < Q2 , , qk,0 , k , Ak > ,
respectively, which are given below.

Mu = < Qu , , qu,0 , u , Au > :

Qu = Q1 Q2 { qu,0 } , where qu,0 is a state which is neither in Q1 nor in Q2 .


u = 1 2 { (qu,0, , { q1,0 , q2,0 } ) } , that is u(qu,0, ) = { q1,0 , q2,0 } .

Note that u(qu,0, a ) = for all a in .


Au = A1 A2

Mc = < Qc , , qc,0 , c , Ac > :

Qc = Q1 Q2
qc,0 = q1,0

c= 1 2 { (q, , { q2,0 } ) | q A1 }
Ac = A2

M k = < Qk , , qk,0 , k , Ak > :

Qk = Q1 { qk,0 } , where qk,0 is a state which is not in Q1 .

k= 1 { (qk,0, , { q1,0 } ) } { (q, , { qk,0 } ) | q A1 }


Ak = { qk,0 }

These NFA- s are illustrated below.


It can be proven, though we omit proofs, that these NFA- s , Mu, Mc and Mk , in
fact accept L1 L2 , L1L2 and L1*, respectively.

End of Proof
Examples of Mu , Mc and Mk:

Example 1: An NFA- that accepts the language represented by the regular


expression (aa + b)* can be constructed as follows using the operations given
above.
Example 2: An NFA- that accepts the language represented by the regular
expression ((a + b)a*)* can be constructed as follows using the operations given
above.
Kleene's Theorem -- Part 2

The converse of the part 1 of Kleene Theorem also holds true. It states that any
language accepted by a finite automaton is regular.
Before proceeding to a proof outline for the converse, let us study a method to
compute the set of strings accepted by a finite automaton.
Given a finite automaton, first relabel its states with the integers 1 through n,
where n is the number of states of the finite automaton. Next denote by L(p, q, k)
the set of strings representing paths from state p to state q that go through only
states numbered no higher than k. Note that paths may go through arcs and vertices
any number of times.
Then the following lemmas hold.

Lemma 1: L(p, q, k+1) = L(p, q, k) L(p, k+1, k)L(k+1, k+1, k)*L(k+1, q, k) .

What this lemma says is that the set of strings representing paths from p to q
passing through states labeled with k+1 or lower numbers consists of the following
two sets:
1. L(p, q, k) : The set of strings representing paths from p to q passing through
states labeled wiht k or lower numbers.
2. L(p, k+1, k)L(k+1, k+1, k)*L(k+1, q, k) : The set of strings going first from p to
k+1, then from k+1 to k+1 any number of times, then from k+1 to q, all without
passing through states labeled higher than k.
See the figure below for the illustration.
Lemma 2: L(p, q, 0) is regular.
Proof: L(p, q, 0) is the set of strings representing paths from p to q without passing
any states in between. Hence if p and q are different, then it consists of single
symbols representing arcs from p to q. If p = q, then is in it as well as the
strings representing any loops at p (they are all single symbols). Since the number
of symbols is finite and since any finite language is regular, L(p, q, 0) is regular.

>From Lemmas 1 and 2 by induction the following lemma holds.

Lemma 3: L(p, q, k) is regular for any states p and q and any natural number k.

Since the language accepted by a finite automaton is the union of L(q0, q, n) over
all accepting states q, where n is the number of states of the finite automaton, we
have the following converse of the part 1 of Kleene Theorem.

Theorem 2 (Part 2 of Kleene's Theorem): Any language accepted by a finite


automaton is regular.
Example : Let us find the language accepted by the following finite automaton
using the lemmas.

Let us denote by r(p, q, k) the regular expression for the set of strings L(p, q, k).
Then the language accepted by this NFA is r(1, 1, 3).
By Lemma 1, r(1, 1, 3) = r(1, 1, 2) + r(1, 3, 2)r(3, 3, 2)*r(3, 1, 2) .

r(1, 1, 2):
r(1, 1, 2) = r(1, 1, 1) + r(1, 2, 1)r(2, 2, 1)*r(2, 1, 1)
r(1, 1, 1) = r(1,1,0) + r(1,1,0)r(1,1,0)*r(1,1,0) = a* , since r(1,1,0) = a + .
r(1, 2, 1) = r(1,2,0) + r(1,1,0)r(1,1,0)*r(1,2,0) = a+ , since r(1,2,0) = a .
r(2, 2, 1) = r(2,2,0) + r(2,1,0)r(1,1,0)*r(1,2,0) = ba+ + , since r(2,2,0) = and
r(2,1,0) = b .
r(2, 1, 1) = r(2,1,0) + r(2,1,0)r(1,1,0)*r(1,1,0) = ba* .

Hence r(1, 1, 2) = a* + a+(b a+)*b a* .

r(1, 3, 2):
r(1, 3, 2) = r(1, 3, 1) + r(1, 2, 1)r(2, 2, 1)*r(2, 3, 1)

r(1, 3, 1) =
r(2, 3, 1) = a

Hence r(1, 3, 2) = a+(b a+ + )*a


= a+(b a+ )*a .
r(3, 3, 2):
r(3, 3, 2) = r(3, 3, 1) + r(3, 2, 1)r(2, 2, 1)*r(2, 3, 1)
r(3, 3, 1) =

r(3, 2, 1) = r(3,2,0) + r(3,1,0)r(1,1,0)*r(1,2,0) = ba+ , since r(3,2,0) = and r(3,1,0)


=b.

Hence r(3, 3, 2) = + ba+( ba+ + )*a


= + ( ba+)+a

r(3, 1, 2):
r(3, 1, 2) = r(3, 1, 1) + r(3, 2, 1)r(2, 2, 1)*r(2, 1, 1)
r(3, 1, 1) = r(3,1,0) + r(3,1,0)r(1,1,0)<sup*< sup="" style="color: rgb(0, 0, 0); font-
family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-
align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-
spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-
color: initial;">r(1,1,0) = ba*

Hence r(3, 1, 2) = ba* + ba+( ba+ + )*ba*


= ( ba+ )*ba* .

Hence r(1, 1, 3) = a* + a+(b a+)*ba* + ( a+( ba+ )*a )( + ( ba+)+a )*( ba+ )*ba*.

This can be further simplified to (a + ab + abb)*, then to (a + ab)*. The detail is left as an
exercise though it would be quite challenging.

In this example there is only one accepting state. If there are more accepting states, then r(p,
q, n) must be found for each accepting state q, where p is the initial state and n is the number
of states in the given finite automaton, and all the r(p, q, n)'s must be added together to get
the regular expression for the language accepted by the automaton.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy