Lune

CAV2026顶会

Formally Verified Linear-Time Invertible Lexing

Samuel Chassot, Viktor Kuncak

摘要

Abstract We present ZipLex , a verified framework for invertible linear-time lexical analysis following the longest match (maximal munch) semantics. Unlike past verified lexers that focus only on satisfying the semantics of regular expressions and the longest match property, ZipLex also guarantees that lexing and printing are mutual inverses. Thanks to verified memoization, it also ensures that the lexical analysis of a string is linear in the size of the string. Our design and implementation rely on two sets of ideas: (1) a new abstraction of token sequences that captures the separability of tokens in a sequence while supporting their efficient manipulation, and (2) a combination of verified data structures and optimizations, including Huet’s zippers and memoization with a standalone verified imperative hash table. Our hash table offers competitive performance as shown by our evaluation. We implemented and verified ZipLex using the Stainless deductive verifier for Scala. Our evaluation demonstrates that ZipLex supports realistic applications such as JSON processing and lexers of programming languages, and behaves linearly even in cases that make flex-style approaches quadratic. ZipLex is two orders of magnitude faster than Verbatim, showing that verified invertibility and linear-time algorithms can be developed without prohibitive cost. Compared to Coqlex, ZipLex also offers linear (instead of quadratic) time lexing, and is the first lexer that comes with invertibility proofs for printing token sequences.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper4

  1. Zippy LL(1) parsing with derivativesRomain Edelmann, Jad Hamza, Viktor KuncakPLDI 2020 · 13 次引用
  2. RE#: High Performance Derivative-Based Regex Matching with Intersection, Complement, and Restricted LookaroundsIan Erik Varatalu, Margus Veanes, Juhan P. ErnitsPOPL 2025 · 9 次引用
  3. Efficient Algorithms for the Uniform Tokenization ProblemAngela W. Li, Konstantinos MamourasOOPSLA 2025 · 3 次引用
  4. Verified and Optimized Implementation of Orthologic Proof SearchSimon Guilloud, Clément Pit-ClaudelCAV 2025

相关 Paper

  1. Formally Verifying Arithmetic Chisel Designs for All Bit Widths at OnceWeizhi Feng, Yicheng Liu, Jiaxiang Liu, David N. Jansen 等DAC 2024
  2. Formula Normalizations in VerificationSimon Guilloud, Mario Bucev, Dragana Milovancevic, Viktor KuncakCAV 2023 · 6 次引用
  3. Flux: Liquid Types for RustNico Lehmann, Adam T. Geller, Niki Vazou, Ranjit JhalaPLDI 2023 · 29 次引用
  4. Vest: Verified, Secure, High-Performance Parsing and Serialization for RustYi Cai, Pratap Singh, Zhengyao Lin, Jay Bosamiya 等USENIX Security 2025
  5. StarMalloc: Verifying a Modern, Hardened Memory AllocatorAntonin Reitz, Aymeric Fromherz, Jonathan ProtzenkoOOPSLA 2024 · 5 次引用
黄昏的海面,两侧是细线勾勒的悬崖