Write a Blog >>
ICFP 2020
Thu 20 - Fri 28 August 2020
Wed 26 Aug 2020 12:30 - 12:45 at ICFP NY 5 - New York 5 Chair(s): Richard A. Eisenberg
Wed 26 Aug 2020 23:30 - 23:45 at ICFP Asia 5 - Asia 5 Chair(s): Richard A. Eisenberg

Parsing with Derivatives (PwD) is an elegant approach to parsing context-free grammars (CFGs). It takes the equational theory behind Brzozowski’s derivative for regular expressions and augments that theory with laziness, memoization, and fixed points. The result is a simple parser for arbitrary CFGs. Although recent work improved the performance of PwD, it remains inefficient due to the algorithm repeatedly traversing some parts of the grammar.

In this functional pearl, we show how to avoid this inefficiency by suspending the state of the traversal in a zipper. When subsequent derivatives are taken, we can resume the traversal from where we left off without retraversing already traversed parts of the grammar.

However, the original zipper is designed for use with trees, and we want to parse CFGs. CFGs can include shared regions, cycles, and choices between alternates, which makes them incompatible with the traditional tree model for zippers. This paper develops a generalization of zippers to properly handle these additional features. Just as PwD generalized Brzozowski’s derivatives from regular expressions to CFGs, we generalize Huet’s zippers from trees to CFGs.

The resulting parsing algorithm is concise and efficient: it takes only 31 lines of OCaml code to implement the derivative function but performs 15,600 times faster than the original PwD and 3.43 times faster than the optimized implementation of PwD.

Conference Day
Wed 26 Aug

Displayed time zone: Eastern Time (US & Canada) change

11:00 - 13:00
New York 5ICFP Program at ICFP NY 5
Chair(s): Richard A. EisenbergTweag I/O

Public livestreams: YouTube, Bilibili (China)

11:00
15m
Talk
Denotational Recurrence Extraction for Amortized Analysis
ICFP Program
Joseph W. CutlerWesleyan University, Dan LicataWesleyan University, Norman DannerWesleyan University
DOI Media Attached
11:15
15m
Talk
Separation Logic for Sequential Programs (Functional Pearl)
ICFP Program
DOI Media Attached
11:30
15m
Talk
Strong Functional Pearl: Harper's Regular-Expression Matcher in Cedille
ICFP Program
Aaron StumpThe University of Iowa, USA, Chris JenkinsThe University of Iowa, Stephan SpahnThe University of Iowa, Colin McDonaldUniversity of Notre Dame
DOI Media Attached
11:45
15m
Talk
Duplo: A Framework for OCaml Post-Link Optimisation
ICFP Program
Nandor LickerUniversity of Cambridge, Timothy M. JonesUniversity of Cambridge, UK
DOI Media Attached
12:00
15m
Talk
Recovering Purity with Comonads and Capabilities
ICFP Program
Vikraman ChoudhuryIndiana University & University of Cambridge, Neel KrishnaswamiComputer Laboratory, University of Cambridge
DOI Media Attached
12:15
15m
Talk
A General Approach to Define Binders Using Matching Logic
ICFP Program
Xiaohong ChenUniversity of Illinois at Urbana-Champaign, Grigore RoşuUniversity of Illinois at Urbana-Champaign
DOI Media Attached
12:30
15m
Talk
Parsing with Zippers (Functional Pearl)
ICFP Program
Pierce DarraghUniversity of Utah, Michael D. AdamsUniversity of Michigan
DOI Media Attached
12:45
15m
Talk
Regular Language Type Inference with Term Rewriting
ICFP Program
Timothée HaudebourgUniv Rennes, Inria, CNRS, IRISA, Thomas GenetIRISA, Univ Rennes, Thomas P. JensenINRIA Rennes
DOI Media Attached
22:30 - 00:00
Asia 5ICFP Program at ICFP Asia 5
Chair(s): Richard A. EisenbergTweag I/O

Public livestreams: YouTube, Bilibili (China)

22:00
30m
Talk
Denotational Recurrence Extraction for Amortized Analysis
ICFP Program
Joseph W. CutlerWesleyan University, Dan LicataWesleyan University, Norman DannerWesleyan University
DOI Media Attached
22:15
15m
Talk
Separation Logic for Sequential Programs (Functional Pearl)
ICFP Program
DOI Media Attached
22:30
15m
Talk
Strong Functional Pearl: Harper's Regular-Expression Matcher in Cedille
ICFP Program
Aaron StumpThe University of Iowa, USA, Chris JenkinsThe University of Iowa, Stephan SpahnThe University of Iowa, Colin McDonaldUniversity of Notre Dame
DOI Media Attached
22:45
15m
Talk
Duplo: A Framework for OCaml Post-Link Optimisation
ICFP Program
Nandor LickerUniversity of Cambridge, Timothy M. JonesUniversity of Cambridge, UK
DOI Media Attached
23:00
15m
Talk
Recovering Purity with Comonads and Capabilities
ICFP Program
Vikraman ChoudhuryIndiana University & University of Cambridge, Neel KrishnaswamiComputer Laboratory, University of Cambridge
DOI Media Attached
23:15
15m
Talk
A General Approach to Define Binders Using Matching Logic
ICFP Program
Xiaohong ChenUniversity of Illinois at Urbana-Champaign, Grigore RoşuUniversity of Illinois at Urbana-Champaign
DOI Media Attached
23:30
15m
Talk
Parsing with Zippers (Functional Pearl)
ICFP Program
Pierce DarraghUniversity of Utah, Michael D. AdamsUniversity of Michigan
DOI Media Attached
23:45
15m
Talk
Regular Language Type Inference with Term Rewriting
ICFP Program
Timothée HaudebourgUniv Rennes, Inria, CNRS, IRISA, Thomas GenetIRISA, Univ Rennes, Thomas P. JensenINRIA Rennes
DOI Media Attached