Skip to main content

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

Abstract

In this work, we develop a binding-time analysis for the logic programming language Mercury. We introduce a precise domain of binding-times, based on the type information available in Mercury programs, that allows the analyser to reason with partially static data structures. The analysis is polyvariant, and deals with the module structure and higher-order capabilities of Mercury programs.

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. Andersen, L.O.: Binding-time analysis and the taming of C pointers. In: PEPM 1993, pp. 47–58. ACM, New York (1993)

    Chapter  Google Scholar 

  2. Asai, K.: Binding-time analysis for both static and dynamic expressions. New Generation Computing 20(1), 27–52 (2001)

    Article  Google Scholar 

  3. Asai, K.: Binding-time analysis for both static and dynamic expressions. In: Static Analysis Symposium, pp. 117–133 (1999)

    Google Scholar 

  4. Bondorf, A.: Automatic autoprojection of higher order recursive equations. Science of Computer Programming 17, 3–34 (1991)

    Article  MATH  Google Scholar 

  5. Bondorf, A., Jørgensen, J.: Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming 3(3), 315–346 (1993)

    Article  Google Scholar 

  6. Bruynooghe, M., Leuschel, M., Sagonas, K.: A polyvariant binding-time analysis for off-line partial deduction. In: Hankin, C. (ed.) ESOP 1998. M. Bruynooghe, M. Leuschel, K. Sagonas, vol. 1381, pp. 27–41. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  7. Bruynooghe, M., Vanhoof, W., Codish, M.: Pos(T): Analyzing dependencies in typed logic programs. In: Bjørner, D., Broy, M., Zamulin, A.V. (eds.) PSI 2001. LNCS, vol. 2244, pp. 406–420. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  8. Bueno, F., de la Banda, M., Hermenegildo, M., Marriott, K., Puebla, G., Stuckey, P.: A model for inter-module analysis and optimizing compilation. In: Lau, K.-K. (ed.) LOPSTR 2000. LNCS, vol. 2042, pp. 64–71. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  9. Consel, C.: Binding time analysis for higher order untyped functional languages. In: 1990 ACM Conference on Lisp and Functional Programming, Nice, France, pp. 264–272. ACM, New York (1990)

    Chapter  Google Scholar 

  10. Consel, C., et al.: A uniform approach for compile-time and run-time specialization. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 54–72. Springer, Heidelberg (1996)

    Google Scholar 

  11. Conway, T., Henderson, F., Somogyi, Z.: Code generation for Mercury. In: Lloyd, J. (ed.) Proceedings of the International Symposium on Logic Programming, pp. 242–256. MIT Press, Cambridge (1995)

    Google Scholar 

  12. Dussart, D., Heldal, R., Hughes, J.: Module-sensitive program specialisation. In: SIGPLAN 1997 Conference on Programming Language Design and Implementation, Las Vegas, June 1997, pp. 206–214. ACM, New York (1997)

    Chapter  Google Scholar 

  13. Futamura, Y.: Partial evaluation of a computation process — an approach to a compiler-compiler. Systems, Computers, Controls 2(5), 45–50 (1971)

    Google Scholar 

  14. Glück, R., Jørgensen, J.: An automatic program generator for multi-level specialization. Lisp and Symbolic Computation 10, 113–158 (1997)

    Article  Google Scholar 

  15. Gomard, C.K., Jones, N.D.: A partial evaluator for the untyped lambda-calculus. Journal of Functional Programming 1(1), 21–69 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  16. Heintze, N.: Set-based analysis of ML programs. In: ACM Conference on Lisp and Functional Programming, pp. 306–317 (1994)

    Google Scholar 

  17. Henglein, F.: Efficient type inference for higher-order binding-time analysis. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 448–472. Springer, Heidelberg (1991)

    Google Scholar 

  18. Henglein, F.: Simple closure analysis. Technical Report D-193, DIKU Semantics Report (1992)

    Google Scholar 

  19. Henglein, F., Mossin, C.: Polymorphic binding-time analysis. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 287–301. Springer, Heidelberg (1994)

    Google Scholar 

  20. Hornof, L., Noyé, J.: Accurate binding-time analysis for imperative languages: Flow, context, and return sensitivity. In: PEPM 1997, pp. 63–73. ACM, New York (1997)

    Chapter  Google Scholar 

  21. Jacobs, D., Langen, A.: Static analysis of logic programs for independent AND-parallelism. Journal of Logic Programming 13(2 &3), 291–314 (1992)

    Article  MATH  Google Scholar 

  22. Janssens, G., Bruynooghe, M.: Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming 13(2&3), 205–258 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  23. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)

    MATH  Google Scholar 

  24. Jones, N.D., Sestoft, P., Søndergaard, H.: An experiment in partial evaluation: The generation of a compiler generator. In: Jouannaud, J.-P. (ed.) RTA 1985. LNCS, vol. 202, pp. 124–140. Springer, Heidelberg (1985)

    Google Scholar 

  25. Jørgensen, J., Leuschel, M.: Efficiently generating efficient generating extensions in Prolog. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 238–262. Springer, Heidelberg (1996)

    Google Scholar 

  26. Lagoon, V., Mesnard, F., Stuckey, P.: Termination analysis with types is more accurate. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 254–268. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  27. Lakshman, T.K., Reddy, U.S.: Typed Prolog: A semantic reconstruction of the Mycroft-O’Keefe type system. In: Saraswat, K., Ueda, V. (eds.) Proceedings of the 1991 International Symposium on Logic Programming (ISLP 1991), San Diego, CA, pp. 202–220. MIT Press, Cambridge (1991)

    Google Scholar 

  28. Launchbury, J.: Dependent sums express separation of binding times. In: Davis, K., Hughes, J. (eds.) Functional Programming, Glasgow, Scotland, pp. 238–253. Springer, Heidelberg (1989/1990)

    Google Scholar 

  29. Leuschel, M., Craig, S.J., Bruynooghe, M., Vanhoof, W.: Specializing interpreters using offline partial deduction. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 340–375. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  30. Leuschel, M., Jørgensen, J., Vanhoof, W., Bruynooghem, M.: Offline specialisation in Prolog using a hand-written compiler generator. Theory and Practice of Logic Programming 4(1), 139–191 (2002)

    Google Scholar 

  31. Lloyd, J.W.: Declarative error diagnosis. New Generation Computing 5, 133–154 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  32. Mogensen, T.: Binding Time Analysis for Polymorphically Typed Higher Order Languages. In: Díaz, J., Orejas, F. (eds.) TAPSOFT 1989 and CCIPL 1989. LNCS, vol. 352, pp. 298–312. Springer, Heidelberg (1989)

    Google Scholar 

  33. Mogensen, T., Bondorf, A.: Logimix: A self-applicable partial evaluator for Prolog. In: Leuschel, M. (ed.) LOPSTR 2002. LNCS, vol. 2664, pp. 214–227. Springer, Heidelberg (2003)

    Google Scholar 

  34. Mycroft, A., O’Keefe, R.A.: A polymorphic type system for Prolog. Artificial Intelligence 23(3), 295–307 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  35. Palsberg, J.: Closure analysis in constraint form. ACM Transactions on Programming Languages and Systems 17(1), 47–62 (1995)

    Article  Google Scholar 

  36. Puebla, G., Hermenegildo, M.: Some issues in analysis and specialization of modular Ciao-Prolog programs. In: Leuschel, M. (ed.) Proceedings of the Workshop on Optimization and Implementation of Declarative Languages, Las Cruces. Electronic Notes in Theoretical Computer Science, vol. 30(2), Elsevier Science, Amsterdam (1999)

    Google Scholar 

  37. Smaus, J.-G.: Analysis of polymorphically typed logic programs using ACIunification. In: Nieuwenhuis, R., Voronkov, A. (eds.) LPAR 2001. LNCS (LNAI), vol. 2250, pp. 280–295. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  38. Smaus, J.-G., Hill, P.M., King, A.: Mode Analysis Domains for Typed Logic Programs. In: Logic Program Synthesis and Transformation, pp. 82–101 (1999)

    Google Scholar 

  39. Somogyi, Z.: A system of precise modes for logic programs. In: International Conference on Logic Programming, pp. 769–787 (1987)

    Google Scholar 

  40. Somogyi, Z., et al.: The Melbourne Mercury compiler, release 0.9

    Google Scholar 

  41. Somogyi, Z., Henderson, F., Conway, T.: The implementation of Mercury, an efficient purely declarative logic programming language. In: Proceedings of the ILPS 1994 Postconference Workshop on Implementation Techniques for Logic Programming Languages (1994)

    Google Scholar 

  42. Somogyi, Z., Henderson, F., Conway, T.: Logic programming for the real world. In: Proceedings of the ILPS 1995 Postconference Workshop on Visions for the Future of Logic Programming (1995)

    Google Scholar 

  43. Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming 29(1-3), 17–64 (1996)

    Article  MATH  Google Scholar 

  44. Somogyi, Z., Henderson, F., Conway, T., Bromage, A., Dowd, T., Jeffery, D., Ross, P., Schachte, P., Taylor, S.: Status of the Mercury system. In: Proceedings of the JICSLP 1996 Workshop on Parallelism and Implementation Technology for (Constraint) Logic Programming Languages (1996)

    Google Scholar 

  45. Van Hentenryck, P., Cortesi, A., Le Charlier, B.: Type analysis of Prolog using type graphs. Journal of Logic Programming 22(3), 179–209 (1995)

    Article  MATH  Google Scholar 

  46. Vanhoof, W.: Binding-time analysis by constraint solving: a modular and higherorder approach for Mercury. In: Parigot, M., Voronkov, A. (eds.) LPAR 2000. LNCS (LNAI), vol. 1955, pp. 399–416. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  47. Vanhoof, W., Bruynooghe, M.: Binding-time analysis for Mercury. In: De Schreye, D. (ed.) 16th International Conference on Logic Programming, pp. 500–514. MIT Press, Cambridge (1999)

    Google Scholar 

  48. Vanhoof, W., Bruynooghe, M.: Binding-time analysis for Mercury. In: Preproceedings of LOPSTR 1999, Venice, Italy, Technical Report, University of Venice (1999)

    Google Scholar 

  49. Vanhoof, W.: Techniques for on- and off-line specialisation of logic programs. Phd, Department of Computer Science, K.U.Leuven, Leuven, Belgium, June 2001, pp : xiv+323+xxxiii (2001)

    Google Scholar 

  50. Vanhoof, W., Bruynooghe, M.: Binding-time annotations without binding-time analysis. In: Nieuwenhuis, R., Voronkov, A. (eds.) LPAR 2001. LNCS (LNAI), vol. 2250, pp. 707–722. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  51. Vanhoof, W., Bruynooghe, M.: When size does matter - Termination analysis for typed logic programs. In: Pettorossi, A. (ed.) LOPSTR 2001. LNCS, vol. 2372, pp. 129–147. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Vanhoof, W., Bruynooghe, M., Leuschel, M. (2004). Binding-Time Analysis for Mercury. In: Bruynooghe, M., Lau, KK. (eds) Program Development in Computational Logic. Lecture Notes in Computer Science, vol 3049. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-25951-0_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-25951-0_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22152-4

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics