OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability

09/13/2023
by   Wenjie Zhang, et al.
0

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 existing approaches (71.7

READ FULL TEXT
research
08/18/2020

Minimum Eccentricity Shortest Path Problem with Respect to Structural Parameters

The Minimum Eccentricity Shortest Path Problem consists in finding a sho...
research
03/04/2021

The Bounded Acceleration Shortest Path problem: complexity and solution algorithms

The purpose of this work is to introduce and characterize the Bounded Ac...
research
04/11/2022

Constrained Shortest Path and Hierarchical Structures

The Constraint Shortest Path (CSP) problem is as follows. An n-vertex gr...
research
10/12/2019

Reachability and Shortest Paths in the Broadcast CONGEST Model

In this paper we study the time complexity of the single-source reachabi...
research
03/28/2020

Single-Point Visibility Constraint Minimum Link Paths in Simple Polygons

We address the following problem: Given a simple polygon P with n vertic...

Please sign up or login with your details

Forgot password? Click here to reset