Comparison of closure reduction and combinatory reduction schemes
We analyze the efficiencies of closure reduction and combinatory reduction schemes by introducing a labelled tree representing a λ-term. Translation of a λ-term into combinatory terms, i.e. bracket abstraction, can be viewed as attaching labels S, B, C, K, I to each node. Similarly, a node of a tree representing a λ-term can be labelled depending upon the presence of free variables in the subtrees. Resulting labelled trees which represent a λ-term and the translated combinatory term are made similar, i.e. whose underlying trees are the same. We can then make performance comparisons in terms of the cost involved in traversing the labelled trees by machine models reflecting the essential behaviors of Turner's combinatory reducer and a closure reducer. Our work is an elaboration of Turner's and Peyton Jones's experiments of combinatory reductions. However, our approach is not to resort to actual runs of programs, but is more theoretical, based on abstract machine models working on labelled trees.
Our conclusion of the performance comparisons is that a closure reducer is in most cases more efficient than combinatory reducers in terms of storage consumption which is a dominant factor in determining the overall performance of the reducers. Furthermore, we show that the two reducers which seem quite different at first sight is in fact very similar and with small modifications the two schemes become essentially the same.
Keywords and phrasesλ-calculus combinatory logic functional programming reduction machine
Unable to display preview. Download preview PDF.
- Barendregt, H. P., The Lambda Calculus, its Syntax and Semantics, North-Holland Pub. Co., 1981Google Scholar
- de Bruijn, N. G., Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem Indag Math, 34, 381–392Google Scholar
- Hikita, T., On the average size of Turner's translation to combinator programs, Journal of Information Processing, 7(1984) 164–169Google Scholar
- Hughes, R. J. M., Super combinators: A new implementation method for applicative languages, Conference Record of the 1982 ACM symposium on LISP and functional programming (Aug. 1982), 1–10Google Scholar
- Keller, R. M., FEL (Function-Equation Language) Programmer's Guide AMPS Technical Memorandum No. 7, Department of Computer Science, Univ. of Utah, March 1982, Revised April 1983Google Scholar
- Kennaway, J. R., The complexity of a translation of λ-calculus to combinators, University of East Anglia, Report CS/82/23/E, 1982Google Scholar
- Knuth, D. E., The Art of Computer Programming, 2nd edition, Vol. 1, Addison-Wesley Pub. Co.Google Scholar
- Landin, P. J., The mechanical evaluation of expressions, The Computer Journal, Vol. 6, (1964), 308–320Google Scholar
- Peyton Jones, S. L., An investigation of the relative efficiency of combinators and lambda expressions, Conference Record of the 1982 ACM symposium on LISP and functional programming (Aug. 1982), 150–158Google Scholar
- Turner, D., A new implementation technique for applicative languages, Software-Practice and Experiences, Vol. 9, (1979), 31–49Google Scholar
- Warren, D., Implementing PROLOG — Compiling logic programs, 1 and 2, D.A.I. Research Report No. 39 and 40, University of Edinbough, 1977Google Scholar