Implementation of Prolog as binary definite programs

  • Bart Demoen
  • André Mariën
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 592)


We describe how Prolog can be implemented with a simplified WAM, by transforming Prolog programs to binary definite programs. This removes all operations from the WAM which are related to environments, as environments are no longer needed for these transformed programs. The obvious catch is that the heap includes the information previously in the environments. We discuss the transformation scheme, including the treatment of disjunctions and cut and the primitives necessary to support the latter. We show how to implement built-in predicates and how to reintroduce optimizations lost in the general transformation. We show best and worst case behavior and a performance analysis for a selected program.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Bar]
    J. Barklund,’ Efficient interpretation of Prolog Programs’ Proc. of the SIGPLAN'87 Symp on Interpreters and Interpretative Techniques, St.Paul, 1987, pp 132–137Google Scholar
  2. [Deb]
    S. Debray,’ Register Allocation in a Prolog Machine'3SLP 1986Google Scholar
  3. [Dem]
    B. Demoen, “On the Transformation of a Prolog Program to a more efficient binary Program” April 1991, KUL-CW report 130Google Scholar
  4. [Mar]
    A. Marien, B. Demoen,’ On the Management of E and B in WAM’ Proceedings of NACLP'89 (North American Conference on Logic Programming, Cleveland, Ohio, oct 1989) p. 1030–1047Google Scholar
  5. [Tar]
    P. Tarau, M. Boyer,’ Elementary Logic Programs', proceedings of PLILP'90, pp. 159–173, (eds) P. Deransart & J. Maluszynski, Springer-Verlag 1990Google Scholar
  6. [Ven]
    R. Venken,’ A Prolog meta-interpreter for partial evaluation and its application to source-to-source transformation and query optimisation', Proc. ECAI'84, Pisa 1984Google Scholar
  7. [War]
    D.H.D. Warren,’ An Abstract Prolog Instruction Set’ Technical Report, SRI International, Artificial Intelligence Center, August 1983Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Bart Demoen
    • 1
  • André Mariën
    • 2
  1. 1.K.U.Leuven Department of Computer ScienceLeuvenBelgium
  2. 2.BIMEverbergBelgium

Personalised recommendations