Reference. Guarded Kleene algebra with tests: verification of uninterpreted programs in nearly linear time
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.
Cite
Cited by (7)
Weighted NetKAT: A Programming Language for Quantitative Network Verification suarezacevedo-2026-weighted
We introduce weighted NetKAT, a domain-specific language for modeling and verifying quantitative quantitative network properties. The language is parametric on a semiring , enabling the treatment of a wide range of quantities in a uniform way. We provide a denotational semantics and an equivalent operational semantics, the latter based on a novel model of weighted NetKAT automata ( WNKA ) capturing the stateful behavior of our language. With WNKA , we obtain a class of generic decision procedures for reasoning about quantitative safety and reachability in a fully automatic way, even in the presence of possibly unbounded iteration. We demonstrate the applicability of our framework in a case study using Internet2’s Abilene network as the underlying topology.
A Diagrammatic Axiomatisation of Behavioural Distance of Nondeterministic Processes rozowski-2026-a
Behavioural distances provide a quantitative approach to comparing the states of transition systems, moving beyond traditional Boolean notions of equivalence. In this paper, we develop a sound and complete axiomatisation of behavioural distance for nondeterministic processes using Milner’s charts, a model that generalises finite-state automata by incorporating variable outputs. Charts provide a compelling setting for studying behavioural distances because they shift the focus from language equivalence to bisimilarity. Their axiomatic study lays the groundwork for quantitative analysis of more expressive models, such as weighted transition systems. To formalise this approach, we adopt string diagrams as our syntax of choice. String diagrams closely mirror the graphical structure of charts, while providing a rigorous formalism that supports inductive reasoning and compositional semantics. Unlike traditional algebraic syntaxes, which require additional mechanisms such as binders and substitution, string diagrams offer a variable-free representation where recursion naturally decomposes into simpler components. This makes them well-suited for reasoning about behavioural distances and aligns with broader efforts to axiomatise automata-theoretic equivalences through a unified diagrammatic framework.
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.
CF-GKAT: Efficient Validation of Control-Flow Transformations zhang-2025-cf
Guarded Kleene Algebra with Tests (GKAT) provides a sound and complete framework to reason about trace equivalence between simple imperative programs. However, there are still several notable limitations. First, GKAT is completely agnostic with respect to the meaning of primitives, to keep equivalence decidable. Second, GKAT excludes non-local control flow such as goto, break , and return . To overcome these limitations, we introduce Control-Flow GKAT (CF-GKAT) , a system that allows reasoning about programs that include non-local control flow as well as hardcoded values. CF-GKAT is able to soundly and completely verify trace equivalence of a larger class of programs, while preserving the nearly-linear efficiency of GKAT. This makes CF-GKAT suitable for the verification of control-flow manipulating procedures, such as decompilation and goto-elimination. To demonstrate CF-GKAT’s abilities, we validated the output of several highly non-trivial program transformations, such as Erosa and Hendren’s goto -elimination procedure and the output of Ghidra decompiler. CF-GKAT opens up the application of Kleene Algebra to a wider set of challenges, and provides an important verification tool that can be applied to the field of decompilation and control-flow transformation.
Weighted GKAT: Completeness and Complexity vankoevering-2025-weighted
We propose Weighted Guarded Kleene Algebra with Tests (wGKAT), an uninterpreted weighted programming language equipped with branching, conditionals, and loops. We provide an operational semantics for wGKAT using a variant of weighted automata and introduce a sound and complete axiomatization. We also provide a polynomial time decision procedure for bisimulation equivalence.
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.
Cites 50 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.
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.
External (44)
- Guarded Kleene Algebra with Tests: Verification of Uninterpreted Programs in Nearly Linear Time (Extended Version) (2019)
- Scalable verification of probabilistic networks (2019)
- A Coalgebraic Decision Procedure for NetKAT (2014)
- Symbolic Algorithms for Language Equivalence and Kleene Algebra with Tests (2014)
- Checking NFA equivalence with bisimulations up to congruence (2013)
- Nonlocal Flow of Control and Kleene Algebra with Tests (2008)
- The Böhm–Jacopini Theorem Is False, Propositionally (2008)
- On Combining Probability and Nondeterminism (2006)
- Distributing probability over non-determinism (2006)
- Automata on Guarded Strings and Applications (2003)
- Equational Verification of Cache Blocking in LU Decomposition using Kleene Algebra with Tests (2002)
- Universal coalgebra: a theory of systems (2000)
- Kleene algebra with tests: Completeness and decidability (1997)
- GOTO Removal Based on Regular Expressions (1997)
- Kleene algebra with tests and commutativity conditions (1996)
- The complexity of Kleene algebra with tests (1996)
- Taming control flow: a structured approach to eliminating goto statements (1994)
- Lazy Caching in Kleene Algebra (1994)
- Using Kleene algebra to reason about concurrency control (1994)
- Designing the McCAT compiler based on a family of structured intermediate representations (1993)
- Eliminating go to's while preserving program structure (1988)
- A probabilistic PDL (1985)
- A categorical approach to probability theory (1982)
- Unravelling Unstructured Programs (1982)
- Propositional dynamic logic of regular programs (1979)
- Simplification by Cooperating Decision Procedures (1979)
- Conversion of Unstructured Flow Diagrams to Structured Form (1978)
- Efficiency of a Good But Not Linear Set Union Algorithm (1975)
- Closure algorithms and the star-height problem of regular languages (1975)
- Program schemes, recursion schemes, and formal languages (1973)
- Analysis of structured programs (1973)
- On the capabilities of while, repeat, and exit statements (1973)
- The translation of GOTO programs into WHILE programs (1971)
- Regular Algebra and Finite Machines (1971)
- A linear algorithm for testing equivalence of finite automata (1971)
- On formalised computer programs (1970)
- Modern applied algebra (1970)
- Regular expressions and the equivalence of programs (1969)
- Flow diagrams, turing machines and languages with only two formation rules (1966)
- Two Complete Axiom Systems for the Algebra of Regular Events (1966)
- On Ianov's Program Schemata (1964)
- Computability of Recursive Functions (1963)
- The Logical Schemes of Algorithms. Problems of Cybernetics (1960)
- Representation of Events in Nerve Nets and Finite Automata (1956)