计算机科学 > 软件工程
[提交于 2026年10月26日 (v1),最后修订于 2026年11月24日 (此版本, v2)]
标题:Ranking Function Generation with LLMs for Termination
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Fu Song[v1] 2026年10月26日 星期一 14:41:52 UTC (1,255 KB)
[v2] 2026年11月24日 星期二 06:07:12 UTC (922 KB)