Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

COMSATS University Islamabad, Wah Campus

Department of Computer Science


LECTURE # 16
SUBJECT NAME: Automata Theory
TOPIC: Kleene’s Theorem

In the last three chapters we introduced three separate ways of defining a language: by regular
expression, by finite automaton, and by transition graph. (Remember that the language defined by a machine is the set of all
words it accepts.) In this chapter we will present a theorem proved by Kleene in 1956, which (in our version) says that if a
language can be- defined by any one of these three ways, then it can also be defined by the other two. One way of stating
this is to say that all three of these methods of defining languages are equivalent.

THEOREM 6 Any language that can be defined by 1. regular expression or 2. finite automaton or 3. transition graph can be
defined by all three methods. This theorem is the most important and fundamental result in the Theory of Finite Automata.
We are going to take extreme care with its proof.

PROOF The three sections of our proof will be:

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

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

(TG->GTG)

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.

The Proof of Part 1

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.

The Proof of Part 2

The proof of this part will be by constructive algorithm. This means that we present a procedure that starts out with a
transition graph and ends up with a regular expression that defines the same language. To be acceptable as a method of
proof, any algorithm must satisfy two criteria. It must work for every conceivable TG, and it must guarantee to finish its job
in a finite time (a finite number of steps). For the purposes of theorem-proving alone, it does not have to be a good
algorithm (quick, least storage used, etc.). It just has to work in every case.

i) Unique start state:

This process is illustrated below on a TG that has three start states: 1, 3, and 5.
ii) Unique final state:

iii) Convert more than one loop into single loop:


The TG we shall consider is the one below, which accepts all words that begin and end with double letters (having at
least four different letters). This is by no means the only TG that accepts this language.
As it stands, this machine has only one start state, but it has two final states, so we must introduce a new unique final state
following the method prescribed by the algorithm.
Now by the last rule of the algorithm, this machine defines the same language as the regular expression

(aa + bb)(a + b)*(aa) + (aa + bb)(a + b)*(bb)

If we had to make up a regular expression for the language of all strings that begin and end with double letters, we would
probably write:

(aa + bb)(a + b)*(aa + bb)

Example: Let us start with the TG that accepts strings with an even number of a's and an even number of b's, the language
EVEN-EVEN.

When we eliminate state 2, the path from 1 to 2 to I becomes a loop at state 1:

which becomes:
which becomes:

which reduces to the regular expression:

[(aa + bb) + (ab + ba)(aa + bb)*(ab + ba)]*

which is exactly the regular expression we used to define this language before. Anyone who was wondering how we could
have thought up that complicated regular expression we presented in Chapter 4 can see now that it came from the obvious
TG for this language by way of our algorithm. We still have one part of Kleene's theorem yet to prove. We must show that
for each regular expression we can build a finite automaton that accepts the same language.

You might also like