arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.07132cs.PL
收藏

高阶求值器与抽象机之间的函数对应自动化

Automating the Functional Correspondence between Higher-Order Evaluators and Abstract Machines

Maciej Buszka, Dariusz Biernacki

摘要:

函数对应是一种将高阶赋值器转换为语义等价的抽象机的手工推导技术。该转换包括两个著名的程序转换:翻译为延续传递风格,揭示了控制流的评估和雷诺的去功能化,产生一阶过渡函数。自从Danvy等人第一次描述了这种转换以来,它已经在连接已知的求值器和抽象机方面找到了许多应用,而且在为各种$λ$ -演算以及逻辑编程、命令式和面向对象语言发现新的抽象机方面也找到了许多应用。我们提出了一个算法,自动化的功能对应。该算法接受一个专用的最小函数元语言编写的评估器,它首先将其转换为管理范式,这有利于程序分析,然后执行选择性翻译继续通过风格,并选择性去功能化。这两个选择性的转换是由一个控制流分析,这是由一个抽象的解释器使用抽象的抽象机器的方法,这使得它可以只转换所需的部分评估计算。本文附带了一个命令行工具形式的算法实现,该工具允许对嵌入Racket源文件中的求值器进行自动转换,并对生成的机器进行细粒度控制。

英文摘要:

The functional correspondence is a manual derivation technique transforming higher-order evaluators into the semantically equivalent abstract machines. The transformation consists of two well-known program transformations: translation to continuation-passing style that uncovers the control flow of the evaluator and Reynolds's defunctionalization that generates a first-order transition function. Ever since the transformation was first described by Danvy et al. it has found numerous applications in connecting known evaluators and abstract machines, but also in discovering new abstract machines for a variety of $λ$-calculi as well as for logic-programming, imperative and object-oriented languages. We present an algorithm that automates the functional correspondence. The algorithm accepts an evaluator written in a dedicated minimal functional meta-language and it first transforms it to administrative normal form, which facilitates program analysis, before performing selective translation to continuation-passing style, and selective defunctionalization. The two selective transformations are driven by a control-flow analysis that is computed by an abstract interpreter obtained using the abstracting abstract machines methodology, which makes it possible to transform only the desired parts of the evaluator. The article is accompanied by an implementation of the algorithm in the form of a command-line tool that allows for automatic transformation of an evaluator embedded in a Racket source file and gives fine-grained control over the resulting machine.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑