首页> 外文期刊>Theory and Practice of Logic Programming >Offline specialisation in Prolog using a hand-written compiler generator
【24h】

Offline specialisation in Prolog using a hand-written compiler generator

机译:使用手写编译器生成器在Prolog中进行离线专业化

获取原文

摘要

The so called "cogen approach" to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that the cogen approach is also applicable to the specialisation of logic programs (called partial deduction) and leads to effective specialisers. Moreover, using good binding-time annotations, the speed-ups of the specialised programs are comparable to the speed-ups obtained with online specialisers. The paper first develops a generic approach to offline partial deduction and then a specific offline partial deduction method, leading to the offline system LIX for pure logic programs. While this is a usable specialiser by itself, it is used to develop the cogen system LOGEN. Given a program, a specification of what inputs will be static, and an annotation specifying which calls should be unfolded, LOGEN generates a specialised specialiser for the program at hand. Running this specialiser with particular values for the static inputs results in the specialised program. While this requires two steps instead of one, the efficiency of the specialisation process is improved in situations where the same program is specialised multiple times. The paper also presents and evaluates an automatic binding-time analysis that is able to derive the annotations. While the derived annotations are still suboptimal compared to hand-crafted ones, they enable nonexpert users to use the LOGEN system in a fully automated way. Finally, LOGEN is extended so as to directly support a large part of Prolog's declarative and non-declarative features and so as to be able to perform so called mixline specialisations.
机译:用于程序专业化的所谓“ cogen方法”,即编写编译器生成器而不是专业化器,已在部分评估功能和命令式语言方面获得了相当大的成功。本文证明了余生方法也适用于逻辑程序的专业化(称为部分演绎),并导致了有效的专业化。此外,通过使用良好的绑定时间注释,专业程序的提速可与在线专家的提速媲美。本文首先开发了一种通用的离线部分推导方法,然后开发了一种特定的离线部分推导方法,从而形成了用于纯逻辑程序的离线系统LIX。虽然这本身就是一个可用的专家,但它可用于开发热基因系统LOGEN。给定一个程序,什么输入将是静态的规范以及指定应展开哪些调用的注释,LOGEN会为手头的程序生成一个专门的专家。使用特定的静态输入值运行此专家,将生成专门的程序。尽管这需要两个步骤而不是一个步骤,但是在同一程序被多次专门化的情况下,专门化过程的效率得以提高。本文还介绍并评估了能够导出注释的自动绑定时间分析。尽管与手工制作的注释相比,衍生的注释仍不理想,但它们使非专业用户能够以全自动方式使用LOGEN系统。最后,对LOGEN进行了扩展,以便直接支持Prolog的大部分声明性和非声明性功能,并能够执行所谓的混音专业化。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号