paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Context-Free Grammar Inference for Complex Programming Languages in Black Box Settings

黑盒环境下复杂编程语言的上下文无关文法推断
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文研究黑盒上下文无关文法推断,属于程序语言/语法推断方向,与用户关注的 LLM/Agent 结合静态分析、浮点程序分析、贝叶斯程序分析等核心问题无直接交集。虽然涉及复杂语言的可扩展性与新基准,但方法不基于 LLM/Agent,也非静态分析或形式化验证。引用 1 inbox
Feifei Li, Xiao Chen, Xiaoyu Sun, Xi Xiao, Shaohua Wang, Yong Ding, Sheng Wen, Qing Li
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 Crucio,通过分解森林与分布矩阵从黑盒样本中为 C/C++/Java 等复杂语言高效推断上下文无关文法。

现有文法推断方法难以在实用时间内扩展到复杂编程语言:Arvada、Treevada、Kedavra 均无法在 48 小时内推断 C、C++、Java 文法。Arvada/Treevada 直接在完整长输入上推断,对大文件效率低;Kedavra 虽做数据分解生成短示例,但词法分析仍依赖原始输入,且严格不过度泛化约束限制复杂文法构造。本文提出 Crucio,构建分解森林提取短示例,并通过分布矩阵同时进行词法与文法推断。实验显示,Crucio 是唯一能在合理时间内成功推断复杂语言文法的方法,非终结符数量最高为此前基准的 23 倍;在简单基准上,其平均召回率为 Treevada/Kedavra 的 1.37/1.19 倍,F1 为 1.21/1.13 倍。

问题
黑盒设置下,如何从真实代码样本中为 C/C++/Java 等复杂编程语言高效推断上下文无关文法,并突破现有工具在可扩展性与时间上的不足。
方法
Crucio 构建分解森林,将长输入分解为短示例,并利用分布矩阵进行词法分析和文法推断,以支持复杂文法构造。
评估
在复杂语言与先前简单基准上,与 Arvada、Treevada、Kedavra 比较;报告 48 小时内成功推断、非终结符规模以及召回率和 F1 的提升。
原文摘要(Abstract)

Grammar inference for complex programming languages remains a significant challenge, as existing approaches fail to scale to real-world datasets within practical time constraints. In our experiments, none of the state-of-the-art tools, including Arvada, Treevada and Kedavra were able to infer grammars for complex languages such as C, C++, and Java within 48 hours. Arvada and Treevada perform grammar inference directly on full-length input examples, which proves inefficient for large files commonly found in such languages. While Kedavra introduces data decomposition to create shorter examples for grammar inference, its lexical analysis still relies on the original inputs. Additionally, its strict no-overgeneralization constraint limits the construction of complex grammars. To overcome these limitations, we propose Crucio, which builds a decomposition forest to extract short examples for lexical and grammar inference via a distributional matrix. Experimental results show that Crucio is the only method capable of successfully inferring grammars for complex programming languages (where the number of nonterminals is up to 23 × greater than in prior benchmarks) within reasonable time limits. On the prior simple benchmark, Crucio achieves an average recall improvement of 1.37 × and 1.19 × over Treevada and Kedavra, respectively, and improves F1 scores by 1.21 × and 1.13 ×.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2601-12385,
  title = {Context-Free Grammar Inference for Complex Programming Languages in Black Box Settings},
  author = {Feifei Li and Xiao Chen and Xiaoyu Sun and Xi Xiao and Shaohua Wang and Yong Ding and Sheng Wen and Qing Li},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773147}
}