Kleene Closure (*) in Automata Theory



Automata Theory deals with the design and analysis of algorithms for processing and recognizing patterns. It involves the study of abstract machines (automata) and the problems they can solve.

In this chapter, we will focus on two fundamental concepts in Automata Theory - Kleene Closure and Positive Closure which is Kleene plus, which are essential in understanding the behavior of regular languages.

Kleene Closure in Automata

Kleene Closure (*), or star closure gives an infinite set of possible strings of any possible length, including null string or epsilon (ε), over input values of sigma (Σ). It is also known as Kleene Star and denoted by Σ*.

The following is a mathematical notation of Kleene Closure

$$\mathrm{\Sigma^{*} \:=\: \Sigma 0 \:\cup\: \Sigma 1 \:\cup\: \Sigma 2 \:\cup \: \dotso}$$

Where Σ0 represents epsilon (ε) and gives an infinite language.

Example

Let us see this through an example. Consider the Σ input value is (01). If we apply the Kleene Closure (∗) over Σ, it will give the following result −

$$\mathrm{\{01\}^{*} \:=\: (0\: \cup\: 1)^{*} \: =\: \{\epsilon,\:01,\:11,\:00,\:010,\:110,\:\:\dotso\:n\},\: \text{ where n is infinity}}$$

Here in the result (01)* will give all possible combinations of "0" and "1" of any length including epsilon (ε). So, we can say Kleene Closure always gives an infinite language.

Properties of Kleene Closure

The following list highlights some properties of Kleene Closure −

  • Empty Set
  • Single Character
  • Set of Characters
  • Single String
  • Set of Strings
  • Special Case

Empty Set

Applying Kleene Closure to the empty set

Expression

$$\mathrm{\emptyset^{*} \:=\: \{\epsilon\}}$$

Single Character

Applying Kleene Closure to a single character

Expression

$$\mathrm{\{a\}^{*} \:=\: \{\epsilon,\: a,\: aa,\: aaa,\: aaaa,\: \:\dotso\}}$$

Set of Characters

Applying Kleene Closure to a set of characters

Expression

$$\mathrm{\{x, y, z\}^{*} \:=\: \{\epsilon,\: x,\: y,\: z,\: xx,\: xy,\: xz,\: yx,\: yy,\: yz,\: zx,\: zy,\: zz,\: xxx,\: xxy,\:\:\dotso\}}$$

Single String

Applying Kleene Closure to a single string

Expression

$$\mathrm{\{ab\}^{*} \:=\: \{\epsilon,\: ab,\: abab,\: ababab,\: \:\dotso\:n\}}$$

Set of Strings

Applying Kleene Closure to a set of strings

Expression

$$\mathrm{\{010\}* \:=\: \{\epsilon,\: 01,\: 0,\: 0101,\: 010,\: 001,\: 00,\: 010101,\: 01010,\: 01001,\: 0100,\: 00101,\: 0010,\: 0001,\: 000,\: \dotso\}}$$

Special Case

Applying Kleene Closure to a special case

Expression

$$\mathrm{\{a∗bc∗\} \:=\: \{a∗ + b + c∗\} \:=\: \{b, ab, aab, c, …n\}}$$

Positive Closure in Automata

Positive Closure is similar to Kleene Closure except it excludes epsilon (ε). It also gives an infinite set of all possible strings of any length excluding epsilon (ε) over input values of sigma (Σ) The following is the mathematical notation of Positive Closure:

$$\mathrm{\Sigma^{+} \:=\: \Sigma^{*} \:-\: \{\epsilon\}}$$

Example

Consider the Σ input value is (01). After applying positive closure (+) over Σ input gives the following result −

$$\mathrm{\{01\}^{+}\:=\:(0\:\cup\:1)^{+}\:=\:\{01,\:11,\:00,\:010,\:110,\:\dotso\:n\},\:\text{ where n is infinity}}$$

The result (01)+ will give all possible combinations of "0" and "1" of any length excluding epsilon (ε). So, we can say Positive Closure always gives an infinite language.

Properties of Plus Closure

The following list highlights a couple of properties of Plus Closure

  • Empty Set
  • Single Character

Empty Set

Applying Positive Closure to the empty set results in an empty set

Expression

$$\mathrm{\emptyset^{+} \:=\: \{\}}$$

Single Character

Applying Kleene Closure to a single character

Expression

$$\mathrm{\{a\}^{+} \:=\: \{a,\: aa,\: aaa,\: aaaa,\: \dotso\}}$$

Difference between Σ* and Σ+

The Σ* contains the epsilon (ε) string along with other N strings, but Σ+ is just like Σ* but does not hold the epsilon (ε) string. We can say −

$$\mathrm{\Sigma^{**} \:=\: \Sigma^{++} \: \Sigma^{0}}$$

Where Σ0 represents epsilon (ε). So, Σ* holds the identity (single) element called Absalon, but Σ+ does not have the identity element called epsilon (ε).

Conclusion

In this chapter, we explained the concept of Kleene Closure and in context, the concept of Kleene Star or Positive Closure as well. These concepts form the foundation for defining regular languages and designing finite automata.

Kleene Closure and Positive Closure help in generating all possible strings from a given set of characters, which is essential in various computational processes, including pattern matching and language recognition.

Advertisements