Lune

PLDI2023Top-tier venue

Recursive State Machine Guided Graph Folding for Context-Free Language Reachability

Yuxiang Lei, Yulei Sui, Shin Hwei Tan, Qirun Zhang

Abstract

Context-free language reachability (CFL-reachability) is a fundamental framework for program analysis. A large variety of static analyses can be formulated as CFL-reachability problems, which determines whether specific source-sink pairs in an edge-labeled graph are connected by a reachable path, i.e., a path whose edge labels form a string accepted by the given CFL. Computing CFL-reachability is expensive. The fastest algorithm exhibits a slightly subcubic time complexity with respect to the input graph size. Improving the scalability of CFL-reachability is of practical interest, but reducing the time complexity is inherently difficult.

In this paper, we focus on improving the scalability of CFL-reachability from a more practical perspectivereducing the input graph size. Our idea arises from the existence of trivial edges, i.e., edges that do not affect any reachable path in CFL-reachability. We observe that two nodes joined by trivial edges can be folded-by merging the two nodes with all the edges joining them removed-without affecting the CFL-reachability result. By studying the characteristic of the recursive state machines (RSMs), an alternative form of CFLs, we propose an approach to identify foldable node pairs without the need to verify the underlying reachable paths (which is equivalent to solving the CFL-reachability problem). In particular, given a CFL-reachability problem instance with an input graph and an RSM, based on the correspondence between paths in and state transitions in RSM, we propose a graph folding principle, which can determine whether two adjacent nodes are foldable by examining only their incoming and outgoing edges.

On top of the graph folding principle, we propose an efficient graph folding algorithm Gf. The time complexity of Gf is linear with respect to the number of nodes in the input graph. Our evaluations on two clients (alias analysis and value-flow analysis) show that Gf significantly accelerates RSM/CFL-reachability by reducing the input graph size. On average, for value-flow analysis, Gf reduces 60.96% of nodes and 42.67% of edges of the input graphs, obtaining a speedup of 4.65× and a memory usage reduction of 57.35%. For alias analysis, Gf reduces 38.93% of nodes and 35.61% of edges of the input graphs, obtaining a speedup of 3.21× and a memory usage reduction of 65.19%.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis cites Fast graph simplification for interleaved Dyck-reachability
  • Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis cites Taming transitive redundancy for context-free language reachability
  • Boosting the Performance of Alias-Aware IFDS Analysis with CFL-Based Environment Transformers cites Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability Analysis
  • Boosting the Performance of Alias-Aware IFDS Analysis with CFL-Based Environment Transformers cites Fast graph simplification for interleaved Dyck-reachability
  • Boosting the Performance of Alias-Aware IFDS Analysis with CFL-Based Environment Transformers cites Taming transitive redundancy for context-free language reachability
  • Fast Graph Simplification for Path-Sensitive Typestate Analysis through Tempo-Spatial Multi-Point Slicing cites Flow2Vec: value-flow-based precise code embedding
  • Fast Graph Simplification for Path-Sensitive Typestate Analysis through Tempo-Spatial Multi-Point Slicing cites Fast graph simplification for interleaved Dyck-reachability
  • Taming transitive redundancy for context-free language reachability cites Fast graph simplification for interleaved Dyck-reachability
  • Efficient Abstract Interpretation via Selective Widening cites Flow2Vec: value-flow-based precise code embedding
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Two Birds with One Stone: Multi-Derivation for Fast Context-Free Language Reachability AnalysisChenghang Shi, Haofeng Li, Yulei Sui, Jie Lu et al.ASE 2023 · 6 citations
  2. Boosting the Performance of Alias-Aware IFDS Analysis with CFL-Based Environment TransformersHaofeng Li, Chenghang Shi, Jie Lu, Lian Li et al.OOPSLA 2024 · 6 citations
  3. Fast Graph Simplification for Path-Sensitive Typestate Analysis through Tempo-Spatial Multi-Point SlicingXiao Cheng, Jiawei Ren, Yulei SuiFSE 2024 · 4 citations
  4. Efficient Abstract Interpretation via Selective WideningJiawei Wang, Xiao Cheng, Yulei SuiOOPSLA 2025

Builds on3

  1. Flow2Vec: value-flow-based precise code embeddingYulei Sui, Xiao Cheng, Guanqin Zhang, Haoyu WangOOPSLA 2020 · 94 citations
  2. Fast graph simplification for interleaved Dyck-reachabilityYuanbo Li, Qirun Zhang, Thomas W. RepsPLDI 2020 · 30 citations
  3. Taming transitive redundancy for context-free language reachabilityYuxiang Lei, Yulei Sui, Shuo Ding, Qirun ZhangOOPSLA 2022 · 16 citations

Related papers

  1. Iterative-Epoch Online Cycle Elimination for Context-Free Language ReachabilityPei Xu, Yuxiang Lei, Yulei Sui, Jingling XueOOPSLA 2024 · 3 citations
  2. Context-Free Language Reachability via Skewed TabulationYuxiang Lei, Camille Bossut, Yulei Sui, Qirun ZhangPLDI 2024 · 5 citations
  3. Better Not Together: Staged Solving for Context-Free Language ReachabilityChenghang Shi, Haofeng Li, Jie Lu, Lian LiISSTA 2024 · 2 citations
  4. Fast Client-Driven CFL-Reachability via Regularization-Based Graph SimplificationChenghang Shi, Dongjie He, Haofeng Li, Jie Lu et al.OOPSLA 2025 · 2 citations
  5. Context-Free Language Reachability via Efficient Relation ChainingChenghang Shi, Haofeng Li, Jie Lu, Lian LiOOPSLA 2026
Dusk over the sea between two cliffs drawn in fine vertical lines