Skip to main content

Relating Accumulative and Non-accumulative Functional Programs

  • Conference paper
  • First Online:

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

Abstract

We study the problem to transform functional programs, which intensively use append functions (like inefficient list reversal), into programs, which use accumulating parameters instead (like eficient list reversal). We give an (automatic) transformation algorithm for our problem and identify a class of functional programs, namely restricted 2-modular tree transducers, to which it can be applied. Moreover, since we get macro tree transducers as transformation result and since we also give the inverse transformation algorithm, we have a new characterization for the class of functions induced by macro tree transducers.

Research supported in part by the German Academic Exchange Service (DAAD).

Research supported in part by the Japan Science and Technology Corporation (JST).

Research fellow of the Japan Society for the Promotion of Science (JSPS).

This is a preview of subscription content, log in via an institution.

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R. M. Burstall and J. Darlington. A transformation system for developing recursive programs. J. Assoc. Comput. Mach., 24:44–67, 1977.

    MATH  MathSciNet  Google Scholar 

  2. W.-N. Chin. Safe fusion of functional expressions II: Further improvements. Journal of Functional Programming, 4:515–555, 1994.

    Article  Google Scholar 

  3. O. Chitil. Type-inference based short cut deforestation (nearly) without inlining. In IFL’99, Lochem, The Netherlands, Proceedings, September 1999, volume 1868 of LNCS, pages 19–36. Springer-Verlag, April 2000.

    Google Scholar 

  4. B. Courcelle and P. Franchi-Zannettacci. Attribute grammars and recursive program schemes. Theor. Comp. Sci., 17:163–191, 235–257, 1982.

    Article  MathSciNet  Google Scholar 

  5. J. Engelfriet. Some open questions and recent results on tree transducers and tree languages. In R.V. Book, editor, Formal language theory; perspectives and open problems, pages 241–286. New York, Academic Press, 1980.

    Google Scholar 

  6. J. Engelfriet and H. Vogler. Macro tree transducers. J. Comp. Syst. Sci., 31:71–145, 1985.

    Article  MATH  MathSciNet  Google Scholar 

  7. J. Engelfriet and H. Vogler. Modular tree transducers. Theor. Comp. Sci., 78:267–304, 1991.

    Article  MATH  MathSciNet  Google Scholar 

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

    MATH  Google Scholar 

  9. Z. Fülöp, F. Herrmann, S. Vágvölgyi, and H. Vogler. Tree transducers with external functions. Theor. Comp. Sci., 108:185–236, 1993.

    Article  MATH  Google Scholar 

  10. Z. Fülöp and H. Vogler. Syntax-directed semantics — Formal models based on tree transducers. Monographs in Theoretical Computer Science. Springer-Verlag, 1998.

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  13. A. Gill. Cheap deforestation for non-strict functional languages. PhD thesis, University of Glasgow, 1996.

    Google Scholar 

  14. A. Gill, J. Launchbury, and S.L. Peyton Jones. A short cut to deforestation. In FPCA’93, Copenhagen, Denmark, Proceedings, pages 223–231. ACM Press, 1993.

    Google Scholar 

  15. M. Höff. Vergleich von Verfahren zur Elimination von Zwischenergebnissen bei funktionalen Programmen. Master’s thesis, Dresden University of Technology, 1999.

    Google Scholar 

  16. D.E. Knuth. 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 

  17. A. Kühnemann. Benefits of tree transducers for optimizing functional programs. In FST & TCS’98, Chennai, India, Proceedings, volume 1530 of LNCS, pages 146–157. Springer-Verlag, December 1998.

    Google Scholar 

  18. A. Kühnemann. Comparison of deforestation techniques for functional programs and for tree transducers. In FLOPS’99, Tsukuba, Japan, Proceedings, volume 1722 of LNCS, pages 114–130. Springer-Verlag, November 1999.

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  20. M. H. Sørensen, R. Glück, and N. D. Jones. A positive supercompiler. Journal of Functional Programming, 6:811–838, 1996.

    MATH  Google Scholar 

  21. J.W. Thatcher. Generalized 2 sequential machine maps. J. Comp. Syst. Sci., 4:339–367, 1970.

    MATH  MathSciNet  Google Scholar 

  22. V. F. Turchin. The concept of a supercompiler. ACM TOPLAS, 8:292–325, 1986.

    Article  MATH  Google Scholar 

  23. P. Wadler. The concatenate vanishes. Note, University of Glasgow, December 1987 (Revised, November 1989).

    Google Scholar 

  24. P. Wadler. 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

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kühnemann, A., Glück, R., Kakehi, K. (2001). Relating Accumulative and Non-accumulative Functional Programs. In: Middeldorp, A. (eds) Rewriting Techniques and Applications. RTA 2001. Lecture Notes in Computer Science, vol 2051. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45127-7_13

Download citation

  • DOI: https://doi.org/10.1007/3-540-45127-7_13

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42117-7

  • Online ISBN: 978-3-540-45127-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics