Implementation of Prolog as binary definite programs
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.
- [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
- [Deb]S. Debray,’ Register Allocation in a Prolog Machine'3SLP 1986Google Scholar
- [Dem]B. Demoen, “On the Transformation of a Prolog Program to a more efficient binary Program” April 1991, KUL-CW report 130Google Scholar
- [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
- [Tar]P. Tarau, M. Boyer,’ Elementary Logic Programs', proceedings of PLILP'90, pp. 159–173, (eds) P. Deransart & J. Maluszynski, Springer-Verlag 1990Google Scholar
- [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
- [War]D.H.D. Warren,’ An Abstract Prolog Instruction Set’ Technical Report, SRI International, Artificial Intelligence Center, August 1983Google Scholar