LLMs versus the Halting Problem: Characterizing Program Termination Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
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. Beyond witness automaton graphs, 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.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 17 of its 41 references that are in the map. First posted on arXiv 26 Jan 2026.
Builds on
17 of 41 references.
References · 17
- 2025Qwen3 Technical Reportcited by 8,820
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2024GPT-4o System Cardcited by 4,588
- 2023A Survey of Large Language Modelscited by 2,576
- 2024DeepSeek-V3 Technical Reportcited by 811
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2024GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Modelscited by 550
- 2023LINC: A Neurosymbolic Approach for Logical Reasoning by Combining Language Models with First-Order Logic Proverscited by 168
- 2024LLMs Still Can't Plan; Can LRMs? A Preliminary Evaluation of OpenAI's o1 on PlanBenchcited by 94
- 2025CWM: An Open-Weights LLM for Research on Code Generation with World Modelscited by 93
- 2023A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trendscited by 66
- 2025Have Large Language Models Learned to Reason? A Characterization via 3-SAT Phase Transitioncited by 14
5 more
- 2025What I cannot execute, I do not understand: Training and Evaluating LLMs on Program Execution Tracescited by 12
- 2024MCP-Solver: Integrating Language Models with Constraint Programming Systemscited by 10
- 2024Combining Constraint Programming Reasoning with Large Language Model Predictionscited by 8
- 2025Reliable Proof Generation with LLMs via Analogical Retrieval and Symbolic Verification: A Case Study in Euclidean Geometrycited by 7
- 2023AProVE: Modular Termination Analysis of Memory-Manipulating C Programscited by 1
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Agentic Code Reasoningcited by 4
- 2026Predicting Program Exit Code with LLMs and Programming Language Semanticscited by 0
- 2026Predicting Program Exit Code with LLMs and Programming Language Semantics1 Sep 2026
- 2026Agentic Code Reasoning2 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026Teaching LLMs Program Semantics via Symbolic Execution Traces
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference
- 2025Understanding Formal Reasoning Failures in LLMs as Abstract Interpreters
- 2026Stress-Testing the Reasoning Competence of LLMs With Proofs Under Minimal Formalism
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specifications
- 2026Automated Lemma Discovery in Agentic Program Verification
- 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks