一句话:提出将迭代数据流分析机械翻译为代数程序分析的方法,保证正确且性能更优。
迭代数据流分析(IDA)广泛用于实践,但缺乏组合性,不利于频繁代码变更下的增量分析和大量查询。代数程序分析(APA)提供组合式求解,但手工构造 APA 算法费时易错且可能性能不佳。本文提出一种机械翻译方法,将 IDA 算法转换为能计算完全相同数据流事实的 APA 算法,并保证构造正确。方法适用于有限数据流事实且数据流函数对汇合操作(如集合并)可分配的问题,涵盖 Gen/Kill 类(到达定值、活跃变量、可用表达式)及非 Gen/Kill 类(复制常量传播、真活跃变量、可能初始化变量)。实验表明,翻译所得 APA 算法更简单易理解,且显著快于手工设计的 APA,尤其在增量分析中。
We propose a method for mechanically translating iterative dataflow analysis (IDA) algorithms to algebraic program analysis (APA) algorithms capable of computing exactly the same set of dataflow facts. The method is useful because while most of the dataflow analysis algorithms used in practice are expressed as iterative procedures, APA provides an alternative and inherently-compositional approach to solving dataflow problems, thus making it well suited for certain applications (e.g., incremental analysis of a program that goes through frequent code changes, or amortizing the cost of answering a large number of dataflow queries for the same program). However, manually crafting an APA algorithm not only is labor intensive and error prone but also can lead to suboptimal performance. Our method overcomes the limitation by providing a mechanical translation that guarantees to be correct by construction. Our method handles a broad class of dataflow analysis problems — the only requirements are that (1) the set of dataflow facts is finite and (2) the dataflow functions distribute over the confluence operation (e.g., set union). They include classical dataflow problems whose IDA algorithms can be expressed using Gen/Kill sets, such as reaching definitions, live variables, and available expressions. They also include non Gen/Kill problems such as copy constant propagation, truly-live variables, and possibly-initialized variables. Our experimental evaluation shows that the translated APA algorithms are not only simpler and easier to understand, but also significantly faster than manually-designed APA algorithms, especially for incremental program analysis.
@article{paperbot3851,
title = {Mechanically Translating Iterative Dataflow Analysis to Algebraic Program Analysis},
author = {Chenyu Zhou and Jingbo Wang and Chao Wang},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA1},
year = {2026},
doi = {10.1145/3798216}
}