Lune

POPL2025Top-tier venue

Program Analysis via Multiple Context Free Language Reachability

Giovanna Kobus Conrado, Adam Husted Kjelstrรธm, Jaco van de Pol, Andreas Pavlogiannis

2025Year
2Citations
3Top-tier citations

Abstract

Context-free language (CFL) reachability is a standard approach in static analyses, where the analysis question (e.g., is there a dataflow from ๐‘ฅ to ๐‘ฆ?) is phrased as a language reachability problem on a graph ๐บ wrt a CFL L. However, CFLs lack the expressiveness needed for high analysis precision. On the other hand, common formalisms for context-sensitive languages are too expressive, in the sense that the corresponding reachability problem becomes undecidable. Are there useful context-sensitive language-reachability models for static analysis?

In this paper, we introduce Multiple Context-Free Language (MCFL) reachability as an expressive yet tractable model for static program analysis. MCFLs form an infinite hierarchy of mildly context sensitive languages parameterized by a dimension ๐‘‘ and a rank ๐‘Ÿ . Larger ๐‘‘ and ๐‘Ÿ yield progressively more expressive MCFLs, offering tunable analysis precision. We showcase the utility of MCFL reachability by developing a family of MCFLs that approximate interleaved Dyck reachability, a common but undecidable static analysis problem.

Given the increased expressiveness of MCFLs, one natural question pertains to their algorithmic complexity, i.e., how fast can MCFL reachability be computed? We show that the problem takes ๐‘‚ (๐‘› 2๐‘‘+1 ) time on a graph of ๐‘› nodes when ๐‘Ÿ = 1, and ๐‘‚ (๐‘› ๐‘‘ (๐‘Ÿ +1) ) time when ๐‘Ÿ > 1. Moreover, we show that when ๐‘Ÿ = 1, even the simpler membership problem has a lower bound of ๐‘› 2๐‘‘ based on the Strong Exponential Time Hypothesis, while reachability for ๐‘‘ = 1 has a lower bound of ๐‘› 3 based on the combinatorial Boolean Matrix Multiplication Hypothesis. Thus, for ๐‘Ÿ = 1, our algorithm is optimal within a factor ๐‘› for all levels of the hierarchy based on the dimension ๐‘‘ (and fully optimal for ๐‘‘ = 1).

We implement our MCFL reachability algorithm and evaluate it by underapproximating interleaved Dyck reachability for a standard taint analysis for Android. When combined with existing overapproximate methods, MCFL reachability discovers all tainted information on 8 out of 11 benchmarks, while it has remarkable coverage (confirming 94.3% of the reachable pairs reported by the overapproximation) on the remaining 3. To our knowledge, this is the first report of high and provable coverage for this challenging benchmark set. CCS Concepts: โ€ข Software and its engineering โ†’ Software verification and validation; โ€ข Theory of computation โ†’ Theory and algorithms for application domains.

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.

Cited by top-tier papers3

Ask how each one uses it

Builds on6

Related papers

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