Lune

POPL2021Top-tier venue

On the complexity of bidirected interleaved Dyck-reachability

Yuanbo Li, Qirun Zhang, Thomas W. Reps

2021Year
12Citations
7Top-tier citations

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.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext c10af334-8245-42bd-9c82-84a0901c41d3

Cited by top-tier papers7

Ask how each one uses it

Builds on1

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines