A compositive abstraction algorithm for combinatory logic
The problem of the translation of λ-terms into combinators (bracket abstraction) is of great importance for the implementation of functional languages. In the literature there exist a lot of algorithms concerning this topic, each of which is based on a particular choice of a combinatory basis, of its cardinality, of an abstraction technique.
it employs a potentially infinite basis of combinators, each of which depends on at most two parameters and is, therefore, directly implementable;
it gives compact code, introducing a number of basic combinators which is proportional to the size of the expression to be abstracted and invariant for one and multi-sweep abstraction techniques;
it gives the result in the form R I M 1...M n, where R is a regular combinator expressed as a composition of basic combinators, I is the identity combinator, and M 1,...,M n are the constant terms appearing into the expression subjected to the translation process.
It comes out that a slight modification of the algorithm yields a combinatory equivalent of Hughes' supercombinators.
KeywordsFunctional programming Compiler design Evaluation techniques
- [Bar]-H.P. Barendregt, The Lambda Calculus, its Syntax and Semantics, Studies in Logic, Vol.103, North-Holland, Amsterdam (1984).Google Scholar
- [Cur30]-H.B.Curry, Grundlagen der kombinatorischen Logik, American Journal of Mathematics, Vol.52 (1930).Google Scholar
- [Cur32]-H.B.Curry, Some additions to the theory of combinators, American Journal of Mathematics, Vol.54 (1932).Google Scholar
- [Cur33]-H.B.Curry, Apparent variables from the standpoint of Combinatory Logic, Annals of Mathematics, Vol.34 (1933).Google Scholar
- [CurFe]-H.B. Curry & R. Feys, Combinatory logic, Vol.1, North-Holland, Amsterdam (1958).Google Scholar
- [Hug]-R.J.M.Hughes, SuperCombinators: a new implementation method for Applicative Languages, Symp.on LISP and Funct.Progr.,ACM (Aug 1982).Google Scholar
- [Mul]-J.C.Mulder, Complexity of combinatory code, University of Utrecht (int.rep., 1985).Google Scholar
- [Ptes]-A.Piperno, Metodi di astrazione in logica combinatoria: analisi, proposte, applicazioni, Tesi di laurea, 1986.Google Scholar
- [Sta]-R. Statman, On translating lambda terms into combinators: the basis problem, LICS, Boston, 1986.Google Scholar
- [Tur79a]-D.A.Turner, Another algorithm for bracket abstraction, The Journal of Symbolic Logic, Vol.44 n.2 (1979).Google Scholar
- [Tur79b]-D.A.Turner, A new implementation technique for applicative languages, Software Practice and Experience, n.9 (1979).Google Scholar