Ecological memory management in a continuation passing prolog engine

  • Paul Tarau
Logic Programming Languages II
Part of the Lecture Notes in Computer Science book series (LNCS, volume 637)


Starting from a simple ‘ecological’ metaphor, we introduce a new memory management scheme (heaplifting) implemented in BinProlog, a continuation passing style variant of WAM. We discuss copying garbage collection mechanisms based on heaplifting and an OR-parallel execution model. We point out some surprising similarities with related work on functional languages and the difficulties that arise in the context of nondeterministic execution. Finally, we describe the full implementation of two builtins: a recursive copy_term and a very fast heap-lifting based findall and we evaluate their impact on the performances of BinProlog.


WAM Prolog run time system continuation passing style compilation of Prolog fast builtins for Prolog copying garbage collection 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    K. A. M. Ali and R. Karlsson. The Muse Or-Parallel Prolog model and its performance. In S. Debray and M. Hermenegildo, editors, Proceedings of the 1990 North American Conference on Logic Programming, pages 757–776, Cambridge, Massachusetts London, England, 1990. MIT Press.Google Scholar
  2. 2.
    K. A. M. Ali and R. Karlsson. Scheduling Or-Parallelism in Muse. In K. Furukawa, editor, Proceedings of the Eighth International Conference on Logic Programming, pages 807–821, Cambridge, Massachusetts London, England, 1991. MIT Press.Google Scholar
  3. 3.
    A. Appel. A runtime system. Lisp and Symbolic Computation, (3):343–380, 1990.CrossRefGoogle Scholar
  4. 4.
    A. Appel. Compiling with Continuations. Cambridge University Press, 1992.Google Scholar
  5. 5.
    Y. Bekkers and L. Ungaro. Two real-time garbage collectors for a prolog system. In Proceedings of the Logic Programming Conference'91, pages 137–149. ICOT, Tokyo, Sept. 1991.Google Scholar
  6. 6.
    M. Carlsson. Design and Implementation of an OR-Parallel Prolog Engine. Phd thesis, SICS, 1990.Google Scholar
  7. 7.
    C. J. Cheney. A nonrecursive list compacting algorithm. Communications of ACM, 11(13):677–678, Nov. 1970.CrossRefGoogle Scholar
  8. 8.
    B. Demoen. On the transformation of a prolog program to a more efficient binary program. Technical Report 130, K.U.Leuven, Dec. 1990.Google Scholar
  9. 9.
    R. A. O'Keefe. The Craft of Prolog. MIT Press, 1990.Google Scholar
  10. 10.
    P. Tarau. Program transformations and WAM-support for the compilation of definite metaprograms. In Proceedings of the Russian Conference of Logic Programming. St-Petersbourg, Sept. 1991.Google Scholar
  11. 11.
    P. Tarau. A simplified abstract machine for the execution of binary metaprograms. In Proceedings of the Logic Programming Conference'91, pages 119–128. ICOT, Tokyo, Sept. 1991.Google Scholar
  12. 12.
    P. Tarau and M. Boyer. Elementary Logic Programs. In P. Deransart and J. Maluszyński, editors, Proceedings of Programming Language Implementation and Logic Programming, number 456 in Lecture Notes in Computer Science, pages 159–173. Springer, Aug. 1990.Google Scholar
  13. 13.
    D. Ungar and F. Jackson. Outwitting gc devils: A hybrid incremental garbage collector. OOPSLA '91 Garbage Collection Workshop Position Paper, 1991.Google Scholar
  14. 14.
    D. H. D. Warren. An abstract prolog instruction set. Technical Note 309, SRI International, Oct. 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Paul Tarau
    • 1
  1. 1.Université de MonctonMonctonCanada

Personalised recommendations