arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.35523cs.SEcs.AIcs.LO
收藏

基于大语言模型的排名函数生成用于终止性证明

Ranking Function Generation with LLMs for Termination

Key Laboratory of System Software (Chinese Academy of Sciences)(中国科学院系统软件重点实验室);Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);School of Computing and Mathematical Sciences, Birkbeck, University of London(伦敦大学伯贝克学院计算与数学科学学院);Nanjing Institute of Software Technology(南京软件工程研究所)

Rongkang Li, Jiaxin Hu, Taolue Chen, Yong Li, Fu Song, Zhilin Wu, Qiusong Yang

AI总结:

该研究提出神经符号框架RAINFALL,结合LLM与符号验证综合排名函数,在358个C程序基准上成功率达90.22%,优于基线,与PROTON 2.1结合后提升至96.65%,为软件工程研究提供新方向。

摘要:

排名函数是证明循环终止性的基础技术,但手动构建排名函数极具挑战性,且需要深厚的专业知识。我们提出RAINFALL,一种神经符号框架,遵循生成-验证-精化范式,将大语言模型(LLM)与符号验证紧密集成。RAINFALL将排名函数综合建模为代码补全任务,通过在输入程序中插入占位符,并约束LLM为每个循环填充四个预定义槽位。补全后的程序由符号验证器检查,若验证成功则得到有效排名函数;否则,验证器的诊断信息会被转换为自然语言反馈,指导迭代精化LLM的输出。我们在两个包含358个终止C程序的公开基准套件上评估RAINFALL,使用MiniMax V2.7时,RAINFALL为323个程序(90.22%)综合出可验证的排名函数,优于所有有前景的基线;尤其比SV-COMP 2026终止类别最佳基线及获奖者PROTON 2.1多解决12个程序,将RAINFALL与PROTON 2.1结合可使成功率提升至96.65%(346/358个程序)。我们还开展消融研究,确认占位符契约、少样本示例、符号验证及诊断信息反馈的各自贡献,跨LLM的实验进一步验证RAINFALL的有效性。研究结果表明,该框架为排名函数综合及LLM辅助综合形式可验证的活性证书提供了通用、可靠的方案,二者均代表软件工程研究的新方向。

英文摘要:

Ranking functions are a fundamental technique for proving loop termination, but synthesizing them remains challenging and often requires substantial expertise. Despite considerable progress in their automated synthesis, existing approaches remain limited in their effectiveness. We propose RAINFALL, a neuro-symbolic framework that tightly integrates large language models (LLMs) with symbolic verification. To our best knowledge, RAINFALL is the first to employ a generate-verify-refine paradigm for LLM-based ranking function synthesis. RAINFALL formulates ranking function synthesis as a constrained code-completion task, inserting placeholders into the input program that the LLM must fill in four predefined slots per loop. The resulting program is checked by a symbolic verifier. Successful verification yields a valid ranking function, while verification failures produce diagnostics that are translated into natural-language feedback to guide iterative refinement. We evaluate RAINFALL on two public benchmark suites comprising 358 terminating C programs. Using DeepSeek-V4.1-Flash, RAINFALL synthesizes verified ranking functions for 333 programs (93.02%), outperforming all evaluated baselines. Notably, it solves 22 more programs than PROTON 2.1, the winner of the SV-COMP 2026 Termination Category. Combining RAINFALL with PROTON 2.1 further increases the success rate to 96.65% (346/358 programs). Ablation studies demonstrate the contributions of placeholder contracts, few-shot examples, symbolic verification, and diagnostic feedback, while experiments across different LLMs establish the broader applicability of the framework.

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

↑