In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation, either on sets of strings or on sets of symbols or characters. In mathematics it is more commonly known as the free monoid construction. The application of the Kleene star to a set V is written as V*. It is widely used for regular expressions, which is the context in which it was introduced by Stephen Kleene to characterise certain automata, where it means "zero or more".
The set V* can also be described as the set of finite-length strings that can be generated by concatenating arbitrary elements of V, allowing the use of the same element multiple times. If V is either the empty set ∅ or the singleton set {ε}, then V* = {ε}; if V is any other finite set, then V* is a countably infinite set.
The operators are used in rewrite rules for generative grammars.
Given a set V define
and define recursively the set
If V is a formal language, then Vi, the i-th power of the set V, is a shorthand for the concatenation of set V with itself i times. That is, Vi can be understood to be the set of all strings that can be represented as the concatenation of i strings in V.
The definition of Kleene star on V is
In some formal language studies, (e.g. AFL Theory) a variation on the Kleene star operation called the Kleene plus is used. The Kleene plus omits the V0 term in the above union. In other words, the Kleene plus on V is