The Wayback Machine - https://web.archive.org/web/20240607080336/https://www.geeksforgeeks.org/kleenes-theorem-in-toc-part-1/
Open In App

Kleene’s Theorem in TOC | Part-1

Last Updated : 04 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

A language is said to be regular if it can be represented by using 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 Finite Automata generation, which Kleene has put forward in Kleene’s Theorem.

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

Regular Expression

Regular Expression

To understand Kleene’s Theorem-I, Let’s take into 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$       )*

Observations From Kleene Theorem

We can further use this definition in association with Null Transitions to give rise to a FA by the combination of two or 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:

Union Operation

R = S + T


Union Operation

Union Operation


Observations:

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

Concatenation Operation

R = S.T 


Concatenation Operation

Concatenation Operation


Observations:

  • In the case of a 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.
  • The Null transition is followed by the starting state of T, and the final state of T is used as the end state of R.

Exponential Operation

 R = S*


Exponential Operation

Exponential Operation


Observations:

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

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

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


Kleene Algorithm

Kleene Algorithm

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

FAQs on Kleene’s Theorem

Q. 1: Does Kleene Theoram only restricted to Turing Machine?

Answer:

Kleene Theoram is primarily for Turing Machines only, but some similar self reference concepts can be formed in other machine models also.

Q. 2: Is it possible to implement Kleene Theoram practically?

Answer:

Kleene Theoram is basically a theoretical concept that does not have any direct practical applications. Computer Scientists understand the boundations, limitations with respect to this algorithm.

Q. 3: Is there any relation between Kleene Theoram and Halting Algorithm?

Answer:

Kleene Theoram and Halting Problem are closely related to each other as these both concepts involve self-reference and highlight the algorithmic solution limitation.




Previous Article
Next Article

Similar Reads

Basic Theorems in TOC (Myhill nerode theorem)
The Myhill Nerode theorem is a fundamental result coming down to the theory of languages. This theory was proven by John Myhill and Anil Nerode in 1958. It is used to prove whether or not a language L is regular and it is also used for minimization of states in DFA( Deterministic Finite Automata). To understand this theorem, first we need to unders
3 min read
Four Color Theorem and Kuratowski’s Theorem in Discrete Mathematics
Planar Graph :If a graph can be drawn on the plane without crossing, it is said to be planar.Coloring of a simple graph is the assignment of color to each vertex of the graph so that no two adjacent vertices are assigned the same color. Bi-Partite Graphs : A bipartite graph, also known as a bi-graph, is a set of graph vertices that has been dissect
6 min read
Computable and non-computable problems in TOC
Computable Problems - You are familiar with many problems (or functions) that are computable (or decidable), meaning there exists some algorithm that computes an answer (or output) to any instance of the problem (or for any input to the function) in a finite number of simple steps. A simple example is the integer increment operation: f(x) = x + 1 I
6 min read
Determining Countability in TOC
Countable Set is a set having cardinality same as that of some subset of N the set of natural numbers . A countable set is the one which is listable. Cardinality of a countable set can be a finite number. For example, B: {1, 5, 4}, |B| = 3, in this case its termed countably finite or the cardinality of countable set can be infinite. For example, A:
3 min read
Decidability, Semi-Decidability, and Undecidability in TOC
We know about Decidable, Semi-decidable, and Undecidable problems and in this article, we will briefly define these problems and provide the most commonly asked questions on these problems and classify them accordingly. Prerequisite - https://www.geeksforgeeks.org/decidable-and-undecidable-problems-in-theory-of-computation/ Introduction :Identifyin
3 min read
Closure properties Table in TOC
The Below Table shows the Closure Properties of Formal Languages : REG = Regular LanguageDCFL = deterministic context-free languages, CFL = context-free languages,CSL = context-sensitive languages,RC = Recursive.RE = Recursive Enumerable Consider L and M are regular languages : The Kleene star - ∑*, is a unary operator on a set of symbols or string
3 min read
Undecidability and Reducibility in TOC
Decidable Problems A problem is decidable if we can construct a Turing machine which will halt in finite amount of time for every input and give answer as ‘yes’ or ‘no’. A decidable problem has an algorithm to determine the answer for a given input. Examples Equivalence of two regular languages: Given two regular languages, there is an algorithm an
5 min read
Mealy and Moore Machines in TOC
Moore and Mealy Machines are Transducers that help in producing outputs based on the input of the current state or previous state. In this article we are going to discuss Moore Machines and Mealy Machines, the difference between these two machines as well as Conversion from Moore to Mealy and Conversion from Mealy to Moore Machines. Moore Machines
2 min read
Advanced master theorem for divide and conquer recurrences
The Master Theorem is a tool used to solve recurrence relations that arise in the analysis of divide-and-conquer algorithms. The Master Theorem provides a systematic way of solving recurrence relations of the form: T(n) = aT(n/b) + f(n) where a, b, and f(n) are positive functions and n is the size of the problem. The Master Theorem provides conditi
5 min read
Consensus Theorem in Digital Logic
Prerequisite - Properties of Boolean algebra, Minimization of Boolean Functions Redundancy theorem is used as a Boolean algebra trick in Digital Electronics. It is also known as Consensus Theorem: AB + A'C + BC = AB + A'C The consensus or resolvent of the terms AB and A'C is BC. It is the conjunction of all the unique literals of the terms, excludi
3 min read
Article Tags :