On the complexity of bidirected interleaved Dyck-reachability
Yuanbo Li, Qirun Zhang, Thomas W. Reps
Abstract
Many program analyses need to reason about pairs of matching actions, such as call/return, lock/unlock, or set-field/get-field. The family of Dyck languages ๐ท ๐ , where ๐ท ๐ has ๐ kinds of parenthesis pairs, can be used to model matching actions as balanced parentheses. Consequently, many program-analysis problems can be formulated as Dyck-reachability problems on edge-labeled digraphs. Interleaved Dyck-reachability (InterDyck-reachability), denoted by ๐ท ๐ โ ๐ท ๐ -reachability, is a natural extension of Dyck-reachability that allows one to formulate program-analysis problems that involve multiple kinds of matching-action pairs. Unfortunately, the general InterDyck-reachability problem is undecidable.
In this paper, we study variants of InterDyck-reachability on bidirected graphs, where for each edge โจ๐, ๐โฉ labeled by an open parenthesis "( ๐ ", there is an edge โจ๐, ๐โฉ labeled by the corresponding close parenthesis ") ๐ ", and vice versa. Language-reachability on a bidirected graph has proven to be useful both (i) in its own right, as a way to formalize many program-analysis problems, such as pointer analysis, and (ii) as a relaxation method that uses a fast algorithm to over-approximate language-reachability on a directed graph. However, unlike its directed counterpart, the complexity of bidirected InterDyck-reachability still remains open.
We establish the first decidable variant (i.e., ๐ท 1 โ ๐ท 1 -reachability) of bidirected InterDyck-reachability. In ๐ท 1 โ ๐ท 1 -reachability, each of the two Dyck languages is restricted to have only a single kind of parenthesis pair. In particular, we show that the bidirected ๐ท 1 โ ๐ท 1 -reachability problem is in PTIME. We also show that when one extends each Dyck language to involve ๐ different kinds of parentheses (i.e., ๐ท ๐ โ ๐ท ๐ -reachability with ๐ โฅ 2), the problem is NP-hard (and therefore much harder).
We have implemented the polynomial-time algorithm for bidirected ๐ท 1 โ ๐ท 1 -reachability. ๐ท 1 โ ๐ท 1reachability provides a new over-approximation method for bidirected ๐ท ๐ โ ๐ท ๐ -reachability in the sense that ๐ท ๐ โ ๐ท ๐ -reachability can first be relaxed to bidirected ๐ท 1 โ ๐ท 1 -reachability, and then the resulting bidirected ๐ท 1 โ ๐ท 1 -reachability problem is solved precisely. We compare this ๐ท 1 โ ๐ท 1 -reachability-based approach against another known over-approximating ๐ท ๐ โ ๐ท ๐ -reachability algorithm. Surprisingly, we found that the over-approximation approach based on bidirected ๐ท 1 โ ๐ท 1 -reachability computes more precise solutions, even though the ๐ท 1 โ ๐ท 1 formalism is inherently less expressive than the ๐ท ๐ โ ๐ท ๐ formalism.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext c10af334-8245-42bd-9c82-84a0901c41d3Cited by top-tier papers7
- Indexing the extended Dyck-CFL reachability for context-sensitive program analysisQingkai Shi, Yongchao Wang, Peisen Yao, Charles ZhangOOPSLA 2022 ยท 11 citations
- The Complexity of Bidirected Reachability in Valence SystemsMoses Ganardi, Rupak Majumdar, Georg ZetzscheLICS 2022 ยท 7 citations
- Single-Source-Single-Target Interleaved-Dyck Reachability via Integer Linear ProgrammingYuanbo Li, Qirun Zhang, Thomas W. RepsPOPL 2023 ยท 6 citations
- The Fine-Grained Complexity of CFL ReachabilityParaschos Koutris, Shaleen DeepPOPL 2023 ยท 6 citations
- Bounded Treewidth, Multiple Context-Free Grammars, and Downward ClosuresC. Aiswarya, Pascal Baumann, Prakash Saivasan, Lia Schรผtze et al.POPL 2026 ยท 1 citation
Builds on1
Related papers
- The decidability and complexity of interleaved bidirected Dyck reachabilityAdam Husted Kjelstrรธm, Andreas PavlogiannisPOPL 2022 ยท 17 citations
- Efficient algorithms for dynamic bidirected Dyck-reachabilityYuanbo Li, Kris Satya, Qirun ZhangPOPL 2022 ยท 8 citations
- On-the-Fly Static Analysis via Dynamic Bidirected Dyck ReachabilityShankaranarayanan Krishna, Aniket Lal, Andreas Pavlogiannis, Omkar TuppePOPL 2024 ยท 7 citations
- Context-Bounded Verification of Context-Free SpecificationsPascal Baumann, Moses Ganardi, Rupak Majumdar, Ramanathan S. Thinniyam et al.POPL 2023 ยท 3 citations
- Program Analysis via Multiple Context Free Language ReachabilityGiovanna Kobus Conrado, Adam Husted Kjelstrรธm, Jaco van de Pol, Andreas PavlogiannisPOPL 2025 ยท 2 citations
