Determining whether a program terminates is a central problem in computer science. Turing's Halting Problem established termination as undecidable, showing that no algorithm can universally determine termination for all programs and inputs. Hence, verification tools approximate termination, sometimes failing to prove or disprove; these tools rely on problem specific architectures, and are usually tied to particular programming languages. Recent advances in LLMs raise a natural question: To what extent can they reason about program termination? We evaluate frontier LLMs on a diverse set of C programs from the International Competition on Software Verification (SV Comp) 2025. Our results show that GPT-5 and Claude Sonnet 4.5 achieve scores comparable to top ranked verification tools (with test time scaling). However, while models often correctly infer whether programs terminate, they frequently fail to construct a witness as formal proof, revealing a gap between semantic recognition and symbolic proof generation. Performance further degrades as code length increases. To analyze this gap, we introduce a divergence precondition formulation that characterizes non termination conditions as logical constraints. We hope these findings motivate future research on real-world termination benchmarks, neuro-symbolic approaches that combine LLMs with symbolic verification methods, and, more broadly LLM reasoning on other undecidable problems.


翻译:判断程序是否终止是计算机科学中的一个核心问题。图灵的停机问题确立了终止性的不可判定性,表明不存在能普遍判断所有程序及其输入是否终止的算法。因此,验证工具对终止性进行近似判断,有时无法证明或否证;这些工具依赖于特定问题的架构,且通常与特定编程语言绑定。LLMs的最新进展引发了一个自然问题:它们在多大程度上能够推理程序的终止性?我们在国际软件验证竞赛(SV Comp)2025的多样化C语言程序集合上评估了前沿LLMs。结果表明,GPT-5和Claude Sonnet 4.5取得了与顶级验证工具相当的分数(在测试时扩展计算下)。然而,尽管模型通常能正确推断程序是否终止,它们却频繁无法构建作为形式化证明的证据,揭示了语义识别与符号证明生成之间的差距。性能随代码长度增加而进一步下降。为分析这一差距,我们引入了一种分歧前提形式化方法,将非终止条件表述为逻辑约束。我们希望这些发现能推动未来在现实世界终止性基准、结合LLMs与符号验证方法的神经符号方法,以及更广泛地,LLMs在其他不可判定问题上的推理等方面的研究。

0
下载
关闭预览

相关内容

LlamaV-o1: 重新思考大语言模型中的逐步视觉推理
专知会员服务
17+阅读 · 2025年1月14日
《以人为中心的大型语言模型(LLM)研究综述》
专知会员服务
41+阅读 · 2024年11月25日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
35+阅读 · 2020年9月3日
【干货书】贝叶斯推断随机过程,449页pdf
专知
31+阅读 · 2020年8月27日
ML、DL、NLP面试常考知识点、代码、算法理论基础汇总分享
赛尔笔记 | Attention!注意力机制可解释吗?
哈工大SCIR
23+阅读 · 2019年9月27日
从信息论的角度来理解损失函数
深度学习每日摘要
17+阅读 · 2019年4月7日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
关系推理:基于表示学习和语义要素
计算机研究与发展
19+阅读 · 2017年8月22日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Arxiv
0+阅读 · 3月25日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员