Staged abstract interpreters: fast and modular whole-program analysis via meta-programming
Staged abstract interpreters: fast and modular whole-program analysis via meta-programming
复制标题
分阶段抽象解释器:通过元编程进行快速、模块化的整个程序分析
DOI:
10.1145/3360552
复制
发表时间:
2019
影响因子:
--
通讯作者:
Tiark Rompf
中科院分区:
文献类型:
--
作者:
Guannan Wei;Yuxuan Chen;Tiark Rompf
It is well known that a staged interpreter is a compiler: specializing an interpreter to a given program produces an equivalent executable that runs faster. This connection is known as the first Futamura projection. It is even more widely known that an abstract interpreter is a program analyzer: tweaking an interpreter to run on abstract domains produces a sound static analysis. What happens when we combine these two ideas, and apply specialization to an abstract interpreter? In this paper, we present a unifying framework that naturally extends the first Futamura projection from concrete interpreters to abstract interpreters. Our approach derives a sound staged abstract interpreter based on a generic interpreter with type-level binding-time abstractions and monadic abstractions. By using different instantiations of these abstractions, the generic interpreter can flexibly behave in one of four modes: as an unstaged concrete interpreter, a staged concrete interpreter, an unstaged abstract interpreter, or a staged abstract interpreter. As an example of abstraction without regret, the overhead of these abstraction layers is eliminated in the generated code after staging. We show that staging abstract interpreters is practical and useful to optimize static analysis, all while requiring less engineering effort and without compromising soundness. We conduct three case studies, including a comparison with Boucher and Feeley’s abstract compilation, applications to various control-flow analyses, and a demonstration for modular analysis. We also empirically evaluate the effect of staging on the execution time. The experiment shows an order of magnitude speedup with staging for control-flow analyses.
影响因子:
--
作者:
S. Keidel;C. Bach Poulsen;S. Erdweg
通讯作者:
S. Erdweg