Skip to main content

Comparison of Deforestation Techniques for Functional Programs and for Tree Transducers

  • 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

We compare transformations for the elimination of intermediate results in first-order functional programs. We choose the well known deforestation technique of Wadler and composition techniques from the theory of tree transducers, of which the implementation of functional programs yet does not take advantage. We identify syntactic classes of function definitions for which both techniques deliver equally efficient results and for which one technique is more powerful than the other. In particular, this paper offers a technique that eliminates intermediate results for certain kinds of function definitions, for which deforestation fails.

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. Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. Assoc. Comput. Mach. 24, 44–67 (1977)

    MATH  MathSciNet  Google Scholar 

  2. Courcelle, B., Franchi-Zannettacci, P.: Attribute grammars and recursive program schemes. Theoret. Comput. Sci. 17, 163–191, 235–257 (1982)

    Article  MathSciNet  Google Scholar 

  3. Engelfriet, J.: Some open questions and recent results on tree transducers and tree languages. In: Book, R.V. (ed.) Formal language theory; perspectives and open problems, pp. 241–286. Academic Press, New York (1980)

    Google Scholar 

  4. Engelfriet, J., Vogler, H.: Macro tree transducers. J. Comput. Syst. Sci. 31, 71–145 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  5. Ferguson, A.B., Wadler, P.: When will deforestation stop? In: 1988 Glasgow Workshop on Functional Programming, pp. 39–56 (1988)

    Google Scholar 

  6. Fülöp, Z.: On attributed tree transducers. Acta Cybernetica 5, 261–279 (1981)

    MATH  Google Scholar 

  7. Fülöp, Z., Vogler, H.: Syntax-directed semantics - Formal models based on tree transducers. Monographs in Theoretical Computer Science, An EATCS Series. Springer, Heidelberg (1998)

    MATH  Google Scholar 

  8. Ganzinger, H.: Increasing modularity and language-independency in automatically generated compilers. Science of Computer Programming 3, 223–278 (1983)

    Article  MATH  MathSciNet  Google Scholar 

  9. Giegerich, R.: Composition and evaluation of attribute coupled grammars. Acta Informatica 25, 355–423 (1988)

    Article  MathSciNet  Google Scholar 

  10. Gill, A.: Cheap deforestation for non-strict functional languages. PhD thesis, University of Glasgow (1996)

    Google Scholar 

  11. Gill, A., Launchbury, J., Peyton Jones, S.L.: A short cut to deforestation. In: FPCA 1993, Proceedings, Copenhagen, Denmark, pp. 223–231. ACM Press, New York (1993)

    Chapter  Google Scholar 

  12. Hamilton, G.W., Jones, S.B.: Extending deforestation for first order functional programs. In: 1991 Glasgow Workshop on Functional Programming. Series of Workshops in Computing, pp. 134–145. Springer, Heidelberg (1992)

    Google Scholar 

  13. Hughes, J.: Why functional programming matters. In: Turner, D. (ed.) Research Topics in Functional Programming. Addison-Wesley, Reading (1990)

    Google Scholar 

  14. Knuth, D.E.: Semantics of context-free languages. Math. Syst. Th. 2, 127–145 (1968); Corrections in Math. Syst. Th. 5, 95–96 (1971)

    Article  MATH  MathSciNet  Google Scholar 

  15. Kühnemann, A.: Benefits of tree transducers for optimizing functional programs. In: Arvind, V., Sarukkai, S. (eds.) FST TCS 1998. LNCS, vol. 1530, pp. 146–158. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  16. Kühnemann, A., Vogler, H.: Synthesized and inherited functions - a new computational model for syntax-directed semantics. Acta Informatica 31, 431–477 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  17. Rounds, W.C.: Mappings and grammars on trees. Math. Syst. Th. 4, 257–287 (1970)

    Article  MATH  MathSciNet  Google Scholar 

  18. Sørensen, M.H., Glück, R., Jones, N.D.: Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 485–500. Springer, Heidelberg (1994)

    Google Scholar 

  19. Thatcher, J.W.: Generalized2 sequential machine maps. J. Comput. Syst. Sci. 4, 339–367 (1970)

    Article  MATH  MathSciNet  Google Scholar 

  20. Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theor. Comp. Sci. 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

Kühnemann, A. (1999). Comparison of Deforestation Techniques for Functional Programs and for Tree Transducers. 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_8

Download citation

  • DOI: https://doi.org/10.1007/10705424_8

  • 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