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. Formal methods of transformation of functional logic programs can be based on this well-established operational semantics. In this paper, we present a partial evaluation scheme for functional logic languages based on an automatic unfolding algorithm which builds narrowing trees. We study the semantic properties of the transformation and the conditions under which the technique terminates, is sound and complete, and is also generally applicable to a wide class of programs. We illustrate our method with several examples and discuss the relation with Supercompilation and Partial Evaluation. To the best of our knowledge, this is the first formal approach to partial evaluation of functional logic programs.
This work has been partially supported by CICYT under giant TIC 95-0433-C03-03 and by HCM project CONSOLE.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
M. Alpuente, M. Falaschi, and G. Levi. Incremental Constraint Satisfaction for Equational Logic Programming. Theoretical Computer Science, 142:27–57, 1995.
M. Alpuente, M. Falaschi, and G. Vidal. Narrowing-driven specialization of Functional Logic Programs. Technical Report DSIC-II/27/95, UPV, 1995.
P. Arenas, A. Gil, and F. López. Combining Lazy Narrowing with Disequality Constraints. In Proc. of PLILP'94, pages 385–399. Springer LNCS 844, 1994.
K. Benkerimi and P.M. Hill. Supporting Transformations for the Partial Evaluation of Logic Programs. Journal of Logic and Computation, 3(5):469–486, 1993.
R.M. Burstall and J. Darlington. A Transformation System for Developing Recursive Programs. Journal of the ACM, 24(1):44–67, 1977.
J. Darlington and H. Pull. A Program Development Methodology Based on a Unified Approach to Execution and Transformation. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Proc. of the Int'l Workshop on Partial Evaluation and Mixed Computation, pages 117–131. North-Holland, Amsterdam, 1988.
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.
L. Fribourg. SLOG: a logic programming language interpreter based on clausal superposition and rewriting. In Proc. of Second IEEE Int'l Symp. on Logic Programming, pages 172–185. IEEE, New York, 1985.
Y. Futamura. Partial Evaluation of Computation Process — An Approach to a Compiler-Compiler. Systems, Computers, Controls, 2(5):45–50, 1971.
J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM'93, pages 88–98. ACM, New York, 1993.
J. Gallagher and M. Bruynooghe. Some Low-Level Source Transformations for Logic Programs. In M. Bruynooghe, editor, Proc. of 2nd Workshop on Meta-Programming in Logic, pages 229–246. Department of Computer Science, KU Leuven, Belgium, 1990.
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. Combining Lazy Narrowing with Simplification. In Proc. of PLILP'94, pages 370–384. 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.
S. Hölldobler. Foundations of Equational Logic Programming. Springer LNAI 353, 1989.
J.M. Hullot. Canonical Forms and Unification. In Proc of 5th Int'l Conf. on Automated Deduction, pages 318–334. Springer LNCS 87, 1980.
H. Hussmann. Unification in Conditional-Equational Theories. In Proc. of EUROCAL'85, pages 543–553. Springer LNCS 204, 1985.
J. Jaffar and J.-L. Lassez. Constraint Logic Programming. In Proc. of 14th Annual ACM Symp. on Principles of Programming Languages, pages 111–119. ACM, 1987.
N.D. Jones, C.K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs, NJ, 1993.
D.E. Knuth, J.H. Morris, and V.R. Pratt. Fast Pattern Matching in Strings. SIAM Journal of Computation, 6(2):323–350, 1977.
J.-L. Lassez, M. J. Maher, and K. Marriott. Unification Revisited. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 587–625. Morgan Kaufmann, Los Altos, Ca., 1988.
M. Leuschel and D. De Schreye. An Almost Perfect Abstraction Operator for Partial Deduction. Technical Report CW-199, Department of Computer Science, K.U. Leuven, Belgium, December 1994.
G. Levi and F. Sirovich. Proving Program Properties, Symbolic Evaluation and Logi0cal Procedural Semantics. In Proc. of MFCS'75, pages 294–301. Springer LNCS 32, 1975.
J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11:217–242, 1991.
B. Martens and J. Gallagher. Ensuring Global Termination of Partial Deduction while Allowing Flexible Polyvariance. In K. Furukawa and K. Ueda, editors, Proc. of ICLP'95, pages 597–611, 1995.
A. Middeldorp and E. Hamoen. Completeness Results for Basic Narrowing. Applicable Algebra in Engineering, Communication and Computing, 5:213–253, 1994.
U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In Proc. of Second IEEE Int'l Symp. on Logic Programming, pages 138–151. IEEE, New York, 1985.
P. Sestoft and H. Søndergaard. A bibliography on partial evaluation. Sigplan Notices, 23(2):19–27, Feb 1988.
M.H. Sørensen and R. Glück. Generalization in Positive Supercompilation. In J.W. Lloyd, editor, Proc. of ILPS'95, 1995.
M.H. Sørensen, R. Glück, and N.D. Jones. Towards Unifying Partial Evaluation, Deforestation, Supercompilation, and GPC. In D. Sannella, editor, Proc. of ESOP'94, pages 485–500. Springer LNCS 788, 1994.
V.F. Turchin. The Concept of a Supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, July 1986.
V.F. Turchin. The Algorithm of Generalization in the Supercompiler. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Proc. of the Int'l Workshop on Partial Evaluation and Mixed Computation, pages 531–549. North-Holland, Amsterdam, 1988.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Alpuente, M., Falaschi, M., Vidal, G. (1996). Narrowing-driven partial evaluation of functional logic programs. In: Nielson, H.R. (eds) Programming Languages and Systems — ESOP '96. ESOP 1996. Lecture Notes in Computer Science, vol 1058. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61055-3_28
Download citation
DOI: https://doi.org/10.1007/3-540-61055-3_28
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61055-7
Online ISBN: 978-3-540-49942-8
eBook Packages: Springer Book Archive