Skip to main content

WAM Local Analysis

  • Conference paper
  • First Online:
  • 276 Accesses

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

Abstract

The abstract interpretation framework has been used mainly in the global analysis of programs. Most often also, this interpretation is applied to the source Prolog program. In this paper we present an abstract interpretation of more local nature, and applied to the intermediate code (WAM). The purpose of obtaining a more efficient specialized version of the program remains the same as in global analysis approaches. Our specialization is multiple, meaning that we generate a different version for each entry pattern detected by analysis. This poly-variant unfolding of predicates allows the local (predicate level) analysis to propagate inter-procedurally relevant information. Besides time and complexity reduction of local versus global analysis, our approach is suited for goal-independent specialization, and for the partial selection of predicates to specialize. The evaluation of this more general specialization of programs in a full compiler shows that it is an alternative to global and goal-dependent methods.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

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

    Google Scholar 

  2. Mats Carlsson. Internals of Sicstus Prolog version 0.6. Internal Report, Gigalips Project, November 1987.

    Google Scholar 

  3. Mats Carlsson. Design and Implementation of an OR-Parallel Prolog Engine. SICS Dissertation Series 02, The Royal Institute of Technology, 1990.

    Google Scholar 

  4. Philippe Codognet and Daniel Diaz. wamcc: Compiling Prolog to C. In Leon Sterling, editor, Proc. of the 12th International Conference on Logic Programming, pages 317–332, Cambridge, June 13-18 1995. MIT Press.

    Google Scholar 

  5. 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 

  6. P. Cousot and R. Cousot. Abstract interpretation and application to logic programs. The Journal of Logic Programming, 13(1, 2, 3 and 4):103–179, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  7. S. K. Debray. Abstract Interpretation and Low-Level Code Optimization. In Proc. of PEPM’95, pages 111–121. ACM Press, June 1995.

    Google Scholar 

  8. M. Ferreira. Advanced Specialization Techniques for the Compilation of Declarative Languages . PhD thesis, Universidade do Porto, April 2002.

    Google Scholar 

  9. M. Ferreira and L. Damas. Multiple specialization of WAM code. Proc. of PADL’99, LNCS, 1551:243–258, 1999.

    Google Scholar 

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

    Article  Google Scholar 

  11. D. Jacobs, A. Langen, and W. Winsborough. Multiple specialization of logic programs with run-time tests. Proc. of ICLP’90, pages 717–731, June 1990.

    Google Scholar 

  12. A. Kelly, A. Macdonald, K. Marriott, P. Stuckey, and R. Yap. Effectiveness of optimizing compilation for CLP(R). Proc. of JICSLP’96, pages 37–51, 1996.

    Google Scholar 

  13. A. King and P. Soper. Depth-k sharing and freeness. In Proc. of the ICLP’94, pages 553–568. The MIT Press, 1994.

    Google Scholar 

  14. A. Krall and T. Berger. The VAMAI-an abstract machine for incremental global dataflow analysis of Prolog. In ICLP’95 Post-Conference Workshop on Abstract Interpretation of Logic Languages, pages 80–91, Tokyo, 1995.

    Google Scholar 

  15. 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 

  16. Thomas Lindgren. Polyvariant detection of uninitialized arguments of Prolog predicates. Journal of Logic Programming, 28(3):217–229, September 1996.

    Article  MATH  MathSciNet  Google Scholar 

  17. G. Puebla and M. Hermenegildo. Implementation of Multiple Specialization in Logic Programs. In Proc. of PEPM’95, pages 77–87. ACM Press, June 1995.

    Google Scholar 

  18. Taisuke Sato and Hisao Tamaki. Enumeration of success patterns in logic programs. Theoretical Computer Science, 34(1–2):227–240, November 1984.

    Article  MATH  MathSciNet  Google Scholar 

  19. 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 

  20. A. Taylor. Removal of Dereferencing and Trailing in Prolog Compilation. In Proc. of ICLP’89, pages 48–60, Lisbon, 1989. The MIT Press.

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  23. 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

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ferreira, M., Damas, L. (2003). WAM Local Analysis. In: Dahl, V., Wadler, P. (eds) Practical Aspects of Declarative Languages. PADL 2003. Lecture Notes in Computer Science, vol 2562. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36388-2_20

Download citation

  • DOI: https://doi.org/10.1007/3-540-36388-2_20

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-00389-2

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics