CoStar: a verified ALL(*) parser
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek Calculus 引用了 Zippy LL(1) parsing with derivatives
- A derivative-based parser generator for visibly Pushdown grammars 引用了 Zippy LL(1) parsing with derivatives
- Secure Parsing and Serializing with Separation Logic Applied to CBOR, CDDL, and COSE 引用了 Hardening attack surfaces with formally proven binary format parsers
引用它的顶会 Paper4
- Hardening attack surfaces with formally proven binary format parsersNikhil Swamy, Tahina Ramananandro, Aseem Rastogi, Irina Spiridonova 等PLDI 2022 · 18 次引用
- A derivative-based parser generator for visibly Pushdown grammarsXiaodong Jia, Ashish Kumar, Gang TanOOPSLA 2021 · 7 次引用
- Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek CalculusSteven Schaefer, Nathan Varner, Pedro Henrique Azevedo de Amorim, Max S. NewPLDI 2025
- Secure Parsing and Serializing with Separation Logic Applied to CBOR, CDDL, and COSETahina Ramananandro, Gabriel Ebner, Guido Martínez, Nikhil SwamyCCS 2025
它引用的 Paper1
相关 Paper
- Statically Resolvable AmbiguityViktor Palmkvist, Elias Castegren, Philipp Haller, David BromanPOPL 2023 · 1 次引用
- Faster general parsing through context-free memoizationGrzegorz HermanPLDI 2020 · 4 次引用
- Leapfrog: certified equivalence for protocol parsersRyan Doenges, Tobias Kappé, John Sarracino, Nate Foster 等PLDI 2022 · 11 次引用
- VST-A: A Foundationally Sound Annotation VerifierLitao Zhou, Jianxing Qin, Qinshi Wang, Andrew W. Appel 等POPL 2024 · 12 次引用
- A verified optimizer for Quantum circuitsKesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu 等POPL 2021 · 111 次引用
