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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
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.
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.
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.
S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.
S. Antoy and M. Hanus. Compiling Multi-Paradigm Declarative Programs into Prolog. In Proc. of FroCoS’2000, pages 171–185. Springer LNCS 1794, 2000.
M. Bruynooghe, D. De Schreye, and B. Martens. A General Criterion for Avoiding Infinite Unfolding. New Generation Computing, 11(1):47–79, 1992.
C. Consel and O. Danvy. Tutorial notes on Partial Evaluation. In Proc. of POPL’93, pages 493–501. ACM, New York, 1993.
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.
J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.
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.
M. Hanus. A unified computation model for functional and logic programming. In Proc. of POPL’97, pages 80–93. ACM, New York, 1997.
M. Hanus. Distributed Programming in a Multi-Paradigm Declarative Language. In Proc. of PPDP’99, pages 376–395. Springer LNCS 1702, 1999.
M. Hanus. Curry: An Integrated Functional Logic Language. Available at: http://www.informatik.uni-kiel.de/~curry/, 2000.
M. Hanus. A Functional Logic Programming Approach to Graphical User Interfaces. In Proc. of PADL’00, pages 47–62. Springer LNCS 1753, 2000.
M. Hanus. High-Level Server Side Web Scripting in Curry. In Proc. of PADL’01, Springer LNCS (to appear), 2001.
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.
M. Hanus and C. Prehofer. Higher-Order Narrowing with Definitional Trees. Journal of Functional Programming, 9(1):33–75, 1999.
N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.
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.
J.W. Lloyd. Combining Functional and Logic Programming Languages. In Proc. of the International Logic Programming Symposium, pages 43–57, 1994.
J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.
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.
W. Lux and H. Kuchen. An Efficient Abstract Machine for Curry. In Proc. of WFLP’99, pages 171–181, 1999.
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.
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.
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.
M.H. S∅rensen, R. Glück, and N.D. Jones. A Positive Supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.
P.L. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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