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.
翻译:终止分析旨在调查程序终止行为, 以检测程序终止行为, 目的是检测程序终止行为, 目的是检测不终止行为, 已知该行为会造成各种程序错误( 如挂牌程序、 拒绝提供服务的脆弱性 ) 。 除了正式方法外, 已经尝试了各种尝试来估计使用神经网络的程序终止行为。 但是, 大部分这些方法继续依赖正规方法来提供强有力的稳健保障, 因而也因此受到类似的限制 。 在本文件中, 我们远离正规方法, 接受机器学习模型的随机性。 我们的目的不是要严格保证解决者能够解释的严格保障, 而是要估计程序终止行为以及( 适用时) 可能发生的不终止原因。 除了正式方法之外, 还试图对程序终止使用神经网络的程序的终止行为做出各种估计 。 与以前使用神经网络网络 相比, 我们还利用程序图解调和调调调的机器学习模式错误。 我们的目的不是要将先前用于其他应用程序域域域域的注意和语义分解概念概念概念概念的概念, 我们设计并实施了网络的不易变形图解的系统 。