## Formal Efficiency Analysis for Tree Transducer Composition (2004)

### Cached

### Download Links

- [wwwtcs.inf.tu-dresden.de]
- [wwwtcs.inf.tu-dresden.de]
- [www.iai.uni-bonn.de]
- DBLP

### Other Repositories/Bibliography

Citations: | 6 - 1 self |

### BibTeX

@MISC{Voigtländer04formalefficiency,

author = {Janis Voigtländer},

title = {Formal Efficiency Analysis for Tree Transducer Composition},

year = {2004}

}

### OpenURL

### Abstract

We study the question of efficiency improvement or deterioration for a semantics-preserving program transformation technique for (lazy) functional languages, based on composition of restricted macro tree transducers. By annotating programs to reflect the intensional property ``computation time'' explicitly in the computed output and by manipulating such annotations, we formally prove syntactic conditions under which the composed program is guaranteed to be not less efficient than the original program with respect to the number of call-by-name reduction steps required to reach normal form. Under additional conditions the guarantee also holds for call-by-need semantics. The criteria developed can be checked automatically and efficiently, and thus are suitable for integration into an optimizing compiler.

### Citations

400 | Deforestation: Transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ... sake of reliability, maintainability, and reusability—and efficiency of programs. Under the name deforestation, automatic elimination of structured intermediate results (i.e. trees) was pioneered in =-=[Wad90]-=- through an algorithmic instance of the unfold/fold-technique [BD77] that is suitable for integration into an optimizing compiler. This unfold/fold-based approach has seen many extensions— e.g. in [HJ... |

119 |
Mappings and grammars on trees
- Rounds
- 1970
(Show Context)
Citation Context ...for tree transducer composition, and for functional programs in general. (7)s5.1 Tree transducer composition 43 5.1 Tree transducer composition Composition of tree transducers was first considered in =-=[Rou70]-=- for two tdtts, to be composed into a single one. Using a (reversible) decomposition of mtts into tdtts and certain substitution devices [Eng80], the composition of tdtts was reused in [Eng81] to comp... |

111 | Semantics and pragmatics of the lambda calculus - Wadsworth - 1971 |

77 | Automatic complexity analysis - Rosendahl - 1989 |

61 | Total correctness by local improvement in the transformation of functional programs
- Sands
- 1996
(Show Context)
Citation Context ...analyze on a general level the relative efficiency for pairs of two closely connected programs, namely the input and output programs of Construction 3.1. In this respect our aim is similar to that of =-=[San96b]-=-, where a call-by-name improvement relation (a nonsymmetric counterpart to the cost equivalence of [San95]) is used to prove the correctness—and, more as a side product, also call-by-name efficiency n... |

56 | Generalized2 sequential machine maps - Thatcher |

42 | Shortcut fusion for accumulating parameters & zip-like functions - Svenningsson - 2002 |

39 | Improvement in a lazy context: an operational theory for call-by-need
- Moran, Sands
- 1999
(Show Context)
Citation Context ...cheme in Section 4.3 so that eventually Lemma 4.10 could be proved. The same aspect prevents the application—to our construction—of the call-by-need variant of the approach from [San96b] developed in =-=[MS99]-=-. 6 Conclusion We have developed sufficient conditions for efficiency improvement by tree transducer composition in lazy functional languages. The key was to annotate programs thus that their outputs ... |

39 | A Naïve Time Analysis and its Theory of Cost Equivalence
- Sands
- 1995
(Show Context)
Citation Context ...llby-need steps are derived by formally describing this “need” using strictness analysis (see also the related approach in [BH89]). To avoid the problem of having to compute exact demand information, =-=[San95]-=- developed a more operational approach leading to a theory of call-by-name cost equivalence, an axiomatization of which is given by annotating functional programs with a special identity function that... |

39 | Generalized sequential machine maps - Thatcher - 1970 |

35 | Strictness analysis aids time analysis
- Wadler
- 1988
(Show Context)
Citation Context ...ent depends on how much of the argument’s value is actually “needed”, the total cost of a function application cannot be understood solely from the cost properties of its ingredients in isolation. In =-=[Wad88]-=- step-counting versions computing upper bounds for the number of callby-need steps are derived by formally describing this “need” using strictness analysis (see also the related approach in [BH89]). T... |

31 | Proving the correctness of recursion-based automatic program transformations
- Sands
- 1996
(Show Context)
Citation Context ...ement regarding this transformation is that it does not increase the number of call-by-need reduction steps for linear programs (the number of call-by-name steps, respectively, for arbitrary programs =-=[San96a]-=-, where call-by-name means leftmost-outermost reduction without sharing, which in turn is similar to outside-in or OI derivation, not enforcing left-to-right evaluation, in the tree transducer literat... |

20 | Composition of Functions with Accumulating Parameters
- Voigtlander, Kuhnemann
(Show Context)
Citation Context ... in input programs), none of the techniques proposed to date for eliminating intermediate results produced inside accumulating parameters handles a richer class of programs than the construction from =-=[VK04a]-=-. The latter’s direct nature made it suitable for integration into an optimizing compiler for the lazy functional language Haskell [Reu03]. Beside preservation of program semantics (which for the tech... |

19 | P.: Deforestation for higher-order functions
- Marlow, Wadler
- 1992
(Show Context)
Citation Context ...ugh an algorithmic instance of the unfold/fold-technique [BD77] that is suitable for integration into an optimizing compiler. This unfold/fold-based approach has seen many extensions— e.g. in [HJ92], =-=[MW93]-=-, and [Chi94]—, which we will collectively refer to as classical deforestation in the following. A fundamental weakness of classical deforestation is its inability to eliminate intermediate results th... |

15 | Using circular programs to deforest in accumulating parameters
- Voigtländer
- 2002
(Show Context)
Citation Context ...ls and motivation, please consult [Voi05]. 5 Related work In [VK04a] and [Voi05] the presented composition construction is compared with classical and shortcut deforestation and with lazy composition =-=[Voi04b]-=- on a qualitative level and based on examples. Here we relate it to (other) composition techniques for tree transducers (and for attribute grammars). We also discuss previous work on efficiency analys... |

9 | Composition of restricted macro tree transducers
- Voigtlander
- 2001
(Show Context)
Citation Context ... · · ψs) · · · parM2,φ(πj, g, l) = ψl[v1, . . . , vq ¡ − sub(φ, π1), . . . , sub(φ, πq), z1, . . . , zs ′ ¡ − parM2,φ(π, g ′ , 1), . . . , parM2,φ(π, g ′ , s ′ )]. The following theorem was proved in =-=[Voi01]-=-; a more detailed account is in [VK04b]. Theorem 3.2 (correctness of Constr. 3.1; Theorem 5.2 of [VK04a]) τM1 ; τM2 = τ M1;M2 For a detailed protocol of the presented construction in action for two co... |

7 | Functional description of the contextual analysis in block-structured programming languages: a case study of tree transducers - Vogler - 1991 |

6 | Conditions for efficiency improvement by tree transducer composition
- Voigtländer
- 2002
(Show Context)
Citation Context ...ioration with respect to this measure. For the special case that one of the mtts to be composed is a tdtt sufficient conditions were developed in [Küh99] and [Höf99] using rather ad-hoc reasoning. In =-=[Voi02]-=- we have studied this case using a more systematic approach, which in the work presented here is extended to the full construction from [VK04a], thus providing the first formal efficiency guarantees f... |

5 |
Fusion with stacks and accumulating parameters
- Nishimura
- 2004
(Show Context)
Citation Context ...thout context parameters. Thus, it captures a result from [EV85] that was used in [Küh99] as another application of tree transducer theory to accumulating parameter deforestation. In fact, except for =-=[Nis04]-=- (allowing a restricted use of stacks in input programs), none of the techniques proposed to date for eliminating intermediate results produced inside accumulating parameters handles a richer class of... |

4 |
Tree Transducer Composition as Program Transformation
- Voigtländer
- 2005
(Show Context)
Citation Context ...ults and cover many typical examples. They are decidable and we present an efficient decision procedure (also suitable for integration into an optimizing compiler), correctness of which was proved in =-=[Voi05]-=-. The general idea behind our approach to efficiency analysis is that of annotating programs to reflect computation time in the observable output. A certain “decomposition” of the respective annotatio... |

3 |
Macro tree transducers
- Vogler
- 1985
(Show Context)
Citation Context .... α n0+···+nk δ ɛ β 2m1−1 ɛ Figure 1: τMspine β 2mk−1 Definition 2.4 (syntactic restrictions of mtts) An mtt M = (F, Σ, ∆, e, R) is: − a top-down tree transducer (for short tdtt) if F = F (1) − basic =-=[Vog87]-=- if e and the right-hand sides of the rules in R do not contain any nested calls, i.e. subtrees of the form (f · · · (f ′ · · ·) · · ·) with f, f ′ ∈ F − weakly single-use if for every σ ∈ Σ (p) , i ∈... |

3 | Conditions for e#ciency improvement by tree transducer composition - Voigtlander - 2002 |

2 | Deforesting in accumulating parameters via type-directed transformations - Nishimura - 2002 |

1 |
Implementing tree transducer composition for the Glasgow Haskell Compiler
- Reuther
- 2003
(Show Context)
Citation Context ...handles a richer class of programs than the construction from [VK04a]. The latter’s direct nature made it suitable for integration into an optimizing compiler for the lazy functional language Haskell =-=[Reu03]-=-. Beside preservation of program semantics (which for the technique from [VK04a] was proved in [Voi01, VK04b]) more intensional properties are in focus when considering program transformations. The ke... |

1 |
Proof appendix of [VK04a], 2004. Available from http://wwwtcs.inf.tu-dresden.de/#voigt/JFP-appendix.pdf
- Voigtlander, Kuhnemann
(Show Context)
Citation Context ...1, . . . , vq ¡ − sub(φ, π1), . . . , sub(φ, πq), z1, . . . , zs ′ ¡ − parM2,φ(π, g ′ , 1), . . . , parM2,φ(π, g ′ , s ′ )]. The following theorem was proved in [Voi01]; a more detailed account is in =-=[VK04b]-=-. Theorem 3.2 (correctness of Constr. 3.1; Theorem 5.2 of [VK04a]) τM1 ; τM2 = τ M1;M2 For a detailed protocol of the presented construction in action for two concrete mtts, please consult Section 5.2... |

1 | Fusion in practice - Arkel, Groningen, et al. - 2002 |