Advertisement

Better consumers for deforestation

Extended abstract
  • Wei-Ngan Chin
  • Siau-Cheng Khoo
Conference paper
Part of the Lecture Notes in Computer Science book series (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.

Keywords

Function Call Specialisation Algorithm Recursive Call Derivation Sequence Call Pattern 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [CD94]
    Wei-Ngan Chin and John Darlington. A higher-order removal method. Submitted for Publication, September 1994.Google Scholar
  2. [Chi92]
    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. [CK95]
    Wei-Ngan Chin and Siau-Cheng Khoo. Better consumers for program specialisation. Technical report, Dept of IS/CS, NUS, August 1995.Google Scholar
  4. [GLPJ93]
    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. [GS94]
    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. [Hol91]
    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. [PP91]
    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. [RFJ89]
    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. [SF93]
    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. [Sør94]
    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. [Thi93]
    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. [Wad88]
    Phil Wadler. Deforestation: Transforming programs to eliminate trees. In European Symposium on Programming, pages 344–358, Nancy, France, March 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Wei-Ngan Chin
    • 1
  • Siau-Cheng Khoo
    • 1
  1. 1.Dept of Information Systems & Computer ScienceNational University of SingaporeSingapore

Personalised recommendations