2025/07/16 by Breandan Considine, Considine, Breandan
Arts and Humanities · #FOS: Computer and information sciences #Formal Languages and Automata Theory (cs.FL) #Programming Languages (cs.PL) #Syntax, Semantics, Linguistic Variation
paper · pdf · doi:10.48550/arxiv.2507.11873
openalex publication_date 2025/07/16 · openalex created_date 2025/10/18 · openalex updated_date 2026/07/28
Syntax repair can be viewed as a question about finite languages: given an invalid string and a grammar, which nearby strings are syntactically valid? We formalize bounded syntax repair as the intersection of a context-free language with an acyclic Levenshtein automaton, obtaining a finite language that contains all and only repairs within a chosen edit radius. This approach leverages the classic Bar-Hillel construction for CFL-regular intersection, and specializes it to acyclic automata, and yielding a highly parallel decision procedure for deciding repairability. We then show how Brzozowski derivatives support fast incremental enumeration from this intersection, separating exact admissibility from probabilistic ranking. Experiments on Python syntax errors demonstrate the resulting candidate spaces are practical to construct and substantially improve repair accuracy when used as a grammar-constrained search space.