Reference. On incorrectness logic and Kleene algebra with top and tests
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.
Cite
Cited by (5)
Outrunning Big KATs: Efficient Decision Procedures for Variants of GKAT zhang-2026-outrunning
Kleene Algebra kappe-2025-kleene
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.
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.
Domain Reasoning in TopKAT zhang-2024-domain
TopKAT is the algebraic theory of Kleene algebra with tests (KAT) extended with a top element. Compared to KAT, one pleasant feature of TopKAT is that, in relational models, the top element allows us to express the domain and codomain of a relation. This enables several applications in program logics, such as proving under-approximate specifications or reachability properties of imperative programs. However, while TopKAT inherits many pleasant features of KATs, such as having a decidable equational theory, it is incomplete with respect to relational models. In other words, there are properties that hold true of all relational TopKATs but cannot be proved with the axioms of TopKAT. This issue is potentially worrisome for program-logic applications, in which relational models play a key role. In this paper, we further investigate the completeness properties of TopKAT with respect to relational models. We show that TopKAT is complete with respect to (co)domain comparison of KAT terms, but incomplete when comparing the (co)domain of arbitrary TopKAT terms. Since the encoding of under-approximate specifications in TopKAT hinges on this type of formula, the aforementioned incompleteness results have a limited impact when using TopKAT to reason about such specifications.
Outcome Logic: A Unifying Foundation for Correctness and Incorrectness Reasoning zilberstein-2023-outcome
Program logics for bug-finding (such as the recently introduced Incorrectness Logic) have framed correctness and incorrectness as dual concepts requiring different logical foundations. In this paper, we argue that a single unified theory can be used for both correctness and incorrectness reasoning. We present Outcome Logic (OL), a novel generalization of Hoare Logic that is both monadic (to capture computational effects) and monoidal (to reason about outcomes and reachability). OL expresses true positive bugs, while retaining correctness reasoning abilities as well. To formalize the applicability of OL to both correctness and incorrectness, we prove that any false OL specification can be disproven in OL itself. We also use our framework to reason about new types of incorrectness in nondeterministic and probabilistic programs. Given these advances, we advocate for OL as a new foundational theory of correctness and incorrectness.
Cites 34 works (6 here)
With notes (6)
Probabilistic NetKAT foster-2016-probabilistic
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.
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.
A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events KOZEN1994366
We give a finitary axiomatization of the algebra of regular events involving only equations and equational implications. Unlike Salomaa′s axiomatizations, the axiomatization given here is sound for all interpretations over Kleene algebras.
External (28)
- On incorrectness logic and Kleene algebra with top and tests (2022)
- Domain Semirings United (2022)
- On Incorrectness Logic and Kleene Algebra with Top and Tests (arXiv v3) (2022)
- On Algebra of Program Correctness and Incorrectness (2021)
- On Tools for Completeness of Kleene Algebra with Hypotheses (2021)
- Incorrectness logic (2020)
- Local Reasoning About the Presence of Bugs: Incorrectness Separation Logic (2020)
- An Under-Approximate Relational Logic (2020)
- Kleene Algebra with Hypotheses (2019)
- Equational Theories of Abnormal Termination Based on Kleene Algebra (2017)
- Cantor meets Scott: semantic foundations for probabilistic networks (2017)
- Modal Kleene Algebra Applied to Program Correctness (2016)
- Automata for relation algebra and formal proofs (2016)
- Kleene Algebra with Converse (2014)
- Kleene Algebra with Tests and Coq Tools for while Programs (2013)
- Axiomatizability of positive algebras of binary relations (2011)
- Reverse Hoare Logic (2011)
- Kleene algebra with domain (2006)
- Modal Kleene algebra and applications - a survey (2004)
- On Hoare logic and Kleene algebra with tests (2000)
- Kleene algebra with tests: Completeness and decidability (1997)
- The Complexity of Kleene Algebra with Tests (1996)
- The origin of relation algebras in the development and axiomatization of the calculus of relations (1991)
- Equational Logic as a Programming Language (1985)
- Dynamic algebras and the nature of induction (1980)
- Propositional dynamic logic of regular programs (1979)
- An axiomatic basis for computer programming (1969)
- Assigning meanings to programs (1967)