arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.13014cs.SEcs.AIcs.LG
收藏

用于映射程序间变量的图神经网络——扩展版

Graph Neural Networks For Mapping Variables Between Programs -- Extended Version

INESC-ID(INESC-ID(里斯本高等工程学院信息与决策系统研究所));IST(里斯本高等技术学院);Universidade de Lisboa(里斯本大学);Radboud University Nijmegen(拉德堡德大学奈梅亨分校);Czech Technical University in Prague(布拉格捷克技术大学)

Pedro Orvalho, Jelle Piepenbrock, Mikoláš Janota, Vasco Manquinho

AI总结:

本文提出使用图神经网络基于抽象语法树映射程序间变量,并在程序修复任务中验证,仅基于变量映射即可修复约88.5%的错误程序,优于依赖程序结构的最先进方法。

摘要:

自动程序分析是计算机科学诸多领域(特别是形式化方法和人工智能)中的关键研究领域。由于程序等价问题的不可判定性,比较两个程序极具挑战性。通常,为了比较两个程序,需要建立两个程序的变量集之间的关系。因此,映射两个程序间的变量对于程序等价、程序分析、程序修复和克隆检测等众多任务非常有用。在本研究中,我们提出使用图神经网络(GNNs)基于两个程序的抽象语法树(ASTs)来映射两个程序间的变量集。为了展示变量映射的强大能力,我们在程序修复任务上展示了这些映射的三个用例,以修复入门编程作业(IPAs)中初学者程序员中普遍存在且反复出现的错误。在包含4166对错误/正确程序的数据集上的实验结果表明,我们的方法正确映射了83%的评估数据集。此外,我们的实验表明,严重依赖程序结构的当前最先进的程序修复方法只能修复约72%的错误程序。相比之下,我们仅基于变量映射的方法可以修复约88.5%的程序。

英文摘要:

Automated program analysis is a pivotal research domain in many areas of Computer Science -- Formal Methods and Artificial Intelligence, in particular. Due to the undecidability of the problem of program equivalence, comparing two programs is highly challenging. Typically, in order to compare two programs, a relation between both programs' sets of variables is required. Thus, mapping variables between two programs is useful for a panoply of tasks such as program equivalence, program analysis, program repair, and clone detection. In this work, we propose using graph neural networks (GNNs) to map the set of variables between two programs based on both programs' abstract syntax trees (ASTs). To demonstrate the strength of variable mappings, we present three use-cases of these mappings on the task of program repair to fix well-studied and recurrent bugs among novice programmers in introductory programming assignments (IPAs). Experimental results on a dataset of 4166 pairs of incorrect/correct programs show that our approach correctly maps 83% of the evaluation dataset. Moreover, our experiments show that the current state-of-the-art on program repair, greatly dependent on the programs' structure, can only repair about 72% of the incorrect programs. In contrast, our approach, which is solely based on variable mappings, can repair around 88.5%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑