Tagging, Encoding, and Jones Optimality

Tagging, Encoding, and Jones Optimality
复制标题

标记、编码和琼斯最优性

DOI:
10.1007/3-540-36575-3_23
复制
发表时间:
2003
期刊:
European Symposium on Programming
影响因子:
--
通讯作者:
P. E. M. López
P. E. M. López
中科院分区:
--
文献类型:
--
作者:
O. Danvy;P. E. M. López

文献摘要

被引文献

相似文献

如果针对源程序专门化自解释程序的结果在文本上与源程序相同,模重命名,则称部分求值器是琼斯最优的。如果自解释程序是非类型化的,则已经获得了Jones最优。然而,如果自解释程序是打字的,那么剩余的程序就会被类型标签弄得乱七八糟。为了获得原始的源程序,必须去除这些标记。已经提出了许多复杂的解决方案。然而,我们观察到,通过简单的表示移动,普通部分评估已经是琼斯最优的,模编码。表示转换相当于将类型标记读取为更高级别抽象语法的构造器。我们通过考虑输入语法为高阶的类型化自解释器来证实我们的观察结果。相对于源程序专门化该解释器产生与源程序在文本上相同的残差程序,模重命名。
A partial evaluator is said to be Jones-optimal if the result of specializing a self-interpreter with respect to a source program is textually identical to the source program, modulo renaming. Jones optimality has already been obtained if the self-interpreter is untyped. If the selfinterpreter is typed, however, residual programs are cluttered with type tags. To obtain the original source program, these tags must be removed.A number of sophisticated solutions have already been proposed. We observe, however, that with a simple representation shift, ordinary partial evaluation is already Jones-optimal, modulo an encoding. The representation shift amounts to reading the type tags as constructors for higherorder abstract syntax. We substantiate our observation by considering a typed self-interpreter whose input syntax is higher-order. Specializing this interpreter with respect to a source program yields a residual program that is textually identical to the source program, modulo renaming.