Abstract
Needed narrowing is a complete operational principle for modern declarative languages which integrate the best features of (lazy) functional and logic programming. We define a transformation methodology for functional logic programs based on needed narrowing. We provide (strong) correctness results for the transformation system w.r.t. the set of computed values and answer substitutions and show that the prominent properties of needed narrowing -namely, the optimality w.r.t. the length of derivations and the number of computed solutions- carry over to the transformation process and the transformed programs. We illustrate the power of the system by taking on in our setting two well-known transformation strategies (composition and tupling). We also provide an implementation of the transformation system which, by means of some experimental results, highlights the benefits of our approach.
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.
This work has been partially supported by CICYT under grant TIC 98-0445-C03-01.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Alpuente, M., Falaschi, M., Ferri, C., Moreno, G., Vidal, G., Ziliotto, I.: The Transformation System SYNTH. Technical report DSIC-II/16/99, DSIC (1999), Available from http://www.dsic.upv.es/users/elp/papers.html
Alpuente, M., Falaschi, M., Moreno, G., Vidal, G.: Safe Folding/Unfolding with Conditional Narrowing. In: Hanus, M., Heering, J., Meinke, K. (eds.) ALP 1997 and HOA 1997. LNCS, vol. 1298, pp. 1–15. Springer, Heidelberg (1997)
Alpuente, M., Falaschi, M., Moreno, G., Vidal, G.: A Transformation System for Lazy Functional Logic Programs. Technical report, DSIC, UPV (1999), Available from http://www.dsic.upv.es/users/elp/papers.html
Antoy, S.: Definitional Trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992)
Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. In: Proc. 21st ACM Symp. on Principles of Programming Languages, pp. 268–279 (1994)
Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)
Bossi, A., Cocco, N.: Basic Transformation Operations which preserve Computed Answer Substitutions of Logic Programs. JLP 16, 47–87 (1993)
Burstall, R.M., Darlington, J.: A Transformation System for Developing Recursive Programs. Journal of the ACM 24(1), 44–67 (1977)
Chin, W.: Towards an Automated Tupling Strategy. In: Proc. of Partial Evaluation and Semantics-Based Program Manipulation, pp. 119–132. ACM Press, New York (1993)
Chin, W., Goh, A., Khoo, S.: Effiective Optimisation of Multiple Traversals in Lazy Languages. In: Proc. of PEPM 1999 (Technical Report BRICS-NS-99-1), University of Aarhus, DK, pp. 119–130 (1999)
Darlington, J.: Program transformation. In: Functional Programming and its Applications, pp. 193–215. Cambridge University Press, Cambridge (1982)
Feather, M.S.: A Survey and Classification of some Program Transformation Approaches and Techniques. In: IFIP 1987, pp. 165–195 (1987)
Gardner, P.A., Shepherdson, J.C.: Unfold/fold Transformation of Logic Programs. In: Lassez, J.L., Plotkin, G. (eds.) Computational Logic, Essays in Honor of Alan Robinson, pp. 565–583. The MIT Press, Cambridge (1991)
Hanus, M.: The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming 19&20, 583–628 (1994)
Hanus, M.: A Unified Computation Model for Functional and Logic Programming. In: Proc. of the 24th ACM POPL, pp. 80–93. ACM, New York (1997)
Hanus, M., Kuchen, H., Moreno-Navarro, J.J.: Curry: A Truly Functional Logic Language. In: Proc. ILPS 1995 Workshop on Visions for the Future of Logic Programming, pp. 95–107 (1995)
Hanus, M. (ed.): Curry: An Integrated Functional Logic Language (1999), Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry
Huet, G., Lévy, J.J.: Computations in Orthogonal Rewriting Systems, Part I + II. In: Lassez, J.L., Plotkin, G.D. (eds.) Computational Logic - Essays in Honor of Alan Robinson, pp. 395–443 (1992)
Johnsson, T.: Lambda Lifting: Transforming Programs to Recursive Equations. In: FPLCA 1985. LNCS, pp. 190–203. Springer, Heidelberg (1985)
Kawamura, T., Kanamori, T.: Preservation of Stronger Equivalence in Unfold/ Fold Logic Program Transformation. In: TCS, vol. 75, pp. 139–156 (1990)
Maher, M.J.: A Transformation System for Deductive Database Modules with Perfect Model Semantics. Theoretical Computer Science 110(2), 377–403 (1993)
Moreno-Navarro, J.J., Rodríguez-Artalejo, M.: Logic Programming with Functions and Predicates: The language Babel. JLP 12(3), 191–224 (1992)
Pettorossi, A., Proietti, M.: Transformation of Logic Programs: Foundations and Techniques. Journal of Logic Programming 19&20, 261–320 (1994)
Pettorossi, A., Proietti, M.: Rules and Strategies for Transforming Functional and Logic Programs. ACM Computing Surveys 28(2), 360–414 (1996)
Roychoudhury, A., Narayan Kumar, K., Ramakrishnan, C.R., Ramakrishnan, I.V.: A Parameterized Unfold/Fold Transformation Framework for Definite Logic Programs. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702. Springer, Heidelberg (1999) (to appear)
Sands, D.: Total Correctness by Local Improvement in the Transformation of Functional Programs. ACM ToPLaS 18(2), 175–234 (1996)
Scherlis, W.L.: Program Improvement by Internal Specialization. In: Proc. of 8th ACM POPL, pp. 41–49. ACM Press, New York (1981)
Tamaki, H., Sato, T.: Unfold/Fold Transformations of Logic Programs. In: Tärnlund, S. (ed.) Proc. of 2nd ICLP, pp. 127–139 (1984)
Wadler, P.L.: Listlessness is better than Laziness. Ph.D. Thesis, Computer Science Department, CMU-CS-85-171, Carnegie Mellon Univertsity, Pittsburgh, PA (1985)
Wadler, P.L.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73, 231–248 (1990)
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
Alpuente, M., Falaschi, M., Moreno, G., Vidal, G. (1999). A Transformation System for Lazy Functional Logic Programs. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_10
Download citation
DOI: https://doi.org/10.1007/10705424_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66677-6
Online ISBN: 978-3-540-47950-5
eBook Packages: Springer Book Archive