Reference. Kleene algebra with tests
Cite
Cited by (20)
A Fast Quantitative Analyzer for NetKAT lu-2026-a
Weighted NetKAT: A Programming Language for Quantitative Network Verification suarezacevedo-2026-weighted
Kleene Algebra kappe-2025-kleene
A Demonic Outcome Logic for Randomized Nondeterminism zilberstein-2025-a
Weighted GKAT: Completeness and Complexity vankoevering-2025-weighted
Shoggoth: A Formal Foundation for Strategic Rewriting qin-2024-shoggoth
Domain Reasoning in TopKAT zhang-2024-domain
Coqlex: Generating formally verified lexers Ouedraogo_2023
A compiler consists of a sequence of phases going from lexical analysis to code generation. Ideally, the formal verification of a compiler should include the formal verification of each component of the tool-chain. An example is the CompCert project, a formally verified C compiler, that comes with associated tools and proofs that allow to formally verify most of those components.
However, some components, in particular the lexer, remain unverified. In fact, the lexer of Compcert is generated using OCamllex, a lex-like OCaml lexer generator that produces lexers from a set of regular expressions with associated semantic actions. Even though there exist various approaches, like CakeML or Verbatim++, to write verified lexers, they all have only limited practical applicability.
In order to contribute to the end-to-end verification of compilers, we implemented a generator of verified lexers whose usage is similar to OCamllex. Our software, called Coqlex, reads a lexer specification and generates a lexer equipped with a Coq proof of its correctness. It provides a formally verified implementation of most features of standard, unverified lexer generators.
The conclusions of our work are two-fold: Firstly, verified lexers gain to follow a user experience similar to lex/flex or OCamllex, with a domain-specific syntax to write lexers comfortably. This introduces a small gap between the written artifact and the verified lexer, but our design minimizes this gap and makes it practical to review the generated lexer. The user remains able to prove further properties of their lexer. Secondly, it is possible to combine simplicity and decent performance. Our implementation approach that uses Brzozowski derivatives is noticeably simpler than the previous work in Verbatim++ that tries to generate a deterministic finite automaton (DFA) ahead of time, and it is also noticeably faster thanks to careful design choices.
We wrote several example lexers that suggest that the convenience of using Coqlex is close to that of standard verified generators, in particular, OCamllex. We used Coqlex in an industrial project to implement a verified lexer of Ada. This lexer is part of a tool to optimize safety-critical programs, some of which are very large. This experience confirmed that Coqlex is usable in practice, and in particular that its performance is good enough. Finally, we performed detailed performance comparisons between Coqlex, OCamllex, and Verbatim++. Verbatim++ is the state-of-the-art tool for verified lexers in Coq, and the performance of its lexer was carefully optimized in previous work by Egolf and al. (2022). Our results suggest that Coqlex is two orders of magnitude slower than OCamllex, but two orders of magnitude faster than Verbatim++.
Verified compilers and other language-processing tools are becoming important tools for safety-critical or security-critical applications. They provide trust and replace more costly approaches to certification, such as manually reading the generated code. Verified lexers are a missing piece in several Coq-based verified compilers today. Coqlex comes with safety guarantees, and thus shows that it is possible to build formally verified front-ends.
Outcome Logic: A Unifying Foundation for Correctness and Incorrectness Reasoning zilberstein-2023-outcome
On incorrectness logic and Kleene algebra with top and tests zhang-2022-on
Algorithmics bird-2021-algorithmics
Guarded Kleene algebra with tests: verification of uninterpreted programs in nearly linear time smolka-2019-guarded
Probabilistic NetKAT foster-2016-probabilistic
Algebra-coalgebra duality in brzozowski’s minimization algorithm bonchi-2014-algebra
NetKAT: Semantic foundations for networks anderson2014netkat
Brzozowski’s Algorithm (Co)Algebraically bonchi-2012-brzozowski
Regular expression containment: Coinductive axiomatization and computational interpretation henglein_regular_2011
Concurrent Kleene Algebra hoare2009concurrent
Kleene algebra with tests and program schematology angus2001kleene
Certification of Compiler Optimizations Using Kleene Algebra with Tests kozen2000certification
Cites 39 works (2 here)
With notes (2)
A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events KOZEN1994366
Action logic and pure induction prattActionLogicPure1991
External (37)
- On the complexity of reasoning in Kleene algebra (1997)
- Kleene algebra with tests and commutativity conditions (1996)
- Kleene algebra with tests: Completeness and decidability (1996)
- The complexity of Kleene algebra with tests (1996)
- Hypotheses in Kleene algebra (1994)
- Using Kleene algebra to reason about concurrency control (1994)
- Equational axioms for regular sets (1993)
- The Design and Analysis of Algorithms (1992)
- A new finite complete solvable quasiequational calculus for algebra of regular languages (1992)
- Complete systems ofB-rational identities (1991)
- Une remarque sur les systèmes complets d'identités rationnelles (1990)
- A Semiring on Convex Polygons and Zero-Sum Cycle Problems (1990)
- On Kleene algebras and closed semirings (1990)
- Logics of programs (1990)
- Rational data structures and their applications (1989)
- Dynamic algebras as a well-behaved fragment of relation algebras (1988)
- Kleene's theorem revisited: A formal path from Kleene to Chomsky (1987)
- The kleene and the Parikh Theorem in complete semirings (1987)
- On the decidability of some problems about rational subsets of free partially commutative monoids (1986)
- Semirings, Automata, Languages (1986)
- Relation algebras with transitive closure (1984)
- On induction vs. *-continuity (1981)
- On folk theorems (1980)
- Transductions and Context-Free Languages (1979)
- Propositional dynamic logic of regular programs (1979)
- Closure algorithms and the star-height problem of regular languages (1975)
- The Design and Analysis of Computer Algorithms (1974)
- Word problems requiring exponential time (1973)
- General theory of flowcharts (1972)
- Algorithmic logic and its applications (1972)
- Regular Algebra and Finite Machines (1971)
- Flow diagrams, turing machines and languages with only two formation rules (1966)
- Two Complete Axiom Systems for the Algebra of Regular Events (1966)
- On the algebra of regular expressions (1965)
- On defining relations for the algebra of regular events (1964)
- Representation of events in nerve nets and finite automata (1956)
- On the calculus of relations (1941)