Skip to main content

Multiple Specialization of WAM Code

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1551))

Included in the following conference series:

Abstract

Program specialization is normally supported by global analysis of the program. Compilers use the information deduced to generate more efficient, specialized implementations of the program. This specialization can be single or multiple, depending if each procedure of the program is specialized into one or more versions. We present a Prolog compiler that does multiple specialization, using an algorithm that works over the WAM code, deducing the reachable procedure activations based on local analysis. The idea is to use the analysis that is done in the Prolog to WAM compilation, and that generates local specialized instructions, and to propagate this information through the entire program. The creation of multiple versions of predicates allows the propagation to be interprocedural, and to achieve global program specialization. Results from an implementation generating C code as target language are presented, showing a performance comparable to native code Prolog compilers.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Hassan Aït-Kaci. Warren’s Abstract Machine — A Tutorial Reconstruction. MIT Press, 1991.

    Google Scholar 

  2. M. Bruynooghe and G. Jenssens. An instance of abstract interpretation integrating type and mode inferencing. In Proc. of ICSLP’88, pages 669–683, Seattle, Washington, 1988. MIT Press.

    Google Scholar 

  3. Philippe Codognet and Daniel Diaz. wamcc: Compiling Prolog to C. In Proc. of ICLP’95. MIT Press, 1995.

    Google Scholar 

  4. P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. of SPPL’77, pages 238–252, Los Angeles, California, 1977.

    Google Scholar 

  5. S. K. Debray and D. S. Warren. Automatic mode inference for prolog programs. The Journal of Logic Programming, 5(3):78–88, September 1988.

    Article  MathSciNet  Google Scholar 

  6. D. Gudeman, K. De Bosschere, and S. Debray. jc: An efficient and portable sequential implementation of janus. In Joint International Conference and Symposium on Logic Programming, Washington, 1992. “MIT Press”.

    Google Scholar 

  7. B. Haussman. Turbo Erlang: Approaching the Speed of C. In Evan Tick, editor, Implementations of Logic Programming Systems. Kluwer, 1994.

    Google Scholar 

  8. M. Hermenegildo, R. Warren, and S. K. Debray. Global Flow Analysis as a Practical Compilation Tool. JLP, 13(4):349–367, August 1992.

    Google Scholar 

  9. D. Jacobs and A. Langen. Accurate and efficient approximation of variable aliasing in logic programs. In Proc. NACLP’89, pages 154–165. “MIT Press”, 1989.

    Google Scholar 

  10. A. Krall and U. Neumerkel. The Vienna Abstract Machine. In Proc. of PLIP”90, number 456 in LNCS, pages 121–135. Sweeden, Springer-Verlag, 1990.

    Google Scholar 

  11. C. S. Mellish. Abstract interpretation of prolog programs. In Proc of ICLP’86, number 225 in Lecture Notes in Computer Science. Springer-Verlag, 1986.

    Google Scholar 

  12. S. Peyton Jones, T. Nordin, and D. Oliva. C-: a portable assembly language. In [To appear in the proceedings of IFL’97]., St. Andrews, Scotland, 1997.

    Google Scholar 

  13. J. Tan and I. Lin. Compiling dataflow analysis of logic programs. In Proc. of PLDI’92, pages 106–115, San Francisco, California, 1992. SIGPLAN.

    Google Scholar 

  14. A. Taylor. High Performance Prolog Implementation. PhD thesis, University of Sydney, June 1991.

    Google Scholar 

  15. P. Van Roy. Can Logic Programming Execute as Fast as Imperative Programming? PhD thesis, University of California at Berkeley, November 1990.

    Google Scholar 

  16. P. Van Roy. 1983–1993: The Wonder Years of Sequential Prolog Implementation. The Journal of Logic Programming, 19/20, May/July 1994.

    Google Scholar 

  17. David H. D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, 1983.

    Google Scholar 

  18. W. H. Winsborough. Path-dependent reachability analysis for multiple specialization. In Proc. of NACLP’89. “MIT Press”, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ferreira, M., Damas, L. (1998). Multiple Specialization of WAM Code. In: Gupta, G. (eds) Practical Aspects of Declarative Languages. PADL 1999. Lecture Notes in Computer Science, vol 1551. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49201-1_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-49201-1_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65527-5

  • Online ISBN: 978-3-540-49201-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics