使用GNN探索Horn子句的表示(扩展技术报告)
Exploring Representation of Horn Clauses using GNNs (Extended Technical Report)
摘要:
由于真实世界程序设计语言语法的复杂性以及由于使用标识符来重构在程序中隐式表示的长距离关系信息的困难性,从原始源代码学习程序语义是具有挑战性的。解决第一点,我们认为约束角子句(CHCs)作为一个标准的程序验证问题的表示,提供了一个简单的和程序设计语言独立的语法。对于第二个挑战,我们探索了CHCs的图形表示,并提出了一个新的关系超图神经网络(R-HyGNN)架构来学习程序特征。我们介绍了两种不同的图形表示的CHCs。一种是约束图(constraint graph,CG),它通过将CHCs中的符号及其关系分别转换为类型化节点和二元边,并将约束构造为抽象语法树来强调CHCs的语法信息。第二种是控制流和数据流超图(CDHG),它通过用三值超边表示控制流和数据流来强调CHC的语义信息。然后,我们提出了一个新的GNN架构,R-HyGNN,扩展关系图卷积网络,处理超图。为了评估R-HyGNN从程序中提取语义信息的能力,我们使用R-HyGNN在两个图表示上对模型进行训练,并使用CHC-COMP 2021中的基准作为训练数据,对五个难度越来越大的代理任务进行训练。最困难的代理任务要求模型预测反例中子句的出现,这包含了CHCs的可满足性。CDHG在此任务中达到90.59%的准确率。此外,R-HyGNN对其中一个由290多个子句组成的图有完美的预测。总的来说,我们的实验表明,R-HyGNN可以捕获复杂的程序功能,指导验证问题。
英文摘要:
Learning program semantics from raw source code is challenging due to the complexity of real-world programming language syntax and due to the difficulty of reconstructing long-distance relational information implicitly represented in programs using identifiers. Addressing the first point, we consider Constrained Horn Clauses (CHCs) as a standard representation of program verification problems, providing a simple and programming language-independent syntax. For the second challenge, we explore graph representations of CHCs, and propose a new Relational Hypergraph Neural Network (R-HyGNN) architecture to learn program features. We introduce two different graph representations of CHCs. One is called constraint graph (CG), and emphasizes syntactic information of CHCs by translating the symbols and their relations in CHCs as typed nodes and binary edges, respectively, and constructing the constraints as abstract syntax trees. The second one is called control- and data-flow hypergraph (CDHG), and emphasizes semantic information of CHCs by representing the control and data flow through ternary hyperedges. We then propose a new GNN architecture, R-HyGNN, extending Relational Graph Convolutional Networks, to handle hypergraphs. To evaluate the ability of R-HyGNN to extract semantic information from programs, we use R-HyGNNs to train models on the two graph representations, and on five proxy tasks with increasing difficulty, using benchmarks from CHC-COMP 2021 as training data. The most difficult proxy task requires the model to predict the occurrence of clauses in counter-examples, which subsumes satisfiability of CHCs. CDHG achieves 90.59% accuracy in this task. Furthermore, R-HyGNN has perfect predictions on one of the graphs consisting of more than 290 clauses. Overall, our experiments indicate that R-HyGNN can capture intricate program features for guiding verification problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。