Abstract
The efficiency of tail recursion and the simplicity of its removal makes some people wonder why we cannot transform all recursive definitions to this form? Clearly, the usual trick of introducing a new variable and using it as an accumulator to hold the intermediate results during the winding phase does not always work. But, by trying to generalize this technique to primitive recursion one can easily find a sufficient condition which makes it work. The class of functions satisfying this condition may be interesting also on its own. A direct generalization of this function class for mutual recursion is fairly straightforward.
Index Terms
Experimenting with tail-recursion and simulating coroutines
Recommendations
Tail recursion by using function generalization
ITiCSE '09: Proceedings of the 14th annual ACM SIGCSE conference on Innovation and technology in computer science educationThe design of tail recursive algorithms may require thinking about iteration rather than recursion. This paper provides a methodology for deriving tail recursive functions that is based on declarative programming and the concept of function ...
Proper tail recursion and space efficiency
PLDI '98: Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementationThe IEEE/ANSI standard for Scheme requires implementations to be properly tail recursive. This ensures that portable code can rely upon the space efficiency of continuation-passing style and other idioms. On its face, proper tail recursion concerns the ...
A Difference in Complexity Between Recursion and Tail Recursion
There are several ways to understand computability over first-order structures. We may admit functions given by arbitrary recursive definitions, or we may restrict ourselves to "iterative," or tail recursive, functions computable by nothing more ...






Comments