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)
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