OrdinalFix:通过最短路径CFL可达性修复编译错误
OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability
AI总结:
本文提出OrdinalFix算法,基于最短路径CFL可达性与属性检查,保证在最少修改次数内修复编译错误,成功率达83.5%,超越现有方法。
摘要:
编译错误会阻碍正确且高效软件的开发,必须修复这些错误以确保代码的语法正确性和程序语言约束。基于神经网络的方法已被用于解决此问题,但它们缺乏输出正确性的保证,且可能需要无限次修改。在给定修改次数内修复编译错误是一项具有挑战性的任务。我们证明了寻找修复编译错误所需的最少修改次数是NP难的。为了解决编译错误修复问题,我们提出了OrdinalFix,这是一种基于带属性检查的最短路径CFL(上下文无关语言)可达性的完备算法,保证输出所需修改次数最少的程序。具体而言,OrdinalFix从最少到最多修改次数依次搜索可能的修复方案。通过引入合并属性检查以提高效率,OrdinalFix的时间复杂度在应用中是可接受的。我们在两个数据集上评估了OrdinalFix,并证明了其在合理时间限制内修复编译错误的能力。与现有方法相比,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%).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。