pith. sign in

arxiv: 2507.11873 · v2 · pith:5E4WZQUVnew · submitted 2025-07-16 · 💻 cs.FL · cs.PL

Syntax Repair as Language Intersection

classification 💻 cs.FL cs.PL
keywords languagerepairsyntaxalgorithmfiniteintersectiontechniqueanalysis
0
0 comments X
read the original abstract

We introduce a new technique for repairing syntax errors in arbitrary context-free languages. This technique models syntax repair as a language intersection problem by defining a finite language that provably generates every syntactically valid repair within a given edit distance. Leveraging a theoretical connection between the Bar-Hillel construction from formal language theory and CFL reachability from program analysis, we show that repairability in a finite number of typographic edits is polylogarithmic parallel time decidable and provide an enumeration algorithm based on the Brzozowski derivative. Finally, we evaluate this algorithm and its implementation, demonstrating state-of-the-art results on a Python syntax repair benchmark.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.