Driving in the Jungle

  • Jens Peter Secher
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2053)


Collapsed jungle evaluation is an evaluation strategy for functional programs that can give super-linear speedups compared to conventional evaluation strategies such as call-by-need. However, the former strategy may incur administrative evaluation overhead. We demonstrate how this overhead can be eliminated by transforming the program using a variation of positive supercompilation in which the transformation strategy is based on collapsed jungle evaluation. In penetrating the constantfactor barrier, we seem to be close to establishing a transformation technique that guarantees the efficiency of the transformed program. As a spin-off, we clarify the relationship between call-by-name, call-by-need and collapsed-jungle evaluation, showing that all three can be expressed as instances of a common semantics in which the variations — differing only in efficiency — are obtained by varying the degree of sharing in a dag representation.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the Association for Computing Machines, 24(1):44–67, 1977.zbMATHMathSciNetGoogle Scholar
  2. [2]
    Wei-Ngan Chin. Towards an automated tupling strategy. In Proceeding of the ACM SIGPLAN Syposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 119–132, Copenhagen, Denmark, 14–16 June 1993. ACM Press.CrossRefGoogle Scholar
  3. [3]
    D. De Schreye, R. Glück, J. Jørgensen, M. Leuschel, B. Martens, and M. H. Sørensen. Conjunctive partial deduction: Foundations, control, algorithms, and experiments. Journal of Logic Programming, 41(2-3):231–277, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  4. [4]
    J. Gallagher. Tutorial in specialisation of logic programs. In Proceeding of the ACM SIGPLAN Syposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 88–98. ACM Press, 1993.Google Scholar
  5. [5]
    R. Glück and A.V. Klimov. Occam’s razor in metacomputation: the notion of a perfect process tree. In P. Cousot, M. Falaschi, G. Filè, and G. Rauzy, editors, Workshop on Static Analysis, volume 724 of Lecture Notes in Computer Science, pages 112–123. Springer-Verlag, 1993.Google Scholar
  6. [6]
    Annegret Habel, Hans-Jörg Kreowski, and Detlef Plump. Jungle evaluation. Fundamenta Informaticae, XV:37–60, 1991.Google Scholar
  7. [7]
    Berthold Hoffmann and Detlef Plump. Implementing term rewriting by jungle evaluation. RAIRO Theoretical Informatics and Applications, 25(5):445–472, 1991.zbMATHMathSciNetGoogle Scholar
  8. [8]
    N.D. Jones, P. Sestoft, and H. Søndergaard. Mix: a self-applicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation, 2(1):9–50, 1989.CrossRefGoogle Scholar
  9. [9]
    Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.Google Scholar
  10. [10] Michael Leuschel. On the power of homeomorphic embedding for online termination. In Georgio Levi, editor, Static Analysis. Proceedings, volume 1503 of Lecture Notes in Computer Science, pages 230–245, Pisa, Italy, September 1998. Springer-Verlag.CrossRefGoogle Scholar
  11. [11]
    A. Pettorossi, E. Pietropoli, and M. Proietti. The use of the tupling strategy in the development of parallel programs. In R. Paige, J. Reif, and R. Wachter, editors, Parallel Algorithm Derivation and Program Transformation, pages 111–151. Kluwer Academic Publishers, 1993.Google Scholar
  12. [12]
    Alberto Pettorossi. A powerful strategy for deriving efficient programs by transformation. In Conference Record of the 1984 ACM Symposium on Lisp and Functional Programming, pages 273–281. ACM, ACM, August 1984.Google Scholar
  13. [13]
    Gordon D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Computer Science Department, Aarhus University, Aarhus, Denmark, September 1981.Google Scholar
  14. [14]
    M.H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In J.W. Lloyd, editor, Logic Programming: Proceedings of the 1995 International Symposium, pages 465–479. MIT Press, 1995.Google Scholar
  15. [15]
    M.H. Sørensen, R. Glück, and N.D. Jones. A positive supercompiler. Journal of Functional Programming, 6(6):811–838, 1996.zbMATHCrossRefGoogle Scholar
  16. [16]
    Morten Heine Sørensen and Robert Glück. Introduction to supercompilation. In John Hatcliff, Torben Mogensen, and Peter Thiemann, editors, Partial Evaluation: Practice and Theory, volume 1706 of Lecture Notes in Computer Science, pages 246–270. Springer-Verlag, 1999.Google Scholar
  17. [17]
    Morten Heine B. Sørensen. Convergence of program transformers in the metric space of trees. Science of Computer Programming, 37(1-3):163–205, May 2000.zbMATHCrossRefMathSciNetGoogle Scholar
  18. [18]
    V. F. Turchin. The algorithm of generalization in the supercompiler. In D. Bjørner, A. P. Ershov, and N. D. Jones, editors, Partial Evaluation and Mixed Computation, pages 531–549, Amsterdam: North-Holland, 1988. Elsevier Science Publishers B.V.Google Scholar
  19. [19]
    V.F. Turchin. The concept of a supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, 1986.zbMATHCrossRefMathSciNetGoogle Scholar
  20. [20]
    V.F. Turchin and A.P. Nemytykh. A self-applicable supercompiler. Technical Report CSc. TR 95-010, City College of the City University of New York, 1995.Google Scholar
  21. [21]
    P.L. Wadler. Deforestation: Transforming programs to eliminate intermediate trees. Theoretical Computer Science, 73:231–248, 1990.zbMATHCrossRefMathSciNetGoogle Scholar
  22. [22]
    Christopher Peter Wadsworth. Semantics and pragmatics of the lambda calculus. Ph.D. thesis, Programming Research Group, Oxford University, September 1971.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Jens Peter Secher
    • 1
  1. 1.Department of Computer ScienceUniversity of Copenhagen (DIKU)Copenhagen ØDenmark

Personalised recommendations