一句话:提出基于最短路径CFL可达性的完整算法OrdinalFix,保证以最少修改次数修复编译错误。
编译错误阻碍软件开发,需修复以满足语法和语言约束。神经网络方法缺乏正确性保证且修改次数无界,而在给定修改次数内修复是挑战。作者证明找到最少修改次数修复编译错误是NP-hard。为此提出OrdinalFix,一种基于带属性检查的最短路径CFL(上下文无关语言)可达性的完整算法,保证输出具有最少修改次数的程序。它从最小修改数开始搜索,并通过合并属性检查提升效率,时间复杂度可接受。在两个数据集上评估,OrdinalFix在合理时间内修复错误,成功率达83.5%,超越现有方法(71.7%)。
The development of correct and efficient software can be hindered by compilation errors, which must be fixed to ensure the code's syntactic correctness and program language constraints. Neural network-based approaches have been used to tackle this problem, but they lack guarantees of output correctness and can require an unlimited number of modifications. Fixing compilation errors within a given number of modifications is a challenging task. We demonstrate that finding the minimum number of modifications to fix a compilation error is NP-hard. To address compilation error fixing problem, we propose OrdinalFix, a complete algorithm based on shortest-path CFL (context-free language) reachability with attribute checking that is guaranteed to output a program with the minimum number of modifications required. Specifically, OrdinalFix searches possible fixes from the smallest to the largest number of modifications. By incorporating merged attribute checking to enhance efficiency, the time complexity of OrdinalFix is acceptable for application. We evaluate OrdinalFix on two datasets and demonstrate its ability to fix compilation errors within reasonable time limit. Comparing with existing approaches, OrdinalFix achieves a success rate of 83.5 %, surpassing all existing approaches (71.7%).
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2309-06771,
title = {OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability},
author = {Wenjie Zhang and Guancheng Wang and Junjie Chen and Yingfei Xiong and Yong Liu and Lu Zhang},
booktitle = {ASE},
year = {2023},
doi = {10.1109/ase56229.2023.00072}
}