paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Derivative-based Parser Generator for Visibly Pushdown Grammars

一种基于导数的可见下推文法解析器生成器
TOPLAS 45(2)2023匹配度 2/10 · 论文研究可见下推文法的解析器生成与 Coq 形式化验证,属于程序语言和形式化验证方向,但未涉及 LLM/Agent、ML/Agentic 程序静态分析、浮点程序分析或贝叶斯程序分析,与用户核心研究问题仅有一般性 PL 兴趣上的弱关联。引用 2 inbox
Xiaodong Jia, Ashish Kumar, Gang Tan
crossref: 2026-09-10

AI 速览

一句话:提出基于导数的可见下推文法解析器生成器,线性时间产出并提取全部歧义解析树,核心算法在 Coq 中验证。

本文针对可见下推文法(VPG)的识别与解析,提出一种基于导数的函数式解析器生成器。生成的解析器可接受歧义文法,并在线性时间内为输入串构造包含所有合法解析树的解析森林,且每棵解析树也可在线性时间内提取。为支持更灵活的 VPG 形式,作者还给出一个从 tagged CFG 到 VPG 的可靠翻译器,并通过运行翻译后 VPG 解析树中嵌入的语义动作来进一步生成 tagged CFG 的解析树。性能上与 ANTLR、GNU Bison 及流行手写解析器进行比较;核心解析算法的正确性和时间复杂度在 Coq 证明助手中形式化验证。

问题
如何为可见下推文法高效生成可处理歧义的解析器,并保证解析与解析树提取的线性时间复杂度。
方法
采用基于导数的函数式识别与解析方法生成解析森林,并提供 tagged CFG 到 VPG 的可靠翻译及语义动作机制。
评估
与 ANTLR、GNU Bison 和流行手写解析器进行性能比较,并在 Coq 中形式化验证核心算法的正确性与时间复杂度。
原文摘要(Abstract)

In this article, we present a derivative-based, functional recognizer and parser generator for visibly pushdown grammars. The generated parser accepts ambiguous grammars and produces a parse forest containing all valid parse trees for an input string in linear time. Each parse tree in the forest can then be extracted also in linear time. Besides the parser generator, to allow more flexible forms of the visibly pushdown grammars, we also present a translator that converts a tagged CFG to a visibly pushdown grammar in a sound way, and the parse trees of the tagged CFG are further produced by running the semantic actions embedded in the parse trees of the translated visibly pushdown grammar. The performance of the parser is compared with popular parsing tools, including ANTLR, GNU Bison, and other popular hand-crafted parsers. The correctness and the time complexity of the core parsing algorithm are formally verified in the proof assistant Coq.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2135,
  title = {A Derivative-based Parser Generator for Visibly Pushdown Grammars},
  author = {Xiaodong Jia and Ashish Kumar and Gang Tan},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {45},
  number = {2},
  year = {2023},
  doi = {10.1145/3591472}
}