Tree Transducer Composition as Deforestation Method for Functional Programs

Authors: A. Kühnemann and J. Voigtländer
Published: Technical Report TUD-FI01-07, Technische Universität Dresden, August 2001.
BibTeX: KV01.bib
Abstract: We demonstrate that composition techniques for tree transducers are suitable to eliminate intermediate results in functional programs. We consider two composition techniques, which view special functional programs as (restricted) macro tree transducers: The first uses composition techniques for macro tree transducers directly. The second is indirect in that it (i) translates macro tree transducers into attributed tree transducers, (ii) uses a composition technique for attributed tree transducers, and (iii) translates the composition result back into a macro tree transducer. We informally compare these techniques with the deforestation technique of Wadler. In particular we show that the composition techniques eliminate intermediate results for certain kinds of function definitions, for which classical deforestation fails.