Using Graph Neural Networks for Program Termination

07/28/2022
by   Yoav Alon, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/24/2020

A Separation Logic to Verify Termination of Busy-Waiting for Abrupt Program Exit

Programs for multiprocessor machines commonly perform busy-waiting for s...
research
07/20/2020

A Separation Logic to Verify Termination of Busy-Waiting for Abrupt Program Exit: Technical Report

Programs for multiprocessor machines commonly perform busy-waiting for s...
research
01/24/2020

Comparison of Syntactic and Semantic Representations of Programs in Neural Embeddings

Neural approaches to program synthesis and understanding have proliferat...
research
09/01/2021

Termination Analysis for the π-Calculus by Reduction to Sequential Program Termination

We propose an automated method for proving termination of π-calculus pro...
research
07/24/2023

Graph Neural Networks For Mapping Variables Between Programs – Extended Version

Automated program analysis is a pivotal research domain in many areas of...
research
05/16/2019

Inferring Javascript types using Graph Neural Networks

The recent use of `Big Code' with state-of-the-art deep learning methods...
research
04/02/2021

Proving Non-termination by Program Reversal

We present a new approach to proving non-termination of non-deterministi...

Please sign up or login with your details

Forgot password? Click here to reset