POSIX Lexing with Bitcoded Derivatives

Research output: Chapter in Book/Report/Conference proceedingConference paperpeer-review

85 Downloads (Pure)

Abstract

Sulzmann and Lu describe a lexing algorithm that calculates Brzozowski derivatives using bitcodes annotated to regular expressions. Their algorithm generates POSIX values which encode the information of how a regular expression matches a string - that is, which part of the string is matched by which part of the regular expression. This information is needed in the context of lexing in order to extract and to classify tokens. The purpose of the bitcodes is to generate POSIX values incrementally while derivatives are calculated. They also help with designing an "aggressive" simplification function that keeps the size of derivatives finitely bounded. Without simplification the size of some derivatives can grow arbitrarily big, resulting in an extremely slow lexing algorithm. In this paper we describe a variant of Sulzmann and Lu's algorithm: Our variant is a recursive functional program, whereas Sulzmann and Lu's version involves a fixpoint construction. We (i) prove in Isabelle/HOL that our variant is correct and generates unique POSIX values (no such proof has been given for the original algorithm by Sulzmann and Lu); we also (ii) establish finite bounds for the size of our derivatives
Original languageEnglish
Title of host publication14th International Conference on Interactive Theorem Proving (ITP 2023)
EditorsAdam Naumowicz, René Thiemann
Pages26:1-26:18
Number of pages18
Publication statusAccepted/In press - 18 Apr 2023

Fingerprint

Dive into the research topics of 'POSIX Lexing with Bitcoded Derivatives'. Together they form a unique fingerprint.

Cite this