Skip to main content

A Transformation System for Lazy Functional Logic Programs

  • Conference paper
Functional and Logic Programming (FLOPS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1722))

Included in the following conference series:

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.

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 to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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

  2. 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)

    Chapter  Google Scholar 

  3. 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

  4. Antoy, S.: Definitional Trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  5. Antoy, S., Echahed, R., Hanus, M.: A Needed Narrowing Strategy. In: Proc. 21st ACM Symp. on Principles of Programming Languages, pp. 268–279 (1994)

    Google Scholar 

  6. Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)

    Google Scholar 

  7. Bossi, A., Cocco, N.: Basic Transformation Operations which preserve Computed Answer Substitutions of Logic Programs. JLP 16, 47–87 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  8. Burstall, R.M., Darlington, J.: A Transformation System for Developing Recursive Programs. Journal of the ACM 24(1), 44–67 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Darlington, J.: Program transformation. In: Functional Programming and its Applications, pp. 193–215. Cambridge University Press, Cambridge (1982)

    Google Scholar 

  12. Feather, M.S.: A Survey and Classification of some Program Transformation Approaches and Techniques. In: IFIP 1987, pp. 165–195 (1987)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Hanus, M.: The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming 19&20, 583–628 (1994)

    Article  MathSciNet  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Hanus, M. (ed.): Curry: An Integrated Functional Logic Language (1999), Available at http://www-i2.informatik.rwth-aachen.de/~hanus/curry

  18. 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)

    Google Scholar 

  19. Johnsson, T.: Lambda Lifting: Transforming Programs to Recursive Equations. In: FPLCA 1985. LNCS, pp. 190–203. Springer, Heidelberg (1985)

    Google Scholar 

  20. Kawamura, T., Kanamori, T.: Preservation of Stronger Equivalence in Unfold/ Fold Logic Program Transformation. In: TCS, vol. 75, pp. 139–156 (1990)

    Google Scholar 

  21. Maher, M.J.: A Transformation System for Deductive Database Modules with Perfect Model Semantics. Theoretical Computer Science 110(2), 377–403 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  22. Moreno-Navarro, J.J., Rodríguez-Artalejo, M.: Logic Programming with Functions and Predicates: The language Babel. JLP 12(3), 191–224 (1992)

    Article  MATH  Google Scholar 

  23. Pettorossi, A., Proietti, M.: Transformation of Logic Programs: Foundations and Techniques. Journal of Logic Programming 19&20, 261–320 (1994)

    Article  MathSciNet  Google Scholar 

  24. Pettorossi, A., Proietti, M.: Rules and Strategies for Transforming Functional and Logic Programs. ACM Computing Surveys 28(2), 360–414 (1996)

    Article  Google Scholar 

  25. 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)

    Chapter  Google Scholar 

  26. Sands, D.: Total Correctness by Local Improvement in the Transformation of Functional Programs. ACM ToPLaS 18(2), 175–234 (1996)

    Article  MathSciNet  Google Scholar 

  27. Scherlis, W.L.: Program Improvement by Internal Specialization. In: Proc. of 8th ACM POPL, pp. 41–49. ACM Press, New York (1981)

    Google Scholar 

  28. Tamaki, H., Sato, T.: Unfold/Fold Transformations of Logic Programs. In: Tärnlund, S. (ed.) Proc. of 2nd ICLP, pp. 127–139 (1984)

    Google Scholar 

  29. Wadler, P.L.: Listlessness is better than Laziness. Ph.D. Thesis, Computer Science Department, CMU-CS-85-171, Carnegie Mellon Univertsity, Pittsburgh, PA (1985)

    Google Scholar 

  30. Wadler, P.L.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73, 231–248 (1990)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics