A Practical Partial Evaluator for a Multi-Paradigm Declarative Language

  • Elvira Albert
  • Michael Hanus
  • Germ00E1;n Vidal
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2024)

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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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. 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. 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. 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.CrossRefGoogle Scholar
  5. 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.CrossRefGoogle Scholar
  6. 6.
    S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.CrossRefMathSciNetGoogle Scholar
  7. 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.Google Scholar
  8. 8.
    M. Bruynooghe, D. De Schreye, and B. Martens. A General Criterion for Avoiding Infinite Unfolding. New Generation Computing, 11(1):47–79, 1992.MATHGoogle Scholar
  9. 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. 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.MATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.Google Scholar
  12. 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. 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. 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. 15.
    M. Hanus. Curry: An Integrated Functional Logic Language. Available at: http://www.informatik.uni-kiel.de/~curry/, 2000.
  16. 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. 17.
    M. Hanus. High-Level Server Side Web Scripting in Curry. In Proc. of PADL’01, Springer LNCS (to appear), 2001.Google Scholar
  18. 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. 19.
    M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, 9(1):33–75, 1999.MATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.MATHGoogle Scholar
  21. 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. 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. 23.
    J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.CrossRefMATHMathSciNetGoogle Scholar
  24. 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. 25.
    W. Lux and H. Kuchen. An Efficient Abstract Machine for Curry. In Proc. of WFLP’99, pages 171–181, 1999.Google Scholar
  26. 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. 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. 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. 29.
    M.H. S∅rensen, R. Glück, and N.D. Jones. A Positive Supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.CrossRefGoogle Scholar
  30. 30.
    P.L. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Elvira Albert
    • 1
  • Michael Hanus
    • 1
  • Germ00E1;n Vidal
    • 2
  1. 1.DSICUPVSpain
  2. 2.Institut für InformatikCAU KielGermany

Personalised recommendations