Skip to main content

Improving Functional Logic Programs by Difference-Lists

  • Conference paper
  • First Online:
Book cover Advances in Computing Science — ASIAN 2000 (ASIAN 2000)

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

Included in the following conference series:

Abstract

Modern multi-paradigm declarative languages integrate features from functional, logic, and concurrent programming. Since programs in these languages make extensive use of list-processing functions, we consider of much interest the development of list-processing optimization techniques. In this work, we consider the adaptation of the well-known difference-lists transformation from the logic programming paradigm to our integrated setting. Unfortunately, the use of differencelists is impractical due to the absence of non-strict equality in lazy (callby-name) languages. Despite all, we have developed a novel, stepwise transformation which achieves a similar effect over functional logic programs. We also show a simple and practical approach to incorporate the optimization into a real compiler. Finally, we have conducted a number of experiments which show the practicality of our proposal.

This workh as been partially supported by CICYT TIC 98-0445-C03-01, by Acción Integrada hispano-alemana HA1997-0073, by the German Research Council (DFG) under grant Ha 2457/1-1., and by the Generalitat Valenciana under grant ESTBEC00-14-32

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. E. Albert, C. Ferri, F. Steiner, and G. Vidal. List-Processing Optimizations in a Multi-Paradigm Declarative Language. Technical Report DSIC, UPV, 2000. Available from URL: http://www.dsic.upv.es/users/elp/papers.html.

  2. M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. A Transformation System for Lazy Functional Logic Programs. In A. Middeldorp and T. Sato, editors, Proc. of FLOPS’99, pages 147–162. Springer LNCS 1722, 1999.

    Google Scholar 

  3. S. Antoy. Definitional trees. In Proc. of the 3rd Int’l Conference on Algebraic and Logic Programming, ALP’92, pages 143–157. Springer LNCS 632, 1992.

    Google Scholar 

  4. S. Antoy, R. Echahed, and M. Hanus. A Needed Narrowing Strategy. Journal of the ACM, 47(4):776–822, 2000.

    Article  MathSciNet  Google Scholar 

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

    Google Scholar 

  6. A. J. Gill, J. Launchbury, and S. L. Peyton Jones. A Short Cut to Deforestation. In Proc. of FPLCA’93, pages 223–232, New York, NY (USA), 1993. ACM Press.

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  8. M. Hanus, S. Antoy, J. Koj, P. Niederau, R. Sadre, and F. Steiner. PAKCS 1.2: User Manual. Technical report, CAU Kiel, 2000. Available at http://www.informatik.uni-kiel.de/~pakcs.

  9. M. Hanus (ed.). Curry: An Integrated Functional Logic Language. Available at http://www.informatik.uni-kiel.de/~curry, 2000.

  10. G. Huet and J. J. Lévy. Computations in orthogonal rewriting systems, Part I + II. In J. L. Lassez and G. D. Plotkin, editors, Computational Logic — Essays in Honor of Alan Robinson, pages 395–443, 1992.

    Google Scholar 

  11. J. Hughes. A Novel representation of Lists and its Application to the Function reverse. Tech. Report PMG-38, Chalmers Institute of Technology, Sweden, 1984.

    Google Scholar 

  12. K. Marriott and H. Søndergaard. Difference-list Transformation for Prolog. New Generation Computing, 11(2):125–157, October 1993.

    Google Scholar 

  13. L. Sterling and E. Shapiro. The Art of Prolog: Advanced Programming Techniques. MIT Press, 1986.

    Google Scholar 

  14. H. Tamaki and T. Sato. Unfold/Fold Transformations of Logic Programs. In Proc. of Second Int’l Conf. on Logic Programming, pages 127–139, 1984.

    Google Scholar 

  15. P. L. Wadler. The Concatenate Vanishes. Technical report, Department of Computing Science, University of Glasgow, UK, 1987.

    Google Scholar 

  16. P. L. Wadler. 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

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Albert, E., Ferri, C., Steiner, F., Vidal, G. (2000). Improving Functional Logic Programs by Difference-Lists. In: Jifeng, H., Sato, M. (eds) Advances in Computing Science — ASIAN 2000. ASIAN 2000. Lecture Notes in Computer Science, vol 1961. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44464-5_17

Download citation

  • DOI: https://doi.org/10.1007/3-540-44464-5_17

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-41428-5

  • Online ISBN: 978-3-540-44464-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics