Finding Fix Locations for CFL-Reachability Analyses via Minimum Cuts
Abstract
Static analysis tools are increasingly important for ensuring code quality. Ideally, all warnings from a static analysis would be addressed, but the volume of warnings and false positives usually makes this effort prohibitive. We present techniques for finding fix locations, a small set of program locations where fixes can be applied to address all static analysis warnings. We focus on analyses expressible as context-free-language reachability, where a set of fix locations is naturally expressed as a min-cut of the CFL graph. We show, surprisingly, that computing such a CFL min-cut is NP-hard. We then phrase the problem of finding CFL min-cuts as an optimization problem which allows us to trade-off the size of the cut vs. the preservation of computed information. We then show how to solve the optimization problem via a MaxSAT encoding. Our evaluation shows that we compute fix location sets that are significantly smaller than both the number of warnings and, in the case of a true CFL min-cut, the fix location sets from a normal min-cut.
BibTeX
@inproceedings{dan2017finding,
author = {Andrei Marian Dan and Manu Sridharan and Satish Chandra and Jean-Baptiste Jeannin and Martin T. Vechev},
title = {{Finding Fix Locations for CFL-Reachability Analyses via Minimum Cuts}},
booktitle = {CAV},
year = {2017},
doi = {10.1007/978-3-319-63390-9\_27},
}Ask Althea to put this paper to the test.
| OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability | arXiv · 2023 |
| A Study of Static Warning Cascading Tools (Experience Paper) | arXiv · 2023 |
| Optimal Dyck reachability for data-dependence and alias analysis | arXiv · 2019 |
| Memory-efficient fixpoint computation | Formal Methods Syst. Des · 2025 |
| PredicateFix: Repairing Static Analysis Alerts with Bridging Predicates | arXiv · 2025 |
| Mining Fix Patterns for FindBugs Violations | arXiv · 2017 |