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

抽象机在Prolog语言中的描述与优化

Description and Optimization of Abstract Machines in a Dialect of Prolog

Jose F. Morales, Manuel Carro, Manuel Hermenegildo

摘要:

为了实现有竞争力的性能,Prolog和相关语言的抽象机器最终变得庞大而复杂,并在设计和实现级别都包含复杂的优化。同时,效率方面的考虑使得有必要在其实现中使用低级语言。这使得它们很难编码、优化,尤其是维护和扩展。用高级语言编写抽象机器(和辅助代码)可以帮助驯服这种固有的复杂性。我们展示了如何使用Prolog的一个有效的虚拟机的最基本的组件的语义可以描述(的变体)Prolog。然后将这些描述编译成C语言,并组装成一个完整的字节码仿真器。由于所使用的语言的高级别及其与Prolog的接近性,抽象机器描述可以使用标准Prolog编译和优化技术相对容易地进行操作。我们还展示了如何通过有选择地应用程序转换,我们获得抽象的机器实现,其性能可以匹配,甚至超过最先进的,高度调整的,手工制作的仿真器。

英文摘要:

In order to achieve competitive performance, abstract machines for Prolog and related languages end up being large and intricate, and incorporate sophisticated optimizations, both at the design and at the implementation levels. At the same time, efficiency considerations make it necessary to use low-level languages in their implementation. This makes them laborious to code, optimize, and, especially, maintain and extend. Writing the abstract machine (and ancillary code) in a higher-level language can help tame this inherent complexity. We show how the semantics of most basic components of an efficient virtual machine for Prolog can be described using (a variant of) Prolog. These descriptions are then compiled to C and assembled to build a complete bytecode emulator. Thanks to the high level of the language used and its closeness to Prolog, the abstract machine description can be manipulated using standard Prolog compilation and optimization techniques with relative ease. We also show how, by applying program transformations selectively, we obtain abstract machine implementations whose performance can match and even exceed that of state-of-the-art, highly-tuned, hand-crafted emulators.

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

↑