跳到正文
arXiv cs.AI· Rongkang Li, Jiaxin Hu, Taolue Chen, Yong Li, Fu Song, Zhilin Wu·· 4 小时前AI 评分39

RAINFALL:用 LLM 生成排序函数证明循环终止性

Ranking Function Generation with LLMs for Termination

AI 导读

RAINFALL 是一个神经符号框架,把排序函数合成建模为代码补全任务,让 LLM 填充四个预定义槽位,再由符号验证器检查并生成自然语言反馈迭代修正。

正文 · 原文

View PDF HTML (experimental)

Abstract:Ranking functions are a fundamental technique for proving loop termination, but constructing them manually is challenging and requires substantial expertise. We propose RAINFALL, a neuro-symbolic framework which follows the generate-verify-refine paradigm and tightly integrates LLMs with symbolic verification. RAINFALL formulates ranking function synthesis as a code-completion task by inserting placeholders into the input program and constraining the LLM to fill four predefined slots for each loop. The completed program is then checked by a symbolic verifier. If verification succeeds, a valid ranking function is obtained; otherwise, the verifier's diagnostics are translated into natural-language feedback that guides iterative refinement of the LLM's output. We evaluate RAINFALL on two public benchmark suites comprising 358 terminating C programs. Using MiniMax V2.7, RAINFALL synthesizes verifiable ranking functions for 323 programs (90.22%), outperforming all promising baselines. In particular, it solves 12 more programs than PROTON 2.1, the best-performing baseline and winner of the SV-COMP 2026 Termination category. Furthermore, combining RAINFALL with PROTON 2.1 increases the success rate to 96.65% (346/358 programs). We also conduct ablation study confirming individual contributions of placeholder contracts, few-shot examples, symbolic verification, and diagnostic information feedback. Experiments across LLMs further confirm the effectiveness of RAINFALL. Our results suggest a generic, sound framework for ranking-function synthesis and, beyond termination, LLM-assisted synthesis of formally checkable liveness certificates, both of which represent new directions of software engineering research.
Comments: 24 pages, 6 pages
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Logic in Computer Science (cs.LO)
Cite as: arXiv:2610.35523 [cs.SE]
  (or arXiv:2610.35523v1 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2610.35523

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Fu Song [view email]
[v1] Mon, 26 Oct 2026 14:41:52 UTC (1,255 KB)

来源:arXiv cs.AI · arxiv.org