Towards Typed Semantics for Parsing Expression Grammars

We describe the formalization of a type system for parsing expression grammars (PEG) which is equivalent to Ford's original fixpoint-based definition of well-formed PEGs. We use our type system definition to implement a functional big-step semantics for typed PEGs using the Agda programming language.

[1]  Adam Koprowski,et al.  TRX: A Formally Verified Parser Interpreter , 2010, ESOP.

[2]  Ramana Kumar,et al.  Functional Big-Step Semantics , 2016, ESOP.

[3]  Chung-Kil Hur,et al.  Strongly Typed Term Representations in Coq , 2011, Journal of Automated Reasoning.

[4]  Janusz A. Brzozowski,et al.  Derivatives of Regular Expressions , 1964, JACM.

[5]  Conor McBride Turing-Completeness Totally Free , 2015, MPC.

[6]  Tarmo Uustalu,et al.  Certified Parsing of Regular Languages , 2013, CPP.

[7]  Bryan Ford,et al.  Parsing expression grammars: a recognition-based syntactic foundation , 2004, POPL '04.

[8]  Patrik Jansson,et al.  Certified Context-Free Parsing: A formalisation of Valiant's Algorithm in Agda , 2016, Log. Methods Comput. Sci..

[9]  Leslie G. Valiant,et al.  General Context-Free Recognition in Less than Cubic Time , 1975, J. Comput. Syst. Sci..

[10]  Fritz Henglein,et al.  Bit-coded Regular Expression Parsing , 2011, LATA.

[11]  Ulf Norell Dependently typed programming in Agda , 2009, TLDI '09.

[12]  Hugo Daniel Macedo,et al.  Typing linear algebra: A biproduct-oriented approach , 2013, Sci. Comput. Program..

[13]  Peter Thiemann,et al.  A Computational Interpretation of Context-Free Expressions , 2017, APLAS.

[14]  James R. Douglass,et al.  Packrat parsers can support left recursion , 2008, PEPM '08.

[15]  Tarmo Uustalu,et al.  Certified CYK parsing of context-free languages , 2014, J. Log. Algebraic Methods Program..

[16]  Fabio Mascarenhas,et al.  Left recursion in Parsing Expression Grammars , 2014, Sci. Comput. Program..

[17]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[18]  Fabio Mascarenhas,et al.  On the relation between context-free grammars and parsing expression grammars , 2013, Sci. Comput. Program..