Lune

PLDI2024Top-tier venue

Context-Free Language Reachability via Skewed Tabulation

Yuxiang Lei, Camille Bossut, Yulei Sui, Qirun Zhang

2024Year
5Citations

Abstract

Context-free language reachability (CFL-reachability) is a prominent model for formulating program analysis problems. Almost all CFL-reachability algorithms are based on the Reps-Horwitz-Sagiv (RHS) tabulation. In essence, the RHS tabulation, based on normalized context-free grammars, is similar to the CYK algorithm for CFL-parsing. Consider a normalized rule ๐‘† ::= ๐ด ๐ต and a CFL-reachability problem instance of computing ๐‘†-edges in the input graph. The RHS tabulation obtains all summary edges (i.e., ๐‘†-, ๐ด-, and ๐ต-edges) based on the grammar rules. However, many ๐ด-and ๐ต-edges are wasted because only a subset of those edges eventually contributes to generating ๐‘†-edges in the input graph.

This paper proposes a new tabulation strategy for speeding up CFL-reachability by eliminating wasted and unnecessary summary edges. We particularly focus on recursive nonterminals. Our key technical insight is that the wasted edge generations and insertions caused by recursive nonterminals can be avoided by modifying the parse trees either statically (by transforming the grammar) or dynamically (using a specialized online CFL-reachability solver). For example, if a recursive nonterminal ๐ต, generated by a rule ๐ต ::= ๐ต ๐‘‹ , appears on the right-hand side of a rule ๐‘† ::= ๐ด ๐ต, we can make ๐‘† recursive (by introducing a new rule ๐‘† ::= ๐‘† ๐‘‹ ) and eliminate the original recursive rule (๐ต ::= ๐ต ๐‘‹ ). Due to the rule ๐‘† ::= ๐‘† ๐‘‹ , the shapes of the parse trees associated with the left-hand-side nonterminal ๐‘† become more "skewed". Thus, we name our approach skewed tabulation for CFL-reachability.

Skewed tabulation can significantly improve the scalability of CFL-reachability by reducing wasted and unnecessary summary edges. We have implemented skewed tabulation and applied the corresponding CFLreachability algorithm to an alias analysis, a value-flow analysis, and a taint analysis. Our extensive evaluation based on SPEC 2017 benchmarks yields promising results. For the three client analyses, CFL-reachability based on skewed tabulation can achieve 3.34ร—, 1.13ร— and 2.05ร— speedup over the state-of-the-art RHS-tabulationbased CFL-reachability solver and consume 60.05%, 20.38% and 63.06% less memory, respectively. Furthermore, the cost of grammar transformation for skewed tabulation is negligible, typically taking less than one second. CCS Concepts: โ€ข Theory of computation โ†’ Grammars and context-free languages.

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 65b8f039-1fe2-4513-aef8-490cc00e3618

Builds on4

Related papers

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