Affiliation:
1. Georgia Institute of Technology, USA
Abstract
Dyck-reachability is a fundamental formulation for program analysis, which has been widely used to capture properly-matched-parenthesis program properties such as function calls/returns and field writes/reads. Bidirected Dyck-reachability is a relaxation of Dyck-reachability on
bidirected graphs
where each edge
u
→
(
i
v
labeled by an open parenthesis “(
i
” is accompanied with an inverse edge
v
→
)
i
u
labeled by the corresponding close parenthesis “)
i
”, and vice versa. In practice, many client analyses such as alias analysis adopt the bidirected Dyck-reachability formulation. Bidirected Dyck-reachability admits an optimal reachability algorithm. Specifically, given a graph with
n
nodes and
m
edges, the optimal bidirected Dyck-reachability algorithm computes
all-pairs
reachability information in
O
(
m
) time.
This paper focuses on the dynamic version of bidirected Dyck-reachability. In particular, we consider the problem of maintaining all-pairs Dyck-reachability information in bidirected graphs under a sequence of edge insertions and deletions. Dynamic bidirected Dyck-reachability can formulate many program analysis problems in the presence of code changes. Unfortunately, solving dynamic graph reachability problems is challenging. For example, even for maintaining transitive closure, the fastest deterministic dynamic algorithm requires
O
(
n
2
) update time to achieve
O
(1) query time. All-pairs Dyck-reachability is a generalization of transitive closure. Despite extensive research on incremental computation, there is no algorithmic development on dynamic graph algorithms for program analysis with worst-case guarantees.
Our work fills the gap and proposes the first dynamic algorithm for Dyck reachability on bidirected graphs. Our dynamic algorithms can handle each graph update (
i.e.
, edge insertion and deletion) in
O
(
n
·α(
n
)) time and support any all-pairs reachability query in
O
(1) time, where α(
n
) is the inverse Ackermann function. We have implemented and evaluated our dynamic algorithm on an alias analysis and a context-sensitive data-dependence analysis for Java. We compare our dynamic algorithms against a straightforward approach based on the
O
(
m
)-time optimal bidirected Dyck-reachability algorithm and a recent incremental Datalog solver. Experimental results show that our algorithm achieves orders of magnitude speedup over both approaches.
Funder
NSF
Defense Advanced Research Projects Agency
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. On-the-Fly Static Analysis via Dynamic Bidirected Dyck Reachability;Proceedings of the ACM on Programming Languages;2024-01-05
2. Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis;2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE);2023-09-11
3. Multi-channel Integrated Recommendation with Exposure Constraints;Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining;2023-08-04