In this paper, we present an efficient, functional, and formally verified parsing algorithm for LL(1) context-free expressions based on the concept of derivatives of formal languages. Parsing with derivatives is an elegant parsing technique, which, in the general case, suffers from cubic worst-case time complexity and slow performance in practice. We specialise the parsing with derivatives algorithm to LL(1) context-free expressions, where alternatives can be chosen given a single token of lookahead. We formalise the notion of LL(1) expressions and show how to efficiently check the LL(1) property. Next, we present a novel linear-time parsing with derivatives algorithm for LL(1) expressions operating on a zipper-inspired data structure. We prove the algorithm correct in Coq and present an implementation as a parser combinators framework in Scala, with enumeration and pretty printing capabilities.
Thu 16 JunDisplayed time zone: Pacific Time (US & Canada) change
10:40 - 12:00 | |||
10:40 20mTalk | (ICFP 2021) Formal Verification of a Concurrent Bounded Queue in a Weak Memory Model SIGPLAN Track Glen Mével Inria, Université Paris-Saclay, CNRS, ENS Paris-Saclay, Laboratoire des méthodes formelles, Jacques-Henri Jourdan Université Paris-Saclay, CNRS, ENS Paris-Saclay, Laboratoire Méthodes Formelles | ||
11:00 20mTalk | (PLDI 2020) Zippy LL(1) Parsing with Derivatives SIGPLAN Track | ||
11:20 20mTalk | (PLDI 2021) CoStar: A Verified ALL(*) Parser SIGPLAN Track Sam Lasser Tufts University, Chris Casinghino Draper Laboratory, Kathleen Fisher Tufts University, Cody Roux Draper | ||
11:40 20mTalk | (PLDI 2021) Transfinite Iris: Resolving an Existential Dilemma of Step-Indexed Separation Logic SIGPLAN Track Simon Spies MPI-SWS & Saarland University, Lennard Gäher MPI-SWS & Saarland University, Daniel Gratzer Aarhus University, Joseph Tassarotti Boston College, Robbert Krebbers Radboud University Nijmegen, Derek Dreyer MPI-SWS, Lars Birkedal Aarhus University |