paperbot · PL 论文追踪

全部论文 待读 收藏

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

递归状态机引导的上下文无关语言可达性图折叠
PLDI 7(PLDI)2023匹配度 6/10 · 该论文属于静态程序分析与CFL可达性的基础方法研究,可服务于将静态分析应用于ML系统/Agentic程序的PL→AI方向,但本身不涉及LLM/Agent、浮点程序分析或贝叶斯程序分析,与画像中的核心交叉点距离较远。引用 15 inbox
Yuxiang Lei, Yulei Sui, Shin Hwei Tan, Qirun Zhang
crossref: 2026-09-10

AI 速览

一句话:提出由递归状态机引导的图折叠算法 GF,通过缩减输入图规模加速 CFL-reachability 程序分析。

上下文无关语言可达性(CFL-reachability)是许多静态分析的基础框架,但计算代价高,最快算法也仅略低于立方复杂度。本文从缩减输入图规模入手,观察到不影响可达路径的平凡边所连接节点可折叠。借助递归状态机(RSM)这种 CFL 等价形式,利用图中路径与 RSM 状态转移的对应关系,提出仅检查相邻节点入边与出边即可判定可折叠性的图折叠原则,无需验证可达路径,并给出线性时间算法 GF。在别名分析与值流分析上,GF 平均分别减少输入图 38.93%/60.96% 节点、35.61%/42.67% 边,取得 3.21×/4.65× 加速和 65.19%/57.35% 内存下降。

问题
CFL-reachability 是程序分析的重要基础,但其计算昂贵,最快算法仅略低于立方复杂度,提升可扩展性困难。
方法
利用 RSM 引导识别由平凡边连接的相邻节点对,提出仅检查入/出边即可判定的图折叠原则及线性时间算法 GF,从而缩减输入图规模。
评估
在别名分析和值流分析两个客户端上评估,报告节点/边缩减比例、加速比与内存下降。
原文摘要(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 perspective---reducing 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 G and an RSM, based on the correspondence between paths in G 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%.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1968,
  title = {Recursive State Machine Guided Graph Folding for Context-Free Language Reachability},
  author = {Yuxiang Lei and Yulei Sui and Shin Hwei Tan and Qirun Zhang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591233}
}