Skip to main content

A Partial Evaluation Framework for Curry Programs

  • Conference paper
Logic for Programming and Automated Reasoning (LPAR 1999)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 1705))

Abstract

In this work, we develop a partial evaluation technique for residuating functional logic programs, which generalize the concurrent computation models for logic programs with delays to functional logic programs. We show how to lift the nondeterministic choices from run time to specialization time. We ascertain the conditions under which the original and the transformed program have the same answer expressions for the considered class of queries as well as the same floundering behavior. All these results are relevant for program optimization in Curry, a functional logic language which is intended to become a standard in this area. Preliminary empirical evaluation of the specialized Curry programs demonstrates that our technique also works well in practice and leads to substantial performance improvements. To our knowledge, this work is the first attempt to formally define and prove correct a general scheme for the partial evaluation of functional logic programs with delays.

This work has been partially supported by CICYT TIC 98-0445-C03-01, by Acción Integrada hispano-alemana HA1997-0073, and by the German Research Council (DFG) under grant Ha 2457/1-1.

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. H. Aït-Kaci. An Overview of LIFE. In J.W. Schmidt and A.A. Stogny, editors, Proc. Workshop on Next Generation Information Systems Technology, pages 42–58. Springer LNCS 504, 1990.

    Google Scholar 

  2. H. Aït-Kaci, P. Lincoln, and R. Nasr. Le Fun: Logic, equations, and Functions. In Proc. of Fourth IEEE Int’l Symp. on Logic Programming, pages 17–23. IEEE, New York, 1987.

    Google Scholar 

  3. E. Albert, M. Alpuente, M. Falaschi, and G. Vidal. Indy User’s Manual. Technical Report DSIC-II/12/98, UPV, 1998. Available from URL: http://www.dsic.upv.es/users/elp/papers.html.

  4. E. Albert, M. Alpuente, M. Hanus, and G. Vidal. Partial Evaluation of Residuating Functional Logic Programs. Technical report, DSIC, UPV, 1999. Available from URL: http://www.dsic.upv.es/users/elp/papers.html.

  5. M. Alpuente, M. Falaschi, P. Julián, and G. Vidal. Specialization of Lazy Functional Logic Programs. In Proc. of the ACM SIGPLAN Conf. on Partial Evaluation and Semantics-Based Program Manipulation, PEPM’97, volume 32, 12 of Sigplan Notices, pages 151–162, New York, 1997. ACM Press.

    Google Scholar 

  6. M. Alpuente, M. Falaschi, and G. Vidal. Partial Evaluation of Functional Logic Programs. ACM Transactions on Programming Languages and Systems, 20(4):768–844, 1998.

    Article  Google Scholar 

  7. M. Alpuente, M. Hanus, S. Lucas, and G. Vidal. Specialization of Functional Logic Programs Based on Needed Narrowing. In P. Lee, editor, Proc. of the Int’l Conference on Functional Programming, ICFP’99, Paris (France). ACM, New York, 1999.

    Google Scholar 

  8. S. Antoy. Definitional trees. In Proc. of the 3rd Int’l Conference on Algebraic and Logic Programming, ALP’92, pages 143–157. Springer LNCS 632, 1992.

    Chapter  Google Scholar 

  9. S. Antoy. Optimal non-deterministic functional logic computations. In Proc. of the Int’l Conference on Algebraic and Logic Programming, ALP’97, pages 16–30. Springer LNCS 1298, 1997.

    Chapter  Google Scholar 

  10. S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. In Proc. 21st ACM Symp. on Principles of Programming Languages, Portland, pages 268–279, 1994.

    Google Scholar 

  11. J. Boye. Avoiding Dynamic Delays in Functional Logic Languages. In J. Penjam and M. Bruynooghe, editors, Proc. of PLILP’93, pages 12–27. Springer LNCS 714, 1993.

    Google Scholar 

  12. C. Consel and O. Danvy. Tutorial notes on Partial Evaluation. In Proc. of 20th Annual ACM Symp. on Principles of Programming Languages, pages 493–501. ACM, New York, 1993.

    Google Scholar 

  13. N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, volume B: Formal Models and Semantics, pages 243–320. Elsevier, Amsterdam, 1990.

    Google Scholar 

  14. S. Etalle, M. Gabbrielli, and E. Marchiori. A Transformation System for CLP with Dynamic Scheduling and CCP. In Proc. of the ACM Sigplan PEPM’97, pages 137–150. ACM Press, New York, 1997.

    Google Scholar 

  15. J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, June 1993, pages 88–98. ACM, New York, 1993.

    Chapter  Google Scholar 

  16. E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel Leaf: A Logic plus Functional Language. Journal of Computer and System Sciences, 42:363–377, 1991.

    Article  Google Scholar 

  17. R. Glück and M.H. Sørensen. Partial Deduction and Driving are Equivalent. In Proc. of PLILP’94, pages 165–181. Springer LNCS 844, 1994.

    Google Scholar 

  18. M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.

    Article  MathSciNet  Google Scholar 

  19. M. Hanus. Analysis of Residuating Logic Programs. Journal of Logic Programming, 24(3):161–199, 1995.

    Article  MathSciNet  Google Scholar 

  20. M. Hanus. A unified computation model for functional and logic programming. In Proc. of the 24th ACM Symposium on Principles of Programming Languages (Paris), pages 80–93. ACM, New York, 1997.

    Chapter  Google Scholar 

  21. M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry, 1999.

  22. N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.

    MATH  Google Scholar 

  23. Neil D. Jones. An Introduction to Partial Evaluation. ACM Computing Surveys, 28(3):480–503, Sept. 1996.

    Article  Google Scholar 

  24. M. Leuschel, D. De Schreye, and A. de Waal. A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration. In M. Maher, editor, Proc. of JICSLP’96, pages 319–332. The MIT Press, Cambridge, MA, 1996.

    Google Scholar 

  25. J.W. Lloyd. Combining Functional and Logic Programming Languages. In Proc. of the International Logic Programming Symposium, pages 43–57, 1994.

    Google Scholar 

  26. J.W. Lloyd. Declarative Programming in Escher. Technical Report CSTR-95-013, Computer Science Department, University of Bristol, 1995.

    Google Scholar 

  27. J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.

    Article  MathSciNet  Google Scholar 

  28. R. Loogen, F. López-Fraguas, and M. Rodríguez-Artalejo. A Demand Driven Computation Strategy for Lazy Narrowing. In J. Penjam and M. Bruynooghe, editors, Proc. of PLILP’93, pages 184–200. Springer LNCS 714, 1993.

    Google Scholar 

  29. J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191–224, 1992.

    Article  MATH  Google Scholar 

  30. L. Naish. Negation and Control in Prolog. Springer LNCS 238, 1987.

    Google Scholar 

  31. L. Naish. Adding equations to NU-Prolog. In J. Maluszyński and M. Wirsing, editors, Proc. of the 3rd Int’l Symp. on Programming Languages Implementation and Logic Programming, pages 15–26. Springer LNCS 528, 1991.

    Google Scholar 

  32. G. Smolka. The Oz Programming Model. In Jan van Leeuwen, editor, Computer Science Today: Recent Trends and Developments, pages 324–343. Springer LNCS 1000, 1995.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Albert, E., Alpuente, M., Harms, M., Vidal, G. (1999). A Partial Evaluation Framework for Curry Programs. In: Ganzinger, H., McAllester, D., Voronkov, A. (eds) Logic for Programming and Automated Reasoning. LPAR 1999. Lecture Notes in Computer Science(), vol 1705. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48242-3_23

Download citation

  • DOI: https://doi.org/10.1007/3-540-48242-3_23

  • Publisher Name: Springer, Berlin, Heidelberg

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

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics