Lune

Abstract

Parsers are security-critical components of many software systems, and verified parsing therefore has a key role to play in secure software design. However, existing verified parsers for context-free grammars are limited in their expressiveness, termination properties, or performance characteristics. They are only compatible with a restricted class of grammars, they are not guaranteed to terminate on all inputs, or they are not designed to be performant on grammars for real-world programming languages and data formats.

In this work, we present CoStar, a verified parser that addresses these limitations. The parser is implemented with the Coq Proof Assistant and is based on a purely functional adaptation of the ALL(*) parsing algorithm. CoStar is compatible with arbitrary non-left-recursive grammars; if the parser is applied to a non-left-recursive grammar, it produces a correct parse tree for its input whenever such a tree exists, and it correctly detects ambiguous inputs. CoStar also provides strong termination guarantees; it terminates without error on all inputs when applied to a non-left-recursive grammar. The parser is therefore a decision procedure for language membership. Finally, CoStar achieves linear-time performance on a range of unambiguous grammars for commonly used languages and data formats.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek Calculus cites Zippy LL(1) parsing with derivatives
  • A derivative-based parser generator for visibly Pushdown grammars cites Zippy LL(1) parsing with derivatives
  • Secure Parsing and Serializing with Separation Logic Applied to CBOR, CDDL, and COSE cites Hardening attack surfaces with formally proven binary format parsers
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Hardening attack surfaces with formally proven binary format parsersNikhil Swamy, Tahina Ramananandro, Aseem Rastogi, Irina Spiridonova et al.PLDI 2022 · 18 citations
  2. A derivative-based parser generator for visibly Pushdown grammarsXiaodong Jia, Ashish Kumar, Gang TanOOPSLA 2021 · 7 citations
  3. Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek CalculusSteven Schaefer, Nathan Varner, Pedro Henrique Azevedo de Amorim, Max S. NewPLDI 2025
  4. Secure Parsing and Serializing with Separation Logic Applied to CBOR, CDDL, and COSETahina Ramananandro, Gabriel Ebner, Guido Martínez, Nikhil SwamyCCS 2025

Builds on1

  1. Zippy LL(1) parsing with derivativesRomain Edelmann, Jad Hamza, Viktor KuncakPLDI 2020 · 13 citations

Related papers

  1. Statically Resolvable AmbiguityViktor Palmkvist, Elias Castegren, Philipp Haller, David BromanPOPL 2023 · 1 citation
  2. Faster general parsing through context-free memoizationGrzegorz HermanPLDI 2020 · 4 citations
  3. Leapfrog: certified equivalence for protocol parsersRyan Doenges, Tobias Kappé, John Sarracino, Nate Foster et al.PLDI 2022 · 11 citations
  4. VST-A: A Foundationally Sound Annotation VerifierLitao Zhou, Jianxing Qin, Qinshi Wang, Andrew W. Appel et al.POPL 2024 · 12 citations
  5. A verified optimizer for Quantum circuitsKesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu et al.POPL 2021 · 111 citations
Dusk over the sea between two cliffs drawn in fine vertical lines