Coqlex: Generating Formally Verified Lexers
Wendlasida Ouedraogo (1), Gabriel Scherer (2), Lutz Strassburger (2), ((1) Siemens Mobility, France / Inria, France, (2) Inria, France / \'Ecole, Polytechnique, France)

TL;DR
Coqlex is a tool that generates formally verified lexers with a user-friendly syntax, combining practicality, simplicity, and decent performance to enhance end-to-end compiler verification.
Contribution
It introduces a verified lexer generator with OCamllex-like usability, using Brzozowski derivatives for simplicity and efficiency, advancing practical formal verification of compiler components.
Findings
Verified lexers can be user-friendly and practical to review.
Using Brzozowski derivatives simplifies implementation and improves performance.
Coqlex successfully generates verified lexers comparable to traditional tools.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Semantic Web and Ontologies
