Skip to main content

A Practical Partial Evaluator for a Multi-Paradigm Declarative Language

  • Conference paper
  • First Online:
Functional and Logic Programming (FLOPS 2001)

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

Included in the following conference series:

Abstract

Partial evaluation is an automatic technique for program optimization which preserves program semantics. The range of its potential applications is extremely large, as witnessed by successful experiences in several fields. This paper summarizes our findings in the development of partial evaluation tools for Curry, a modern multi-paradigm declarative language which combines features from functional, logic and concurrent programming. From a practical point of view, the most promising approach appears to be a recent partial evaluation framework which translates source programs into a maximally simplified representation. We support this statement by extending the underlying method in order to design a practical partial evaluation tool for the language Curry. The process is fully automatic and can be incorporated into a Curry compiler as a source-to-source transformation on intermediate programs. An implementation of the partial evaluator has been undertaken. Experimental results confirm that our partial evaluator pays off in practice.

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

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. E. Albert, M. Alpuente, M. Falaschi, and G. Vidal. Indy User’s Manual. Technical Report DSIC-II/12/98, UPV, 1998. Available at http://www.dsic.upv.es/users/elp/papers.html.

  2. E. Albert, M. Alpuente, M. Hanus, and G. Vidal. A Partial Evaluation Framework for Curry Programs. In Proc. of LPAR’99, pages 376–395. Springer LNAI 1705, 1999.

    Google Scholar 

  3. E. Albert, M. Hanus, and G. Vidal. Using an Abstract Representation to Specialize Functional Logic Programs. In Proc. of LPAR’2000, pages 381–398. Springer LNAI 1955, 2000.

    Google Scholar 

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

    Article  Google Scholar 

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

  6. S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.

    Article  MathSciNet  Google Scholar 

  7. S. Antoy and M. Hanus. Compiling Multi-Paradigm Declarative Programs into Prolog. In Proc. of FroCoS’2000, pages 171–185. Springer LNCS 1794, 2000.

    MATH  Google Scholar 

  8. M. Bruynooghe, D. De Schreye, and B. Martens. A General Criterion for Avoiding Infinite Unfolding. New Generation Computing, 11(1):47–79, 1992.

    Article  Google Scholar 

  9. C. Consel and O. Danvy. Tutorial notes on Partial Evaluation. In Proc. of POPL’93, pages 493–501. ACM, New York, 1993.

    Google Scholar 

  10. D. De Schreye, R. Glück, J. JØrgensen, M. Leuschel, B. Martens, and M.H. S∅rensen. Conjunctive Partial Deduction: Foundations, Control, Algorihtms, and Experiments. Journal of Logic Programming, 41(2&3):231–277, 1999.

    Article  MathSciNet  Google Scholar 

  11. J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.

    Google Scholar 

  12. A.J. Gill, J. Launchbury, and S.L. Peyton Jones. A Short Cut to Deforestation. In Proc. of the FPCA’93, pages 223–232, New York, NY, USA, 1993. ACM Press.

    Google Scholar 

  13. M. Hanus. A unified computation model for functional and logic programming. In Proc. of POPL’97, pages 80–93. ACM, New York, 1997.

    Google Scholar 

  14. M. Hanus. Distributed Programming in a Multi-Paradigm Declarative Language. In Proc. of PPDP’99, pages 376–395. Springer LNCS 1702, 1999.

    Google Scholar 

  15. M. Hanus. Curry: An Integrated Functional Logic Language. Available at: http://www.informatik.uni-kiel.de/~curry/, 2000.

  16. M. Hanus. A Functional Logic Programming Approach to Graphical User Interfaces. In Proc. of PADL’00, pages 47–62. Springer LNCS 1753, 2000.

    Google Scholar 

  17. M. Hanus. High-Level Server Side Web Scripting in Curry. In Proc. of PADL’01, Springer LNCS (to appear), 2001.

    Book  Google Scholar 

  18. M. Hanus, S. Antoy, J. Koj, R. Sadre, and F. Steiner. PAKCS 1.3: The Portland Aachen Kiel Curry System User Manual. University of Kiel, Germany, 2000.

    Google Scholar 

  19. M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, 9(1):33–75, 1999.

    Article  MathSciNet  Google Scholar 

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

    MATH  Google Scholar 

  21. M. Leuschel. On the Power of Homeomorphic Embedding for Online Termination. In G. Levi, editor, Proc. of SAS’98, pages 230–245. Springer LNCS 1503, 1998.

    Google Scholar 

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

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  24. F. López-Fraguas and J. Sánchez-Hernández. TOY: A Multiparadigm Declarative System. In Proc. of RTA’99, pages 244–247. Springer LNCS 1631, 1999.

    Google Scholar 

  25. W. Lux and H. Kuchen. An Efficient Abstract Machine for Curry. In Proc. of WFLP’99, pages 171–181, 1999.

    Google Scholar 

  26. B. Martens and J. Gallagher. Ensuring Global Termination of Partial Deduction while Allowing Flexible Polyvariance. In L. Sterling, editor, Proc. of ICLP’95, pages 597–611. MIT Press, 1995.

    Google Scholar 

  27. S.L. Peyton-Jones. Compiling Haskell by Program Transformation: a Report from the Trenches. In Proc. of ESOP’96, pages 18–44. Springer LNCS 1058, 1996.

    Google Scholar 

  28. M.H. S∅rensen and R. Glück. An Algorithm of Generalization in Positive Super compilation. In Proc. of ILPS’95, pages 465–479. MIT Press, 1995.

    Google Scholar 

  29. M.H. S∅rensen, R. Glück, and N.D. Jones. A Positive Supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.

    Article  Google Scholar 

  30. P.L. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Albert, E., Hanus, M., Vidal, G. (2001). A Practical Partial Evaluator for a Multi-Paradigm Declarative Language. In: Kuchen, H., Ueda, K. (eds) Functional and Logic Programming. FLOPS 2001. Lecture Notes in Computer Science, vol 2024. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44716-4_21

Download citation

  • DOI: https://doi.org/10.1007/3-540-44716-4_21

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

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

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics