[Paper Review] Optimal Dyck Reachability for Data-Dependence and Alias Analysis
This paper presents optimal algorithms for Dyck reachability in static analysis, achieving O(m + n·α(n)) time for bidirected graphs—improving prior bounds—and proving conditional optimality via reductions to Boolean Matrix Multiplication. It enables efficient context-sensitive data-dependence analysis with linear client-side cost after preprocessing, and demonstrates significant speedups and memory reductions in experiments on real-world benchmarks.
A fundamental algorithmic problem at the heart of static analysis is Dyck reachability. The input is a graphwhere the edges are labeled with different types of opening and closing parentheses, and the reachabilityinformation is computed via paths whose parentheses are properly matched. We present new results for Dyckreachability problems with applications to alias analysis and data-dependence analysis. Our main contributions,that include improved upper bounds as well as lower bounds that establish optimality guarantees, are asfollows:First, we consider Dyck reachability on bidirected graphs, which is the standard way of performing field-sensitive points-to analysis. Given a bidirected graph withnnodes andmedges, we present: (i) an algorithmwith worst-case running timeO(m+n·α(n)), whereα(n)is the inverse Ackermann function, improving thepreviously knownO(n2)time bound; (ii) a matching lower bound that shows that our algorithm is optimalwrt to worst-case complexity; and (iii) an optimal average-case upper bound ofO(m)time, improving thepreviously knownO(m·logn)bound.Second, we consider the problem of context-sensitive data-dependence analysis, where the task is to obtainanalysis summaries of library code in the presence of callbacks. Our algorithm preprocesses libraries in almostlinear time, after which the contribution of the library in the complexity of the client analysis is only linear,and only wrt the number of call sites.Third, we prove that combinatorial algorithms for Dyck reachability on general graphs with truly sub-cubic bounds cannot be obtained without obtaining sub-cubic combinatorial algorithms for Boolean MatrixMultiplication, which is a long-standing open problem. Thus we establish that the existing combinatorialalgorithms for Dyck reachability are (conditionally) optimal for general graphs. We also show that the samehardness holds for graphs of constant treewidth.Finally, we provide a prototype implementation of our algorithms for both alias analysis and data-dependenceanalysis. Our experimental evaluation demonstrates that the new algorithms significantly outperform allexisting methods on the two problems, over real-world benchmarks.
Motivation & Objective
- Address the fundamental challenge of Dyck reachability in static program analysis, which underpins alias and data-dependence analysis.
- Improve the worst-case and average-case time complexity for Dyck reachability on bidirected graphs, which model field-sensitive points-to analysis.
- Establish conditional optimality of existing combinatorial algorithms for general graphs by linking Dyck reachability to Boolean Matrix Multiplication.
- Enable efficient context-sensitive data-dependence analysis through library summarization, reducing client-side analysis cost to linear time.
- Demonstrate practical superiority of the proposed algorithms through a prototype implementation on real-world benchmarks.
Proposed method
- Design a new algorithm for Dyck reachability on bidirected graphs using a union-find data structure with path compression and union by rank, achieving O(m + n·α(n)) worst-case time.
- Prove a matching lower bound using a reduction from 3SUM, showing that the O(m + n·α(n)) bound is asymptotically optimal.
- Introduce an almost-linear time preprocessing phase for library code in data-dependence analysis, enabling linear-time client-side analysis regardless of library size.
- Leverage the constant treewidth property of program graphs to achieve almost-linear time complexity for data-dependence analysis.
- Use a reduction from Dyck reachability to Boolean Matrix Multiplication to show that truly sub-cubic combinatorial algorithms cannot be obtained without breakthroughs in BMM.
- Implement and evaluate the algorithms on real-world benchmarks using a prototype, comparing against TAL and CFL reachability approaches.
Experimental results
Research questions
- RQ1Can Dyck reachability on bidirected graphs be solved in sub-quadratic time, and is the bound tight?
- RQ2Can context-sensitive data-dependence analysis be made efficient by preprocessing libraries and summarizing their behavior?
- RQ3Is it possible to achieve truly sub-cubic time complexity for Dyck reachability on general graphs using combinatorial algorithms?
- RQ4Does the proposed algorithm outperform existing methods in practice, especially in terms of time and memory usage?
- RQ5Can the algorithm handle real-world programs with varying treewidth, including those with high treewidth in edge cases?
Key findings
- The proposed algorithm for bidirected graphs runs in O(m + n·α(n)) time, improving the previous O(n²) bound and matching a new lower bound, proving optimality.
- The algorithm achieves an optimal average-case time complexity of O(m), improving upon the prior O(m·log n) bound.
- For data-dependence analysis, the algorithm enables preprocessing of libraries in almost-linear time, reducing client-side analysis cost to linear time in the number of call sites.
- The algorithm achieves up to 630x speedup over CFL reachability and 30x over TAL reachability on the serial benchmark, which previously ran out of memory.
- Memory usage is drastically reduced: the algorithm uses only 130 MB on the serial benchmark, a 33x improvement over CFL reachability and over 90x over TAL.
- The improvements are not limited to callback-heavy code; the algorithm also outperforms CFL and TAL in non-callback scenarios, demonstrating broad applicability.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.