Skip to main content

Better consumers for deforestation

Extended abstract

  • Conference paper
  • First Online:
Programming Languages: Implementations, Logics and Programs (PLILP 1995)

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

Abstract

We describe a novel approach to achieve better deforestation by pre-processing a program before subjecting it to actual deforestation. In particular, our approach performs some simple syntactic analyses, and proactively specialises all functions in a program into treeless consumer form. This simplifies greatly the task of deforestation in the later stage. The transformation we use is based on the well-understood fold/unfold strategy with generalisation on terms. We ensure the termination of the transformation. Compared to other existing semantics-based approaches, our syntactic-based approach is considerable simpler, but surprisingly powerful.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Wei-Ngan Chin and John Darlington. A higher-order removal method. Submitted for Publication, September 1994.

    Google Scholar 

  2. Wei-Ngan Chin. Safe fusion of functional expressions. In 7th ACM Lisp and Functional Programming Conference, pages 11–20, San Francisco, California, June 1992.

    Google Scholar 

  3. Wei-Ngan Chin and Siau-Cheng Khoo. Better consumers for program specialisation. Technical report, Dept of IS/CS, NUS, August 1995.

    Google Scholar 

  4. A. Gill, J. Launchbury, and S. Peyton-Jones. A short-cut to deforestation. In 6th ACM Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, June 1993.

    Google Scholar 

  5. R. Glück and Morten H. Sørensen. Partial deduction and driving are equivalent. In PLILP, Madrid, Spain, (Lect. Notes Comput. Sc.), Berlin Heidelberg New York: Springer, 1994.

    Google Scholar 

  6. Carsten Kehler Holst. Finiteness analysis. In 5th ACM Conference on Functional Programming Languages and Computer Architecture, pages 473–495, Cambridge, Massachusetts, August 1991.

    Google Scholar 

  7. M. Proietti and A. Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Proceedings of PLLLP, Passau, Germany, (Lect. Notes Comput. Sc., vol 528, pp. 347–258) Berlin Heidelberg New York: Springer, 1991.

    Google Scholar 

  8. C. Runciman, M. Firth, and N. Jagger. Transformation in a non-strict language: An approach to instantiation. In Glasgow Functional Programming Workshop, August 1989.

    Google Scholar 

  9. T. Sheard and L. Fegaras. A fold for all seasons. In 6th ACM Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, June 1993.

    Google Scholar 

  10. Morten H. Sørensen. A grammar-based data-flow analysis to stop deforestation. In Colloquium on Trees and Algebra in Programming (CAAP) LNCS 787, Edinburgh, April 1994.

    Google Scholar 

  11. Peter Thiemann. Avoiding repeated tests in pattern-matching. In 3rd International Workshop on Static Analysis, Padova, Italy, (Lect. Notes Comput. Sc., vol 724, pp. 141–152) Berlin Heidelberg New York: Springer, 1993.

    Google Scholar 

  12. Phil Wadler. Deforestation: Transforming programs to eliminate trees. In European Symposium on Programming, pages 344–358, Nancy, France, March 1988.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Manuel Hermenegildo S. Doaitse Swierstra

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Chin, WN., Khoo, SC. (1995). Better consumers for deforestation. In: Hermenegildo, M., Swierstra, S.D. (eds) Programming Languages: Implementations, Logics and Programs. PLILP 1995. Lecture Notes in Computer Science, vol 982. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026823

Download citation

  • DOI: https://doi.org/10.1007/BFb0026823

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-45048-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics