Turner's combinator implementation (1979) of functional programs requires the memory space of size Ω(n2) in the worst case for translating given lambda expressions of length n to combinator graphs. In this paper a new idea named the BC-chain method for transferring actual arguments to variables is presented. We show that the BC-chain method requires only 0(n) space for the translation. The basic idea is to group together into a single entity a sequence of combinators B, B′, C and C′, for a variable, which appear consecutively along a path in the combinator graph. We formulate two reduction algorithms in the new representation. The first algorithm naively simulates the original normal order reduction, while the second algorithm simulates it in constant time per unit operation of the original reduction. Another reduction method is also suggested, and a technique for practical implementation is briefly mentioned.
[1]
S. Kamal Abdali,et al.
An abstraction algorithm for combinatory logic
,
1976,
Journal of Symbolic Logic.
[2]
F. Warren Burton.
A Linear Space Translation of Functional Programs to Turner Combinators
,
1982,
Inf. Process. Lett..
[3]
Teruo Hikita,et al.
On the Average Size of Turner's Translation to Combinator Programs
,
1984
.
[4]
D. A. Turner,et al.
A new implementation technique for applicative languages
,
1979,
Softw. Pract. Exp..
[5]
D. A. Turner.
Another Algorithm for Bracket Abstraction
,
1979,
J. Symb. Log..
[6]
Kohei Noshita.
Translation of Turner Combinators in O(n log n) Space
,
1985,
Inf. Process. Lett..