Lune

PLDI2024顶会

Context-Free Language Reachability via Skewed Tabulation

Yuxiang Lei, Camille Bossut, Yulei Sui, Qirun Zhang

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis 引用了 Fast graph simplification for interleaved Dyck-reachability
  • Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis 引用了 Taming transitive redundancy for context-free language reachability
  • FlowCFL: generalized type-based reachability analysis: graph reduction and equivalence of CFL-based and type-based reachability 引用了 Fast graph simplification for interleaved Dyck-reachability
  • Taming transitive redundancy for context-free language reachability 引用了 Fast graph simplification for interleaved Dyck-reachability
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper4

  1. Fast graph simplification for interleaved Dyck-reachabilityYuanbo Li, Qirun Zhang, Thomas W. RepsPLDI 2020 · 30 次引用
  2. Taming transitive redundancy for context-free language reachabilityYuxiang Lei, Yulei Sui, Shuo Ding, Qirun ZhangOOPSLA 2022 · 16 次引用
  3. FlowCFL: generalized type-based reachability analysis: graph reduction and equivalence of CFL-based and type-based reachabilityAna L. MilanovaOOPSLA 2020 · 15 次引用
  4. Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability AnalysisChenghang Shi, Haofeng Li, Yulei Sui, Jie Lu 等ASE 2023 · 6 次引用

相关 Paper

  1. Recursive State Machine Guided Graph Folding for Context-Free Language ReachabilityYuxiang Lei, Yulei Sui, Shin Hwei Tan, Qirun ZhangPLDI 2023 · 15 次引用
  2. Iterative-Epoch Online Cycle Elimination for Context-Free Language ReachabilityPei Xu, Yuxiang Lei, Yulei Sui, Jingling XueOOPSLA 2024 · 3 次引用
  3. No Shot in the Dark: Efficient Context-Free Language Reachability via Context-Aware TabulationChenghang Shi, Lian LiICSE 2026
  4. Better Not Together: Staged Solving for Context-Free Language ReachabilityChenghang Shi, Haofeng Li, Jie Lu, Lian LiISSTA 2024 · 2 次引用
  5. Context-Free Language Reachability via Efficient Relation ChainingChenghang Shi, Haofeng Li, Jie Lu, Lian LiOOPSLA 2026
黄昏的海面,两侧是细线勾勒的悬崖