Parameter passing and control stack management in Prolog implementation revisited

Author:

Zhou Neng-Fa1

Affiliation:

1. Kyushu Institute of Technology, Japan

Abstract

Parameter passing and control stack management are two of the crucial issues in Prolog implementation. In the Warren Abstract Machine (WAM), the most widely used abstract machine for Prolog implementation, arguments are passed through argument registers, and the information associated with procedure calls is stored in possibly two frames. Although accessing registers is faster than accessing memory, this scheme requires the argument registers to be saved and restored for back tracking and makes it difficult to implement full tail recursion elimination. These disadvantages may far outweigh the advantage in emulator-based implementations because registers are actually simulated by using memory. In this article, we reconsider the two crucial issues and describe a new abstract machine called ATOAM (yet Another Tree-Oriented Abstract Machine). The ATOAM differs from the WAM mainly in that (1) arguments are passed directly into stack frames, (2) only one frame is used for each procedure call, and (3) procedures are translated into matching trees is possible, and clauses in each procedure are indexed on all input arguments. The above-mentioned inefficiencies of the WAM do not exist in to he ATOAM because backtracking requires less bookkeeping operations, and tail recursion can be handled in most cases like a loop statement in procedural languages. An ATOAM-emulator-based Prolog system called B-Prolog has been implemented, which is available through anonymous ftp from ftp.kyutech.ac.jp (131.206.1.101) in the directory pub/Language/prolog .B-Prolog is comparable in performance with and can sometimes be significatly faster than emulated SICStus-Prolog. By measuring the numbers of memory and register references made in both systems, we found that passing arguments in stack is no worse than passing arguments in registers even if accessing memory is four times as expensive as accessing registers.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference21 articles.

1. AHO A. SETHI R. AND ULLMAN J. 1986. Compilers- Principles Techniques and Tools. Addison-Wesley Reading Mass. AHO A. SETHI R. AND ULLMAN J. 1986. Compilers- Principles Techniques and Tools. Addison-Wesley Reading Mass.

2. AIT-KACI H. 1991. Warren's Abstract Machine. MIT Press Cambridge Mass. AIT-KACI H. 1991. Warren's Abstract Machine. MIT Press Cambridge Mass.

3. CAMPBELL J. 1984. Implementations of Prolog. Ellis Horwood Chichester U.K. CAMPBELL J. 1984. Implementations of Prolog. Ellis Horwood Chichester U.K.

4. CARLSSON M. 1990. Design and implementation of an or-parMlel prolog engine. Ph.D. thesis S-16428 Swedish Institute of Computer Science Kista Sweden. CARLSSON M. 1990. Design and implementation of an or-parMlel prolog engine. Ph.D. thesis S-16428 Swedish Institute of Computer Science Kista Sweden.

5. CLARK I~. AND TARNLUND S. 1982. Logic Programming. Academic Press New York. CLARK I~. AND TARNLUND S. 1982. Logic Programming. Academic Press New York.

Cited by 14 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Fifty Years of Prolog and Beyond;Theory and Practice of Logic Programming;2022-05-17

2. On the Implementation of a Cloud-Based Computing Test Bench Environment for Prolog Systems;Information;2017-10-19

3. The language features and architecture of B-Prolog;Theory and Practice of Logic Programming;2011-09-12

4. Bibliography;Programming Language Pragmatics;2009

5. Linear tabling strategies and optimizations;Theory and Practice of Logic Programming;2007-08-06

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3