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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
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.
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.
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.
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.
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.
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.
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.
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. 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.
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.
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.
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.
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.
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.
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.
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.
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.
M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.
M. Hanus. Analysis of Residuating Logic Programs. Journal of Logic Programming, 24(3):161–199, 1995.
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.
M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry, 1999.
N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.
Neil D. Jones. An Introduction to Partial Evaluation. ACM Computing Surveys, 28(3):480–503, Sept. 1996.
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.
J.W. Lloyd. Combining Functional and Logic Programming Languages. In Proc. of the International Logic Programming Symposium, pages 43–57, 1994.
J.W. Lloyd. Declarative Programming in Escher. Technical Report CSTR-95-013, Computer Science Department, University of Bristol, 1995.
J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.
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.
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.
L. Naish. Negation and Control in Prolog. Springer LNCS 238, 1987.
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.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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