Skip to main content

Implementation of Prolog as binary definite programs

  • Conference paper
  • First Online:
Logic Programming

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 592))

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. J. Barklund,’ Efficient interpretation of Prolog Programs’ Proc. of the SIGPLAN'87 Symp on Interpreters and Interpretative Techniques, St.Paul, 1987, pp 132–137

    Google Scholar 

  2. S. Debray,’ Register Allocation in a Prolog Machine'3SLP 1986

    Google Scholar 

  3. B. Demoen, “On the Transformation of a Prolog Program to a more efficient binary Program” April 1991, KUL-CW report 130

    Google Scholar 

  4. 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–1047

    Google Scholar 

  5. P. Tarau, M. Boyer,’ Elementary Logic Programs', proceedings of PLILP'90, pp. 159–173, (eds) P. Deransart & J. Maluszynski, Springer-Verlag 1990

    Google Scholar 

  6. R. Venken,’ A Prolog meta-interpreter for partial evaluation and its application to source-to-source transformation and query optimisation', Proc. ECAI'84, Pisa 1984

    Google Scholar 

  7. D.H.D. Warren,’ An Abstract Prolog Instruction Set’ Technical Report, SRI International, Artificial Intelligence Center, August 1983

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

A. Voronkov

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Demoen, B., Mariën, A. (1992). Implementation of Prolog as binary definite programs. In: Voronkov, A. (eds) Logic Programming. Lecture Notes in Computer Science, vol 592. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55460-2_12

Download citation

  • DOI: https://doi.org/10.1007/3-540-55460-2_12

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55460-8

  • Online ISBN: 978-3-540-47083-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics