MetaCartSign in to MyCiteSeer

Include Citations | Advanced Search | Help

Include Citations | Advanced Search | Help

  Parameter Passing and Control Stack Management in Prolog Implementation Revisited (1996) [16 citations — 12 self]

Download:
Download as a PDF | Download as a PS
by Neng-fa Zhou
ACM Transactions on Programming Languages and Systems
http://www.cad.mse.kyutech.ac.jp/people/zhou/papers/toplas_zhou.ps.gz
Add To MetaCart

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 backtracking 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 if possible, and clauses in each procedure are indexed on all input arguments. The above-mentioned inefficiencies of the WAM do not exist in the 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 significantly 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.

Citations

97 Can Logic Programming Execute as Fast as Imperative Programming – Roy - 1990
53 Implementing Prolog − Compiling Predicate Logic Programs – Warren - 1977
45 Design of the Kernel Language for the Parallel Inference Machine – Ueda, Chikayama - 1990
37 Design and Implementation of an Or-Parallel Prolog Engine – Carlsson - 1990
34 Warren's Abstract Machine – Ait-Kaci - 1991
27 Removal of dereferencing and trailing in Prolog compilation – Taylor - 1989
25 Global Compilation of Prolog – Hickey, Mudambi - 1989
23 Logic Programming – Clark - 1982
21 Unfold/Fold Transformations and Loop Optimization of Logic Programs – Debray - 1988
12 Recursion vs. Iteration in Prolog – Meier - 1991
9 A simplified abstract machine for the execution of binary metaprograms – Tarau - 1991
9 A novel implementation method of delay – Zhou - 1996
8 Incremental global compilation of Prolog with the Vienna abstract machine – Krall, Berger - 1995
7 On the scheme of passing arguments in stack frames for Prolog – Zhou - 1994
3 Global optimizations in a prolog compiler for the toam – Zhou - 1993
1 On the management of choice point and environment frames in the wam – Marien, A, et al. - 1990
1 1983-1993: The wonder years of sequential prolog implementation – thesis - 1994
1 Aquarius benchmarks. Available by anonymous ftp from gatekeeper.dec.com in pub/plan/prolog/AquariusBenchmarks.tar.Z – Roy - 1995
1 An abstract Prolog instruction set – Edinburgh, Edinburgh, et al. - 1983