A novel term compression scheme and data representation in the BinWAM

  • Paul Tarau
  • Ulrich Neumerkel
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 844)


In this paper we present the novel term representation of the BinWAM (a simplified WAM engine for executing binary logic programs) and evaluate its impact in BinProlog, a C-emulated system based on the BinWAM and on the mapping of logic programs to binary Prolog introduced in [13]. Terms in the BinWAM are compressed with a new technique called last argument overlapping which takes advantage of an unconventional untagged pointer representation, called tag-on-data. A Cheney-style copy-term algorithm using these term representations is described for BinProlog's fast copy once implementation of findall. While BinProlog's performance is competitive with the best commercial Prolog systems, its implementation is significantly simpler. Our analysis shows that this term representation and a limited amount of instruction folding on top of a reduced basic instruction set make the BinWAM a realistic alternative to its more complex forerunner.


implementation of Prolog WAM term representation last argument overlapping continuation passing style 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    A. Appel. Compiling with Continuations. Cambridge University Press, 1992.Google Scholar
  2. 2.
    M. Carlsson. Design and Implementation of an OR-Parallel Prolog Engine. Phd thesis, SICS, 1990.Google Scholar
  3. 3.
    C. J. Cheney. A nonrecursive list compacting algorithm. Communications of ACM, 11(13):677–678, Nov. 1970.Google Scholar
  4. 4.
    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
  5. 5.
    B. Demoen and A. Mariën. Implementation of Prolog as binary definite Programs. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 165–176, Berlin, Heidelberg, 1992. Springer-Verlag.Google Scholar
  6. 6.
    T. Dobry. A High Performance Architecture for Prolog. Phd thesis, University of California at Berkley, 1987.Google Scholar
  7. 7.
    A. Mariën. An Optimal Intermediate Code for Structure Creation in a WAM-based Prolog Implementation. Technical report, K.U.Leuven, May 1988.Google Scholar
  8. 8.
    U. Neumerkel. A transformation based on the equality between terms. In Logic Program Synthesis and Transformation, LOPSTR 1993. Springer-Verlag, 1993.Google Scholar
  9. 9.
    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, 7 1991.Google Scholar
  10. 10.
    P. Tarau. Ecological Memory Managment in a Continuation Passing Prolog Engine. In Y. Bekkers and J. Cohen, editors, Memory Management International Workshop IWMM 92 Proceedings, number 637 in Lecture Notes in Computer Science, pages 344–356. Springer, Sept. 1992.Google Scholar
  11. 11.
    P. Tarau. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 462–473, Berlin, Heidelberg, 1992. Springer-Verlag.Google Scholar
  12. 12.
    P. Tarau. Wam-optimizations in BinProlog: towards a realistic continuation passing prolog engine. Technical Report 92-3, Dept. d'Informatique, Université de Moncton, July 1992. available by ftp from Scholar
  13. 13.
    P. Tarau and M. Boyer. Elementary Logic Programs. In P. Deransart and J. Małuszyń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
  14. 14.
    P. Van Roy. Can Logic programming Execute as Fast as Imperative Programming. Phd thesis, University of California at Berkley, 1990.Google Scholar
  15. 15.
    M. Wand. Continuation-based program transformation strategies. Journal of the Association for Computing Machinery, 27(1):164–180, 1980.Google Scholar
  16. 16.
    D. H. D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Oct. 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Paul Tarau
    • 1
  • Ulrich Neumerkel
    • 2
  1. 1.Département d'InformatiqueUniversité de MonctonMonctonCanada
  2. 2.Institut für ComputersprachenTechnische Universität WienWienAustria

Personalised recommendations