一句话:提出基于传递性符号的迭代-纪元在线环消除,动态压缩 CFL-可达性图并显著加速静态分析。
CFL-可达性是多种静态分析的基础,但其求解复杂度对图规模呈(次)立方级,且已有图简化多在预处理阶段进行,无法消除动态求解中才出现的可约简节点和边。本文提出在线环消除方法:由输入上下文无关文法识别传递性符号,据此发现可折叠的环,并给出迭代-纪元(iterative-epoch)框架,使其兼容标准无序求解器与最新有序求解器。在 C/C++ 上下文敏感值流分析和 Java 域敏感别名分析上,该技术显著加速并降低内存:标准求解器分别加速 17.17× 和 13.94×,内存减少 48.8% 和 45.0%;有序求解器分别加速 14.32× 和 8.36×,内存减少 55.2% 和 57.8%。
Context-free language reachability (CFL-reachability) is a fundamental framework for implementing various static analyses. CFL-reachability utilizes context-free grammar (CFG) to extend the expressiveness of ordinary graph reachability from an unlabeled graph to an edge-labeled graph. Solving CFL-reachability requires a (sub)cubic time complexity with respect to the graph size, which limits its scalability in practice. Thus, an approach that can effectively reduce the graph size while maintaining the reachability result is highly desirable. Most of the existing graph simplification techniques for CFL-reachability work during the preprocessing stage, i.e., before the dynamic CFL-reachability solving process. However, in real-world CFL-reachability analyses, there is a large number of reducible nodes and edges that can only be discovered during dynamic solving, leaving significant room for on-the-fly improvements. This paper aims to reduce the graph size of CFL-reachability dynamically via online cycle elimination. We propose a simple yet effective approach to detect collapsible cycles in the graph based on the input context-free grammar. Our key insight is that symbols with particular forms of production rules in the grammar are the essence of transitivity of reachability relations in the graph. Specifically, in the graph, a reachability relation to a node v_i can be "transited" to another node v_j if there is a transitive relation from v_i to v_j, and cycles formed by transitive relations are collapsible. In this paper, we present an approach to identify the transitive symbols in a context-free grammar and propose an iterative-epoch framework for online cycle elimination. From the perspective of non-parallelized CFL-reachability solving, our iterative-epoch framework is well compatible with both the standard (unordered) solver and the recent ordered solver, and can significantly improve their performance. Our experiment on context-sensitive value-flow analysis for C/C++ and field-sensitive alias analysis for Java demonstrates promising performance improvement by our iterative-epoch cycle elimination technique. By collapsing cycles online, our technique accelerates the standard solver by 17.17× and 13.94× for value-flow analysis and alias analysis, respectively, with memory reductions of 48.8% and 45.0%. Besides, our technique can also accelerate the ordered solver by 14.32× and 8.36× for value-flow analysis and alias analysis, respectively, with memory reductions of 55.2% and 57.8%.
@article{paperbot2567,
title = {Iterative-Epoch Online Cycle Elimination for Context-Free Language Reachability},
author = {Pei Xu and Yuxiang Lei and Yulei Sui and Jingling Xue},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA1},
year = {2024},
doi = {10.1145/3649862}
}