arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.12385cs.PL
收藏

在黑盒环境下为复杂编程语言进行上下文无关文法推断

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

Tsinghua Shenzhen International Graduate School(清华大学深圳国际研究生院);The University of Newcastle(纽卡斯尔大学);The Australian National University(澳大利亚国立大学);Central University of Finance and Economics(中央财经大学);School of Computer Science, Guangdong University of Science and Technology(广东工业大学计算机学院);Peng Cheng Laboratory(鹏城实验室)

Feifei Li, Xiao Chen, Xiaoyu Sun, Xi Xiao, Shaohua Wang, Yong Ding, Sheng Wen, Qing Li

AI总结:

Crucio通过构建分解森林和分布矩阵,有效推断复杂编程语言文法,提升召回率和F1分数。

摘要:

复杂编程语言的文法推断仍然是一项重大挑战,因为现有方法无法在实际时间内扩展到真实世界的数据集。在我们的实验中,现有的最先进工具,包括Arvada、Treevada和Kedavra,都无法在48小时内推断出C、C++和Java等复杂语言的文法。Arvada和Treevada直接在完整长度的输入示例上进行文法推断,这在这些语言中常见的大型文件上证明是低效的。而Kedavra引入了数据分解来创建较短的示例进行文法推断,但其词法分析仍然依赖于原始输入。此外,其严格的无过度泛化约束限制了复杂文法的构建。为克服这些限制,我们提出了Crucio,它通过分布矩阵构建分解森林,以提取短示例用于词法和文法推断。实验结果表明,Crucio是唯一能够合理时间内成功推断复杂编程语言文法(非终结符数量比先前基准高23倍)的方法。在先前的简单基准上,Crucio在Treevada和Kedavra上的平均召回率分别提高了1.37倍和1.19倍,并提高了F1分数1.21倍和1.13倍。

英文摘要:

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 23x greater than in prior benchmarks) within reasonable time limits. On the prior simple benchmark, Crucio achieves an average recall improvement of 1.37x and 1.19x over Treevada and Kedavra, respectively, and improves F1 scores by 1.21x and 1.13x.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑