Title
Certified Parsing of Dependent Regular Grammars
Abstract
Parsers are ubiquitous, but formal reasoning about the behavior of a parser is challenging. One key challenge is parsing dependent formats, which are difficult for traditional techniques to handle because parse values can influence future parsing behavior. We present dependent regular grammars, which extend regular languages with data-dependency by generalizing concatenation to monadic bind. Even this small tweak adds significant expressive power; for example, conditional parsing and dependent repetition are both implementable using monadic bind.However, it is not obvious how to actually parse dependent regular grammars. We implement a Brzozowski derivative based matching algorithm, and we show how many popular parser combinator functions can be implemented in our library while retaining the same simplicity as traditional parser combinators.We implement and formalize these grammars in Coq, as well as a derivative-based matching algorithm. We prove soundness and completeness of the derivative operator in the standard way. We also implement a variety of popular parser combinator functions and give formal specifications to them. Finally, we implement as a case study a verified netstring parser, and prove functional correctness of the parser.
Year
DOI
Venue
2022
10.1109/SPW54247.2022.9833893
2022 IEEE Security and Privacy Workshops (SPW)
Keywords
DocType
ISSN
Monadic parser combinators,certified parsing,Coq,data-dependent parsing,parsing with derivatives
Conference
2639-7862
ISBN
Citations 
PageRank 
978-1-6654-9644-5
0
0.34
References 
Authors
14
3
Name
Order
Citations
PageRank
John Sarracino101.01
Gang Tan200.34
Greg Morrisett300.34