Hostname: page-component-cd9895bd7-p9bg8 Total loading time: 0 Render date: 2024-12-25T05:51:03.273Z Has data issue: false hasContentIssue false

Specialization of functional logic programs based on needed narrowing

Published online by Cambridge University Press:  09 May 2005

MARÍA ALPUENTE
Affiliation:
DSIC, Technical University of Valencia, Camino de Vera s/n, E-46020 Valencia, Spain (e-mail: [email protected], [email protected], [email protected]
SALVADOR LUCAS
Affiliation:
DSIC, Technical University of Valencia, Camino de Vera s/n, E-46020 Valencia, Spain (e-mail: [email protected], [email protected], [email protected]
GERMÁN VIDAL
Affiliation:
DSIC, Technical University of Valencia, Camino de Vera s/n, E-46020 Valencia, Spain (e-mail: [email protected], [email protected], [email protected]
MICHAEL HANUS
Affiliation:
Institut für Informatik, CAU Kiel, Olshausenstr. 40, D-24098 Kiel, Germany (e-mail: [email protected]

Abstract

Many functional logic languages are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction mechanism of functional languages and the resolution principle of logic languages. Needed narrowing is an optimal evaluation strategy which constitutes the basis of modern (narrowing-based) lazy functional logic languages. In this work, we present the fundamentals of partial evaluation in such languages. We provide correctness results for partial evaluation based on needed narrowing and show that the nice properties of this strategy are essential for the specialization process. In particular, the structure of the original program is preserved by partial evaluation and, thus, the same evaluation strategy can be applied for the execution of specialized programs. This is in contrast to other partial evaluation schemes for lazy functional logic programs which may change the program structure in a negative way. Recent proposals for the partial evaluation of declarative multi-paradigm programs use (some form of) needed narrowing to perform computations at partial evaluation time. Therefore, our results constitute the basis for the correctness of such partial evaluators.

Type
Regular Papers
Copyright
© 2005 Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

A preliminary short version of this paper appeared in the Proceedings of the International Conference on Functional Programming (ICFP'99), pp. 273–283, Paris, 1999. This work has been partially supported by CICYT TIC2001-2705-C03-01, by MCYT under grant HA2001-0059, and by the German Research Council (DFG) under grant Ha 2457/1-2.