Reference. Kleene Algebra
This booklet serves as an introduction to Kleene Algebra (KA), a set of laws that can be used to study general equivalences between programs. It discusses how general programs can be modeled using regular expressions, how those expressions correspond to automata, and how this correspondence can be exploited to obtain the central result of KA, namely that an equivalence of regular expressions is true if and only if it can be proved using the laws of KA. Each chapter closes with a set of exercises to further build intuition and understanding, and there is an optional chapter that develops automata theory through the lens of coalgebra.
Cite
Cites 102 works (10 here)
With notes (10)
Kleene Algebra with Commutativity Conditions Is Undecidable azevedodeamorim-2025-kleene
We prove that the equational theory of Kleene algebra with commutativity conditions on primitives (or atomic terms) is undecidable, thereby settling a longstanding open question in the theory of Kleene algebra. While this question has also been recently solved independently by Kuznetsov, our results hold even for weaker theories that do not support the induction axioms of Kleene algebra.
On incorrectness logic and Kleene algebra with top and tests zhang-2022-on
Kleene algebra with tests (KAT) is a foundational equational framework for reasoning about programs, which has found applications in program transformations, networking and compiler optimizations, among many other areas. In his seminal work, Kozen proved that KAT subsumes propositional Hoare logic, showing that one can reason about the (partial) correctness of while programs by means of the equational theory of KAT. In this work, we investigate the support that KAT provides for reasoning about incorrectness, instead, as embodied by O’Hearn’s recently proposed incorrectness logic. We show that KAT cannot directly express incorrectness logic. The main reason for this limitation can be traced to the fact that KAT cannot express explicitly the notion of codomain, which is essential to express incorrectness triples. To address this issue, we study Kleene Algebra with Top and Tests (TopKAT), an extension of KAT with a top element. We show that TopKAT is powerful enough to express a codomain operation, to express incorrectness triples, and to prove all the rules of incorrectness logic sound. This shows that one can reason about the incorrectness of while-like programs by means of the equational theory of TopKAT.
Guarded Kleene algebra with tests: verification of uninterpreted programs in nearly linear time smolka-2019-guarded
Guarded Kleene Algebra with Tests (GKAT) is a variation on Kleene Algebra with Tests (KAT) that arises by restricting the union (+) and iteration (*) operations from KAT to predicate-guarded versions. We develop the (co)algebraic theory of GKAT and show how it can be efficiently used to reason about imperative programs. In contrast to KAT, whose equational theory is PSPACE-complete, we show that the equational theory of GKAT is (almost) linear time. We also provide a full Kleene theorem and prove completeness for an analogue of Salomaa’s axiomatization of Kleene Algebra.
NetKAT: Semantic foundations for networks anderson2014netkat
Recent years have seen growing interest in high-level languages for programming networks. But the design of these languages has been largely ad hoc, driven more by the needs of applications and the capabilities of network hardware than by foundational principles. The lack of a semantic foundation has left language designers with little guidance in determining how to incorporate new features, and programmers without a means to reason precisely about their code. This paper presents NetKAT, a new network programming language that is based on a solid mathematical foundation and comes equipped with a sound and complete equational theory. We describe the design of NetKAT, including primitives for filtering, modifying, and transmitting packets; union and sequential composition operators; and a Kleene star operator that iterates programs. We show that NetKAT is an instance of a canonical and well-studied mathematical structure called a Kleene algebra with tests (KAT) and prove that its equational theory is sound and complete with respect to its denotational semantics. Finally, we present practical applications of the equational theory including syntactic techniques for checking reachability, proving non-interference properties that ensure isolation between programs, and establishing the correctness of compilation algorithms.
Regular-expression derivatives re-examined owensRegularexpressionDerivativesReexamined2009
Abstract Regular-expression derivatives are an old, but elegant, technique for compiling regular expressions to deterministic finite-state machines. It easily supports extending the regular-expression operators with boolean operations, such as intersection and complement. Unfortunately, this technique has been lost in the sands of time and few computer scientists are aware of it. In this paper, we reexamine regular-expression derivatives and report on our experiences in the context of two different functional-language implementations. The basic implementation is simple and we show how to extend it to handle large character sets (e.g., Unicode). We also show that the derivatives approach leads to smaller state machines than the traditional algorithm given by McNaughton and Yamada.
Kleene algebra with tests and program schematology angus2001kleene
The theory of flowchart schemes has a rich history going back to Ianov (1960); see Manna (1974) for an elementary exposition. A central question in the theory of program schemes is scheme equivalence. Manna presents several examples of equivalence proofs that work by simplifying the schemes using various combinatorial transformation rules. In this paper we present a purely algebraic approach to this problem using Kleene algebra with tests (KAT). Instead of transforming schemes directly using combinatorial graph manipulation, we regard them as a certain kind of automaton on abstract traces. We prove a generalization of Kleene’s theorem and use it to construct equivalent expressions in the language of KAT. We can then give a purely equational proof of the equivalence of the resulting expressions. We prove soundness of the method and give a detailed example of its use.
Certification of Compiler Optimizations Using Kleene Algebra with Tests kozen2000certification
Kleene algebra with tests kozen1997kleene
We introduce Kleene algebra with tests, an equational system for manipulating programs. We give a purely equational proof, using Kleene algebra with tests and commutativity conditions, of the following classical result: every while program can be simulated by a while program with at most one while loop. The proof illustrates the use of Kleene algebra with tests and commutativity conditions in program equivalence proofs.
Programming Techniques: Regular expression search algorithm thompsonProgrammingTechniquesRegular1968
A method for locating specific character strings embedded in character text is described and an implementation of this method in the form of a compiler is discussed. The compiler accepts a regular expression as source language and produces an IBM 7094 program as object language. The object program then accepts the text to be searched as input and produces a signal every time an embedded string in the text matches the given regular expression. Examples, problems, and solutions are also presented.
Derivatives of Regular Expressions brzozowskiDerivativesRegularExpressions1964
Kleene’s regular expressions, which can be used for describing sequential circuits, were defined using three operators (union, concatenation and iterate) on sets of sequences. Word descriptions of problems can be more easily put in the regular expression language if the language is enriched by the inclusion of other logical operations. However, in the problem of converting the regular expression description to a state diagram, the existing methods either cannot handle expressions with additional operators, or are made quite complicated by the presence of such operators.In this paper the notion of a derivative of a regular expression is introduced and the properties of derivatives are discussed. This leads, in a very natural way, to the construction of a state diagram from a regular expression containing any number of logical operators.
External (92)
- A General Completeness Theorem for Skip-Free Star Algebras (2025)
- On Propositional Program Equivalence (Extended Abstract) (2025)
- On Tools for Completeness of Kleene Algebra with Hypotheses (2024)
- Completeness Theorems for Kleene algebra with tests and top (2024)
- Myhill-Nerode Theorem for Higher-Dimensional Automata (2024)
- Kleene Theorem for Higher-Dimensional Automata (2024)
- A Complete Inference System for Skip-free Guarded Kleene Algebra with Tests (2023)
- Kleene Algebra with Dynamic Tests: Completeness and Complexity (2023)
- On the Complexity of Reasoning in Kleene Algebra with Commutativity Conditions (2023)
- Probabilistic Guarded KAT Modulo Bisimilarity: Completeness and Complexity (2023)
- Completeness Theorems for Kleene Algebra with Top (2022)
- Extensions of (Concurrent) Kleene Algebra (2022)
- Milner's Proof System for Regular Expressions Modulo Bisimilarity is Complete: Crystallization: Near-Collapsing Process Graph Interpretations of Regular Expressions (2022)
- Concurrent NetKAT - Modeling and analyzing stateful, concurrent networks (2022)
- DyNetKAT: An Algebra of Dynamic Networks (2022)
- Guarded Kleene Algebra with Tests: Coequations, Coinduction, and Completeness (2021)
- Trimming the Hedges: An Algebra to Tame Concurrency (2021)
- Concurrent Kleene Algebra with Observations: From Hypotheses to Completeness (2020)
- Concurrent Kleene Algebra: Completeness and Decidability (2020)
- Left-handed completeness (2020)
- A Complete Proof System for 1-Free Regular Expressions Modulo Bisimilarity (2020)
- Partially Observable Concurrent Kleene Algebra (2020)
- Completeness and Incompleteness of Synchronous Kleene Algebra (2019)
- Kleene Algebra with Hypotheses (2019)
- Kleene Algebra with Observations (2019)
- A note on commutative Kleene algebra (2019)
- Left-Handed Completeness for Kleene algebra, via Cyclic Proofs (2018)
- Concurrent Kleene Algebra: Free Model and Completeness (2017)
- Completeness Theorems for Pomset Languages and Concurrent Kleene Algebras (2017)
- On the Coalgebraic Theory of Kleene Algebra with Tests (2017)
- Equational Theories of Abnormal Termination Based on Kleene Algebra (2017)
- Introduction to Coalgebra: Towards Mathematics of States and Observation (2016)
- A Coalgebraic Decision Procedure for NetKAT (2015)
- Kleene Algebra with Equations (2014)
- KAT + B! (2014)
- Completeness Theorems for Bi-Kleene Algebras and Series-Parallel Rational Pomset Languages (2014)
- Checking NFA equivalence with bisimulations up to congruence (2013)
- Kleene Algebra with Tests and Coq Tools for while Programs (2013)
- Probabilistic Concurrent Kleene Algebra (2013)
- An Event Structure Model for Probabilistic Concurrent Kleene Algebra (2013)
- On Probabilistic Kleene Algebras, Automata and Simulations (2011)
- Concurrent Kleene Algebra and its Foundations (2011)
- An Efficient Coq Tactic for Deciding Kleene Algebras (2010)
- Synchronous Kleene algebra (2010)
- Foundations of Concurrent Kleene Algebra (2009)
- Nonlocal Flow of Control and Kleene Algebra with Tests (2008)
- Using probabilistic Kleene algebra pKA for protocol verification (2008)
- A Kleene Algebra Framework for Data Flow Analysis (2007)
- A Bialgebraic Review of Deterministic Automata, Regular Expressions and Languages (2006)
- Kleene algebra with domain (2006)
- Kleene Algebra and Bytecode Verification (2005)
- On Finite Model Property of the Equational Theory of Kleene Algebras (2005)
- Modularizing the Elimination of r=0 in Kleene Algebra (2005)
- The Horn theory of relational Kleene algebra (2005)
- Towards Automated Proof Support for Probabilistic Distributed Systems (2005)
- Modal Kleene algebra and applications - a survey (2004)
- Modal Kleene Algebra and Partial Correctness (2004)
- Behavioural differential equations: a coinductive calculus of streams, automata, and power series (2003)
- Automata on Guarded Strings and Applications (2003)
- On the Complexity of Reasoning in Kleene Algebra (2002)
- Myhill-Nerode Relations on Automatic Systems and the Completeness of Kleene Algebra (2001)
- Universal coalgebra: a theory of systems (2000)
- On Hoare logic and Kleene algebra with tests (2000)
- Automata and Computability (1997)
- Partial Derivatives of Regular Expressions and Finite Automaton Constructions (1996)
- Kleene algebra with tests and commutativity conditions (1996)
- Kleene Algebra with Tests: Completeness and Decidability (1996)
- Hypotheses in Kleene Algebra (1994)
- A taxonomy of finite automata construction algorithms (1993)
- A completeness theorem for Kleene algebras and the algebra of regular events (1991)
- Modeling Concurrency with Geometry (1991)
- A Complete System of B-Rational Identities (1990)
- Une remarque sur les systèmes complets d'identités rationnelles (1990)
- Laws of Programming (1987)
- From Regular Expressions to Deterministic Automata (1986)
- A Complete Inference System for a Class of Regular Behaviours (1984)
- A Course in Universal Algebra (1981)
- Dynamic Algebras and the Nature of Induction (1980)
- Propositional Dynamic Logic of Regular Programs (1979)
- Semantical Considerations on Floyd-Hoare Logic (1976)
- A Linear Algorithm for Testing Equivalence of Finite Automata (1971)
- Regular Algebra and Finite Machines (1971)
- The Algebra of Operators for Regular Events (1970)
- Regular expressions and the equivalence of programs (1969)
- An Axiomatic Basis for Computer Programming (1969)
- Assigning Meanings to Programs (1967)
- Two Complete Axiom Systems for the Algebra of Regular Events (1966)
- The abstract theory of automata (1961)
- Regular Expressions and State Graphs for Automata (1960)
- Representation of Events in Nerve Nets and Finite Automata (1956)
- The Method of Coalgebra: exercises in coinduction
- An Elementary Proof of the FMP for Kleene Algebra