HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
theoretical computer science Theoretical computer science is a subfield of computer science and mathematics that focuses on the Abstraction, abstract and mathematical foundations of computation. It is difficult to circumscribe the theoretical areas precisely. The Associati ...
, a Kleene algebra ( ; named after
Stephen Cole Kleene Stephen Cole Kleene ( ; January 5, 1909 – January 25, 1994) was an American mathematician. One of the students of Alonzo Church, Kleene, along with Rózsa Péter, Alan Turing, Emil Post, and others, is best known as a founder of the branch of ...
) is a
semiring In abstract algebra, a semiring is an algebraic structure. Semirings are a generalization of rings, dropping the requirement that each element must have an additive inverse. At the same time, semirings are a generalization of bounded distribu ...
that generalizes the theory of
regular expression A regular expression (shortened as regex or regexp), sometimes referred to as rational expression, is a sequence of characters that specifies a match pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s: it consists of a
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
supporting union (addition), concatenation (multiplication), and
Kleene star In mathematical logic and theoretical computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation on a Set (mathematics), set to generate a set of all finite-length strings that are composed of zero or more repe ...
operations subject to certain algebraic laws. The addition is required to be idempotent (x + x = x for all x), and induces a
partial order In mathematics, especially order theory, a partial order on a set is an arrangement such that, for certain pairs of elements, one precedes the other. The word ''partial'' is used to indicate that not every pair of elements needs to be comparable ...
defined by x \le y if x + y = y. The Kleene star operation, denoted x*, must satisfy the laws of the
closure operator In mathematics, a closure operator on a Set (mathematics), set ''S'' is a Function (mathematics), function \operatorname: \mathcal(S)\rightarrow \mathcal(S) from the power set of ''S'' to itself that satisfies the following conditions for all sets ...
. Kleene algebras have their origins in the theory of regular expressions and
regular language In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science (as opposed to ...
s introduced by Kleene in 1951 and studied by others including V.N. Redko and
John Horton Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician. He was active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many b ...
. The term was introduced by Dexter Kozen in the 1980s, who fully characterized their algebraic properties and, in 1994, gave a finite axiomatization. Kleene algebras have a number of extensions that have been studied, including Kleene algebras with tests (KAT) introduced by Kozen in 1997. Kleene algebras and Kleene algebras with tests have applications in
formal verification In the context of hardware and software systems, formal verification is the act of proving or disproving the correctness of a system with respect to a certain formal specification or property, using formal methods of mathematics. Formal ver ...
of computer programs. They have also been applied to specify and verify
computer network A computer network is a collection of communicating computers and other devices, such as printers and smart phones. In order to communicate, the computers and devices must be connected by wired media like copper cables, optical fibers, or b ...
s.


Definition

Various inequivalent definitions of Kleene algebras and related structures have been given in the literature. Here we will give the definition that seems to be the most common nowadays. A Kleene algebra is a
set Set, The Set, SET or SETS may refer to: Science, technology, and mathematics Mathematics *Set (mathematics), a collection of elements *Category of sets, the category whose objects and morphisms are sets and total functions, respectively Electro ...
''A'' together with two
binary operation In mathematics, a binary operation or dyadic operation is a rule for combining two elements (called operands) to produce another element. More formally, a binary operation is an operation of arity two. More specifically, a binary operation ...
s + : ''A'' × ''A'' → ''A'' and · : ''A'' × ''A'' → ''A'' and one unary function * : ''A'' → ''A'', written as ''a'' + ''b'', ''ab'' and ''a''* respectively, so that the following axioms are satisfied. *
Associativity In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a Validity (logic), valid rule of replaceme ...
of + and ·: ''a'' + (''b'' + ''c'') = (''a'' + ''b'') + ''c'' and ''a''(''bc'') = (''ab'')''c'' for all ''a'', ''b'', ''c'' in ''A''. *
Commutativity In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Perhaps most familiar as a p ...
of +: ''a'' + ''b'' = ''b'' + ''a'' for all ''a'', ''b'' in ''A'' *
Distributivity In mathematics, the distributive property of binary operations is a generalization of the distributive law, which asserts that the equality x \cdot (y + z) = x \cdot y + x \cdot z is always true in elementary algebra. For example, in elementary ...
: ''a''(''b'' + ''c'') = (''ab'') + (''ac'') and (''b'' + ''c'')''a'' = (''ba'') + (''ca'') for all ''a'', ''b'', ''c'' in ''A'' *
Identity element In mathematics, an identity element or neutral element of a binary operation is an element that leaves unchanged every element when the operation is applied. For example, 0 is an identity element of the addition of real numbers. This concept is use ...
s for + and ·: There exists an element 0 in ''A'' such that for all ''a'' in ''A'': ''a'' + 0 = 0 + ''a'' = ''a''. There exists an element 1 in ''A'' such that for all ''a'' in ''A'': ''a''1 = 1''a'' = ''a''. *
Annihilation In particle physics, annihilation is the process that occurs when a subatomic particle collides with its respective antiparticle to produce other particles, such as an electron colliding with a positron to produce two photons. The total energy a ...
by 0: ''a''0 = 0''a'' = 0 for all ''a'' in ''A''. The above axioms define a
semiring In abstract algebra, a semiring is an algebraic structure. Semirings are a generalization of rings, dropping the requirement that each element must have an additive inverse. At the same time, semirings are a generalization of bounded distribu ...
. We further require: * + is
idempotent Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
: ''a'' + ''a'' = ''a'' for all ''a'' in ''A''. It is now possible to define a
partial order In mathematics, especially order theory, a partial order on a set is an arrangement such that, for certain pairs of elements, one precedes the other. The word ''partial'' is used to indicate that not every pair of elements needs to be comparable ...
≤ on ''A'' by setting ''a'' ≤ ''b''
if and only if In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
''a'' + ''b'' = ''b'' (or equivalently: ''a'' ≤ ''b'' if and only if there exists an ''x'' in ''A'' such that ''a'' + ''x'' = ''b''; with any definition, ''a'' ≤ ''b'' ≤ ''a'' implies ''a'' = ''b''). With this order we can formulate the last four axioms about the operation *: * 1 + ''a''(''a''*) ≤ ''a''* for all ''a'' in ''A''. * 1 + (''a''*)''a'' ≤ ''a''* for all ''a'' in ''A''. * if ''a'' and ''x'' are in ''A'' such that ''ax'' ≤ ''x'', then ''a''*''x'' ≤ ''x'' * if ''a'' and ''x'' are in ''A'' such that ''xa'' ≤ ''x'', then ''x''(''a''*) ≤ ''x'' Intuitively, one should think of ''a'' + ''b'' as the "union" or the "least upper bound" of ''a'' and ''b'' and of ''ab'' as some multiplication which is
monotonic In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of ord ...
, in the sense that ''a'' ≤ ''b'' implies ''ax'' ≤ ''bx''. The idea behind the star operator is ''a''* = 1 + ''a'' + ''aa'' + ''aaa'' + ... From the standpoint of
programming language theory Programming language theory (PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of formal languages known as programming languages. Programming language theory is clos ...
, one may also interpret + as "choice", · as "sequencing" and * as "iteration".


Examples

Let Σ be a finite set (an "alphabet") and let ''A'' be the set of all
regular expression A regular expression (shortened as regex or regexp), sometimes referred to as rational expression, is a sequence of characters that specifies a match pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s over Σ. We consider two such regular expressions equal if they describe the same
language Language is a structured system of communication that consists of grammar and vocabulary. It is the primary means by which humans convey meaning, both in spoken and signed language, signed forms, and may also be conveyed through writing syste ...
. Then ''A'' forms a Kleene algebra. In fact, this is a free Kleene algebra in the sense that any equation among regular expressions follows from the Kleene algebra axioms and is therefore valid in every Kleene algebra. Again let Σ be an alphabet. Let ''A'' be the set of all
regular language In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science (as opposed to ...
s over Σ (or the set of all
context-free language In formal language theory, a context-free language (CFL), also called a Chomsky type-2 language, is a language generated by a context-free grammar (CFG). Context-free languages have many applications in programming languages, in particular, mos ...
s over Σ; or the set of all
recursive language In mathematics, logic and computer science, a recursive (or ''decidable'') language is a recursive subset of the Kleene closure of an alphabet. Equivalently, a formal language is recursive if there exists a Turing machine that decides the forma ...
s over Σ; or the set of ''all'' languages over Σ). Then the union (written as +) and the
concatenation In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalizations of concatenati ...
(written as ·) of two elements of ''A'' again belong to ''A'', and so does the
Kleene star In mathematical logic and theoretical computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation on a Set (mathematics), set to generate a set of all finite-length strings that are composed of zero or more repe ...
operation applied to any element of ''A''. We obtain a Kleene algebra ''A'' with 0 being the
empty set In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
and 1 being the set that only contains the
empty string In formal language theory, the empty string, or empty word, is the unique String (computer science), string of length zero. Formal theory Formally, a string is a finite, ordered sequence of character (symbol), characters such as letters, digits ...
. Let ''M'' be a
monoid In abstract algebra, a monoid is a set equipped with an associative binary operation and an identity element. For example, the nonnegative integers with addition form a monoid, the identity element being . Monoids are semigroups with identity ...
with identity element ''e'' and let ''A'' be the set of all
subset In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
s of ''M''. For two such subsets ''S'' and ''T'', let ''S'' + ''T'' be the union of ''S'' and ''T'' and set ''ST'' = . ''S''* is defined as the submonoid of ''M'' generated by ''S'', which can be described as ∪ ''S'' ∪ ''SS'' ∪ ''SSS'' ∪ ... Then ''A'' forms a Kleene algebra with 0 being the empty set and 1 being . An analogous construction can be performed for any small
category Category, plural categories, may refer to: General uses *Classification, the general act of allocating things to classes/categories Philosophy * Category of being * ''Categories'' (Aristotle) * Category (Kant) * Categories (Peirce) * Category ( ...
. The
linear subspace In mathematics, the term ''linear'' is used in two distinct senses for two different properties: * linearity of a ''function (mathematics), function'' (or ''mapping (mathematics), mapping''); * linearity of a ''polynomial''. An example of a li ...
s of a unital
algebra over a field In mathematics, an algebra over a field (often simply called an algebra) is a vector space equipped with a bilinear map, bilinear product (mathematics), product. Thus, an algebra is an algebraic structure consisting of a set (mathematics), set to ...
form a Kleene algebra. Given linear subspaces ''V'' and ''W'', define ''V'' + ''W'' to be the sum of the two subspaces, and 0 to be the trivial subspace . Define , the
linear span In mathematics, the linear span (also called the linear hull or just span) of a set S of elements of a vector space V is the smallest linear subspace of V that contains S. It is the set of all finite linear combinations of the elements of , and ...
of the product of vectors from ''V'' and ''W'' respectively. Define , the span of the unit of the algebra. The closure of ''V'' is the
direct sum The direct sum is an operation between structures in abstract algebra, a branch of mathematics. It is defined differently but analogously for different kinds of structures. As an example, the direct sum of two abelian groups A and B is anothe ...
of all powers of ''V''. V^ = \bigoplus_^ V^ Suppose ''M'' is a set and ''A'' is the set of all
binary relation In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
s on ''M''. Taking + to be the union, · to be the composition and * to be the
reflexive transitive closure In mathematics, a subset of a given set is closed under an operation on the larger set if performing that operation on members of the subset always produces a member of that subset. For example, the natural numbers are closed under addition, but ...
, we obtain a Kleene algebra. Every
Boolean algebra In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
with operations \lor and \land turns into a Kleene algebra if we use \lor for +, \land for · and set ''a''* = 1 for all ''a''. A quite different Kleene algebra can be used to implement the Floyd–Warshall algorithm, computing the shortest path's length for every two vertices of a weighted directed graph, by
Kleene's algorithm In theoretical computer science, in particular in formal language theory, Kleene's algorithm transforms a given nondeterministic finite automaton (NFA) into a regular expression. Together with other conversion algorithms, it establishes the equival ...
, computing a regular expression for every two states of a
deterministic finite automaton In the theory of computation, a branch of theoretical computer science, a deterministic finite automaton (DFA)—also known as deterministic finite acceptor (DFA), deterministic finite-state machine (DFSM), or deterministic finite-state auto ...
. Using the
extended real number line In mathematics, the extended real number system is obtained from the real number system \R by adding two elements denoted +\infty and -\infty that are respectively greater and lower than every real number. This allows for treating the potential ...
, take ''a'' + ''b'' to be the minimum of ''a'' and ''b'' and ''ab'' to be the ordinary sum of ''a'' and ''b'' (with the sum of +∞ and −∞ being defined as +∞). ''a''* is defined to be the real number zero for nonnegative ''a'' and −∞ for negative ''a''. This is a Kleene algebra with zero element +∞ and one element the real number zero. A weighted directed graph can then be considered as a deterministic finite automaton, with each transition labelled by its weight. For any two graph nodes (automaton states), the regular expressions computed from Kleene's algorithm evaluates, in this particular Kleene algebra, to the shortest path length between the nodes.


Properties

Zero is the smallest element: 0 ≤ ''a'' for all ''a'' in ''A''. The sum ''a'' + ''b'' is the least upper bound of ''a'' and ''b'': we have ''a'' ≤ ''a'' + ''b'' and ''b'' ≤ ''a'' + ''b'' and if ''x'' is an element of ''A'' with ''a'' ≤ ''x'' and ''b'' ≤ ''x'', then ''a'' + ''b'' ≤ ''x''. Similarly, ''a''1 + ... + ''a''''n'' is the least upper bound of the elements ''a''1, ..., ''a''''n''. Multiplication and addition are monotonic: if ''a'' ≤ ''b'', then * ''a'' + ''x'' ≤ ''b'' + ''x'', * ''ax'' ≤ ''bx'', and * ''xa'' ≤ ''xb'' for all ''x'' in ''A''. Regarding the star operation, we have * 0* = 1 and 1* = 1, * ''a'' ≤ ''b'' implies ''a''* ≤ ''b''* (monotonicity), * ''a''''n'' ≤ ''a''* for every
natural number In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
''n'', where ''a''''n'' is defined as ''n''-fold multiplication of ''a'', * (''a''*)(''a''*) = ''a''*, * (''a''*)* = ''a''*, * 1 + ''a''(''a''*) = ''a''* = 1 + (''a''*)''a'', * ''ax'' = ''xb'' implies (''a''*)''x'' = ''x''(''b''*), * ((''ab'')*)''a'' = ''a''((''ba'')*), * (''a''+''b'')* = ''a''*(''b''(''a''*))*, and * ''pq'' = 1 = ''qp'' implies ''q''(''a''*)''p'' = (''qap'')*. If ''A'' is a Kleene algebra and ''n'' is a natural number, then one can consider the set M''n''(''A'') consisting of all ''n''-by-''n''
matrices Matrix (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the ...
with entries in ''A''. Using the ordinary notions of matrix addition and multiplication, one can define a unique *-operation so that M''n''(''A'') becomes a Kleene algebra.


History

Kleene introduced regular expressions and gave some of their algebraic laws. Although he didn't define Kleene algebras, he asked for a decision procedure for equivalence of regular expressions. Redko proved that no finite set of ''equational'' axioms can characterize the algebra of regular languages. Salomaa gave complete axiomatizations of this algebra, however depending on problematic inference rules. The problem of providing a complete set of axioms, which would allow derivation of all equations among regular expressions, was intensively studied by
John Horton Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician. He was active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many b ...
under the name of ''regular algebras'', however, the bulk of his treatment was infinitary. In 1981, Kozen gave a complete infinitary equational deductive system for the algebra of regular languages. In 1994, he gave the above finite axiom system, which uses unconditional and conditional equalities (considering ''a'' ≤ ''b'' as an abbreviation for ''a'' + ''b'' = ''b''), and is equationally complete for the algebra of regular languages, that is, two regular expressions ''a'' and ''b'' denote the same language only if ''a'' = ''b'' follows from the above axioms. — An earlier version appeared as:


Generalization (or relation to other structures)

Kleene algebras are a particular case of closed semirings, also called quasi-regular semirings or Lehmann semirings, which are semirings in which every element has at least one quasi-inverse satisfying the equation: ''a''* = ''aa''* + 1 = ''a''*''a'' + 1. This quasi-inverse is not necessarily unique. In a Kleene algebra, ''a''* is the least solution to the
fixpoint In mathematics, a fixed point (sometimes shortened to fixpoint), also known as an invariant point, is a value that does not change under a given transformation. Specifically, for functions, a fixed point is an element that is mapped to itself ...
equations: ''X'' = ''aX'' + 1 and ''X'' = ''Xa'' + 1. Closed semirings and Kleene algebras appear in algebraic path problems, a generalization of the shortest path problem.


See also

* Action algebra *
Algebraic structure In mathematics, an algebraic structure or algebraic system consists of a nonempty set ''A'' (called the underlying set, carrier set or domain), a collection of operations on ''A'' (typically binary operations such as addition and multiplicatio ...
*
Kleene star In mathematical logic and theoretical computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation on a Set (mathematics), set to generate a set of all finite-length strings that are composed of zero or more repe ...
*
Regular expression A regular expression (shortened as regex or regexp), sometimes referred to as rational expression, is a sequence of characters that specifies a match pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
* Star semiring * Valuation algebra


References


Further reading

* * {{cite book, author=Peter Höfner, title=Algebraic Calculi for Hybrid Systems, url=https://books.google.com/books?id=40vn5XIMAtwC, year=2009, publisher=BoD – Books on Demand, isbn=978-3-8391-2510-6, pages=10–13 The introduction of this book reviews advances in the field of Kleene algebra made in the last 20 years, which are not discussed in the article above. Algebraic structures Algebraic logic Formal languages Many-valued logic