LAM: another Prolog abstract machine

X. Li, Y. Yao
{"title":"LAM: another Prolog abstract machine","authors":"X. Li, Y. Yao","doi":"10.1109/CCECE.1996.548099","DOIUrl":null,"url":null,"abstract":"The Warren Abstract Machine has been accepted as the de facto standard for implementing Prolog for more than ten years. The WAM adopts structure copying to represent Prolog terms. It flattens nested structures and expands them into efficient WAM instructions which either copy terms into the heap or unify terms along the heap pointer. When two terms to be unified are structure instances in the heap, the WAM must invoke a built-in procedure to carry out the stack based full unification. We propose a new Prolog execution model-the Lakehead Abstract Machine. The LAM is designed to retain the control features of the WAM, but the structure copying is replaced by program sharing for implementing unification. The idea of program sharing is originated from the structure sharing used in the DEC-10 Prolog. The significant difference, however, is that the shared resources are no longer structure prototypes, but executable LAM code. With the LAM, nested structures are flattened and then translated into a set of subprograms. In constructing a structure, the LAM only puts its corresponding subprogram pointer into the heap. When two terms to be unified are structures, their bound subprograms will be invoked. We have implemented an experimental LAM emulator in C. Benchmarks show that the LAM based Prolog implementation is quite competitive with the WAM based systems, such as SICStus and BIN-Prolog.","PeriodicalId":269440,"journal":{"name":"Proceedings of 1996 Canadian Conference on Electrical and Computer Engineering","volume":"52 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1996-05-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of 1996 Canadian Conference on Electrical and Computer Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/CCECE.1996.548099","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

The Warren Abstract Machine has been accepted as the de facto standard for implementing Prolog for more than ten years. The WAM adopts structure copying to represent Prolog terms. It flattens nested structures and expands them into efficient WAM instructions which either copy terms into the heap or unify terms along the heap pointer. When two terms to be unified are structure instances in the heap, the WAM must invoke a built-in procedure to carry out the stack based full unification. We propose a new Prolog execution model-the Lakehead Abstract Machine. The LAM is designed to retain the control features of the WAM, but the structure copying is replaced by program sharing for implementing unification. The idea of program sharing is originated from the structure sharing used in the DEC-10 Prolog. The significant difference, however, is that the shared resources are no longer structure prototypes, but executable LAM code. With the LAM, nested structures are flattened and then translated into a set of subprograms. In constructing a structure, the LAM only puts its corresponding subprogram pointer into the heap. When two terms to be unified are structures, their bound subprograms will be invoked. We have implemented an experimental LAM emulator in C. Benchmarks show that the LAM based Prolog implementation is quite competitive with the WAM based systems, such as SICStus and BIN-Prolog.
LAM:另一个Prolog抽象机器
Warren抽象机已经被接受为实现Prolog的事实上的标准超过十年。WAM采用结构复制来表示Prolog项。它使嵌套结构扁平化,并将它们扩展成有效的WAM指令,这些指令要么将术语复制到堆中,要么沿着堆指针统一术语。当两个要统一的术语是堆中的结构实例时,WAM必须调用一个内置过程来执行基于堆栈的完全统一。提出了一种新的Prolog执行模型——湖头抽象机。LAM被设计为保留WAM的控制特性,但是为了实现统一,结构复制被程序共享所取代。程序共享的思想起源于DEC-10 Prolog中使用的结构共享。然而,显著的区别在于,共享资源不再是结构原型,而是可执行的LAM代码。使用LAM,嵌套结构被平面化,然后转换成一组子程序。在构造结构时,LAM只将其相应的子程序指针放入堆中。当两个要统一的术语是结构时,将调用它们的绑定子程序。我们已经在c语言中实现了一个实验性的LAM模拟器。基准测试表明,基于LAM的Prolog实现与基于WAM的系统(如SICStus和BIN-Prolog)相当有竞争力。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信