Using graph neural networks for program termination
Yoav Alon, Cristina David
Abstract
Termination analyses investigate the termination behavior of programs, intending to detect nontermination, which is known to cause a variety of program bugs (e.g. hanging programs, denial-of-service vulnerabilities). Beyond formal approaches, various attempts have been made to estimate the termination behavior of programs using neural networks. However, the majority of these approaches continue to rely on formal methods to provide strong soundness guarantees and consequently suffer from similar limitations. In this paper, we move away from formal methods and embrace the stochastic nature of machine learning models. Instead of aiming for rigorous guarantees that can be interpreted by solvers, our objective is to provide an estimation of a program's termination behavior and of the likely reason for nontermination (when applicable) that a programmer can use for debugging purposes. Compared to previous approaches using neural networks for program termination, we also take advantage of the graph representation of programs by employing Graph Neural Networks. To further assist programmers in understanding and debugging nontermination bugs, we adapt the notions of attention and semantic segmentation, previously used for other application domains, to programs. Overall, we designed and implemented classifiers for program termination based on Graph Convolutional Networks and Graph Attention Networks, as well as a semantic segmentation Graph Neural Network that localizes AST nodes likely to cause nontermination. We also illustrated how the information provided by semantic segmentation can be combined with program slicing to further aid debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers3
- Neural termination analysisMirco Giacobbe, Daniel Kroening, Julian ParsertFSE 2022 · 16 citations
- Let a Neural Network be Your InvariantMirco Giacobbe, Daniel Kroening, Abhinandan Pal, Michael TautschnigNeurIPS 2025 · 6 citations
- Integrating Large Language Models and Reinforcement Learning for Non-linear ReasoningYoav Alon, Cristina DavidFSE 2025 · 2 citations
Builds on10
- Towards Deeper Graph Neural NetworksMeng Liu, Hongyang Gao, Shuiwang JiKDD 2020 · 496 citations
- Graph Convolutional Networks with Markov Random Field Reasoning for Social Spammer DetectionYongji Wu, Defu Lian, Yiheng Xu, Le Wu et al.AAAI 2020 · 194 citations
- Self-Supervised Bug Detection and RepairMiltiadis Allamanis, Henry Jackson-Flux, Marc BrockschmidtNeurIPS 2021 · 145 citations
- LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 citations
- Learning to Execute Programs with Instruction Pointer Attention Graph Neural NetworksDavid Bieber, Charles Sutton, Hugo Larochelle, Daniel TarlowNeurIPS 2020 · 51 citations
Related papers
- EndWatch: A Practical Method for Detecting Non-Termination in Real-World SoftwareYao Zhang, Xiaofei Xie, Yi Li, Sen Chen et al.ASE 2023 · 4 citations
- Learning Probabilistic Termination ProofsAlessandro Abate, Mirco Giacobbe, Diptarko RoyCAV 2021 · 26 citations
- Large-scale analysis of non-termination bugs in real-world OSS projectsXiuhan Shi, Xiaofei Xie, Yi Li, Yao Zhang et al.FSE 2022 · 12 citations
- Termination analysis without the tearsShaowei Zhu, Zachary KincaidPLDI 2021 · 16 citations
- Detecting Condition-Related Bugs with Control Flow Graph Neural NetworkJian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun et al.ISSTA 2023 · 19 citations
