论文标题
使用图形神经网络进行程序终止
Using Graph Neural Networks for Program Termination
论文作者
论文摘要
终止分析研究了打算检测非终止的程序的终止行为,这众所周知会导致各种程序错误(例如,悬挂程序,拒绝服务漏洞)。除了正式的方法之外,已经进行了各种尝试来估计使用神经网络的程序的终止行为。但是,这些方法中的大多数继续依靠形式方法来提供强大的健全性保证,因此受到了类似的限制。在本文中,我们摆脱了正式的方法,并接受机器学习模型的随机性质。我们的目标不是要通过解决方案来解释的严格保证,而是提供估计程序的终止行为以及程序员可以将其用于调试目的的可能不终止的可能原因(如果适用)。与以前使用神经网络进行程序终止的方法相比,我们还通过采用图形神经网络来利用程序的图表表示。为了进一步协助程序员理解和调试非终止错误,我们将注意力和语义细分的概念(以前用于其他应用程序领域)的概念适应程序。总体而言,我们设计和实现了基于图形卷积网络和图形注意力网络的程序终止的分类器,以及语义分割图神经网络,该神经网络本地定位可能导致非终止的AST节点。我们还说明了如何将语义细分提供的信息与程序切片相结合,以进一步帮助调试。
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.