Kleene’s Theorem in TOC | Part-1

A language is said to be regular if it can be represented by using a Finite Automata or if a Regular Expression can be generated for it. This definition leads us to the general definition that; For every Regular Expression corresponding to the language, a Finite Automata can be generated.

For certain expressions like :- (a+b), ab, (a+b)* ; It’s fairly easier to make the Finite Automata by just intuition as shown below. The problem arises when we are provided with a longer Regular Expression. This brings about the need for a systematic approach towards FA generation, which has been put forward by Kleene in Kleene’s Theorem – I

Kleene’s Theorem-I :

For any Regular Expression r that represents Language L(r), there is a Finite Automata that accepts same language.

To understand Kleene’s Theorem-I, Let’s take in account the basic definition of Regular Expression where we observe that $\phi$, $\epsilon$ and a single input symbol “a” can be included in a Regular Language and the corresponding operations that can be performed by the combination of these are:

Say, $r_1$ and $r_2$ be two regular expressions. Then,

  1. $r_1$+$r_2$ is a regular expression too, whose corresponding language is L($r_1$) U L($r_2$)
  2. $r_1$.$r_2$ is a regular expression too, whose corresponding language is L($r_1$).L($r_2$)
  3. $r_1$* is a regular expression too, whose corresponding language is L($r_1$)*

We can further use this definition in association with Null Transitions to give rise to a FA by the combination of two or more smaller Finite Automata (each corresponding to a Regular Expression).

Let S accept L = {a} and T accept L = {b}, then R can be represented as a combination of S and T using the provided operations as:

R = S + T

We observe that,

  1. In case of union operation we can have a new start state, from which, null transition proceeds to the starting state of both the Finite State Machines.
  2. The final states of both the Finite Automata’s are converted to intermediate states. The final state is unified into one which can be traversed by null transitions.
R = S.T 

We observe that,

  1. In case of concatenation operation we can have the same starting state as that of S, the only change occurs in the end state of S, which is converted to an intermediate state followed by a Null Transition.
  2. The Null transition is followed by the starting state of T, the final state of T is used as the end state of R.
 R = S*

We observe that,

  1. A new starting state is added, and S has been put as an intermediate state so that self looping condition could be incorporated.
  2. Starting and Ending states have been defined separately so that the self looping condition is not disturbed.

Now that we are aware about the general operations. Let’s see how Kleene’s Theorem-I can be used to generate a FA for the given Regular Expression.

Make a Finite Automata for the expression (ab+a)* 

We see that using Kleene’s Theorem – I gives a systematic approach towards the generation of a Finite Automata for the provided Regular Expression.

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.