Partial evaluation of functional logic programs
- 1 July 1998
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Programming Languages and Systems
- Vol. 20 (4) , 768-844
- https://doi.org/10.1145/291891.291896
Abstract
Languages that integrate functional and logic programming with a complete operational semantics are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. In this article, we present a partial evaluation scheme for functional logic languages based on an automatic unfolding algorithm which builds narrowing trees. The method is formalized within the theoretical framework established by Lloyd and Shepherdson for the partial deduction of logic programs, which we have generalized for dealing with functional computations. A generic specialization algorithm is proposed which does not depend on the eager or lazy nature of the narrower being used. To the best of our knowledge, this is the first generic algorithm for the specialization of functional logic programs. We also discuss the relation to work on partial evaluation in functional programming, term-rewriting systems, and logic programming. Finally, we present some experimental results with an implementation of the algorithm which show in practice that the narrowing-driven partial evaluator effectively combines the propagation of partial data structures (by means of logical variables and unification) with better opportunities for optimization (thanks to the functional dimension).Keywords
This publication has 39 references indexed in Scilit:
- Lazy narrowing: Strong completeness and eager variable eliminationTheoretical Computer Science, 1996
- A compositional semantic basis for the analysis of equational Horn programsTheoretical Computer Science, 1996
- Incremental constraint satisfaction for equational logic programmingTheoretical Computer Science, 1995
- The integration of functions into logic programming: From theory to practiceThe Journal of Logic Programming, 1994
- The s-semantics approach: Theory and applicationsThe Journal of Logic Programming, 1994
- Transformation of logic programs: Foundations and techniquesThe Journal of Logic Programming, 1994
- Completeness results for basic narrowingApplicable Algebra in Engineering, Communication and Computing, 1994
- Narrowing based procedures for equational disunificationApplicable Algebra in Engineering, Communication and Computing, 1992
- Logic programming with functions and predicates: The language BabelThe Journal of Logic Programming, 1992
- Deforestation: transforming programs to eliminate treesTheoretical Computer Science, 1990