Hostname: page-component-745bb68f8f-lrblm Total loading time: 0 Render date: 2025-02-06T12:24:09.307Z 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: alpuente@dsic.upv.es, slucas@dsic.upv.es, gvidal@dsic.upv.es
SALVADOR LUCAS
Affiliation:
DSIC, Technical University of Valencia, Camino de Vera s/n, E-46020 Valencia, Spain (e-mail: alpuente@dsic.upv.es, slucas@dsic.upv.es, gvidal@dsic.upv.es
GERMÁN VIDAL
Affiliation:
DSIC, Technical University of Valencia, Camino de Vera s/n, E-46020 Valencia, Spain (e-mail: alpuente@dsic.upv.es, slucas@dsic.upv.es, gvidal@dsic.upv.es
MICHAEL HANUS
Affiliation:
Institut für Informatik, CAU Kiel, Olshausenstr. 40, D-24098 Kiel, Germany (e-mail: mh@informatik.uni-kiel.de
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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

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.