抽象解释器
Abstracting Definitional Interpreters
摘要:
在这个函数的珍珠,我们检查使用定义解释器作为抽象解释高阶程序设计语言的基础。事实证明,定义解释器,特别是那些以一元风格编写的解释器,可以为各种各样的收集语义、抽象解释、符号执行及其混合提供良好的基础。但这个故事的真正见解是对Alfredold的里程碑式论文《高阶程序设计语言的定义解释器》中的一个见解的重演,在这篇论文中,他观察到定义解释器使定义语言能够继承定义语言的属性。我们发现同样适用于定义的抽象解释。值得注意的是,我们观察到,抽象定义解释器可以继承所谓的“下推控制流”属性,其中函数调用和返回是精确匹配的抽象语义,简单地凭借定义语言的函数调用机制。在过去的十年里,第一个实现高阶语言这种属性的方法出现了,并且已经成为许多论文的主题。这些方法从状态机语义开始,并且一致地涉及重要的技术工程以恢复下推控制流的精度。相反,从定义解释器开始,下推控制流属性是元语言中固有的,不需要进一步的技术机制来实现。
英文摘要:
In this functional pearl, we examine the use of definitional interpreters as a basis for abstract interpretation of higher-order programming languages. As it turns out, definitional interpreters, especially those written in monadic style, can provide a nice basis for a wide variety of collecting semantics, abstract interpretations, symbolic executions, and their intermixings. But the real insight of this story is a replaying of an insight from Reynold's landmark paper, Definitional Interpreters for Higher-Order Programming Languages, in which he observes definitional interpreters enable the defined-language to inherit properties of the defining-language. We show the same holds true for definitional abstract interpreters. Remarkably, we observe that abstract definitional interpreters can inherit the so-called "pushdown control flow" property, wherein function calls and returns are precisely matched in the abstract semantics, simply by virtue of the function call mechanism of the defining-language. The first approaches to achieve this property for higher-order languages appeared within the last ten years, and have since been the subject of many papers. These approaches start from a state-machine semantics and uniformly involve significant technical engineering to recover the precision of pushdown control flow. In contrast, starting from a definitional interpreter, the pushdown control flow property is inherent in the meta-language and requires no further technical mechanism to achieve.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。