## Higher-Order Redundancy Elimination (1994)

### Cached

### Download Links

- [ftp.dina.kvl.dk]
- [repository.readscheme.org]
- DBLP

### Other Repositories/Bibliography

Venue: | Workshop Partial Evaluation and Semantics-Based Program Manipulation '94 |

Citations: | 5 - 2 self |

### BibTeX

@INPROCEEDINGS{Thiemann94higher-orderredundancy,

author = {Peter Thiemann},

title = {Higher-Order Redundancy Elimination},

booktitle = {Workshop Partial Evaluation and Semantics-Based Program Manipulation '94},

year = {1994},

pages = {73--84},

publisher = {ACM}

}

### OpenURL

### Abstract

Functional programs often define functions by pattern matching where patterns may inadvertedly overlap through successive function calls. This leads to hidden inefficiencies since the recursively called function possibly repeats redundant tests while trying to match the pattern. An analysis which is based on conservative symbolic execution (similar to higher order constant propagation) is proposed for a strict higher-order language to drive an arity raiser which generates specialized versions for functions with partially known arguments. To ensure termination only the definitely consumed part of the partially known arguments is considered. 1 Introduction Pattern matching is ubiquitous in modern functional programming languages like ML or Haskell. It is a convenient tool to build readable programs that process algebraic datatypes. However, pattern matching is a high-level concept that the compiler must transform into sequences of test operations. Patterns must be unnested to yield flat...

### Citations

1658 | The Definition of Standard ML
- Milner, Tofte, et al.
- 1990
(Show Context)
Citation Context ...ives some conclusions and discusses further work. 2 Examples The following examples demonstrate that the proposed method applies to real programs that occur in practice. We make use of a subset of ML =-=[MTH90]-=- which is formally defined later on in Fig. 1. We take the liberty of using list brackets and the infix list constructor :: so as to improve readability. 2.1 Mergesort Consider the following part of a... |

477 | Comprehending monads
- Wadler
- 1992
(Show Context)
Citation Context ...et of finite sequences over A, and P(A) is the powerset of A. To ease reading the semantic equations we will use a comprehension notation for heap transformations (cf. the monad of state transformers =-=[Wad90a]-=-). A heap transformation is a function of type HST(x) = Heap ! x \Theta Heap. It accepts a heap and returns a result of type x paired with a (modified) heap. A comprehension [e j q] consists of a body... |

432 | Deforestation: transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...her functions as well. It will terminate since there is only a finite number of functions and each has a finite number of arguments. 5 Related Work The deforestation algorithm originating from Wadler =-=[Wad90b]-=- and further pursued by Chin [Chi92] and Hamilton and Jones [HJ92] is conceived to eliminate intermediate structured data (trees, list, etc.) by symbolic composition. Our method can sometimes avoid da... |

183 | The concept of a supercompiler
- Turchin
(Show Context)
Citation Context ...ourse flattening of pairs and tuples may also be integrated into the presented framework. It should be noted that Romanenko's work is inspired by the concept of supercompilation introduced by Turchin =-=[Tur86] in -=-the 70s. Our method may be seen as an environment based special case of positive supercompilation, a term coined by Gluck, Jones, Klimov, and S��rensen [GK93, SGJ94]. Supercompilation is a general... |

175 | Unboxed objects and polymorphic typing
- Leroy
- 1992
(Show Context)
Citation Context ...ming arity raising on closures results in passing closure contents as parameters without packaging them together. The effect is similar to handling some closures in unboxed state as proposed by Leroy =-=[Ler92]-=-. As a matter of fact, as our transformed programs use tupling a lot, they should benefit from his unboxed tuples. We were also made aware of the description of a higher-order arity raiser due to Stee... |

91 | Automatic online partial evaluation
- Weise, Conybeare, et al.
- 1991
(Show Context)
Citation Context ...inal measure is to put an upper bound on the number of pending calls to a single function (or uses of a specific call site). More advanced techniques are being used in online partial evaluators (i.e. =-=[WCRS91]-=-) but we will defer using them until practical experiences have been gathered. 3.3 Consumption Analysis In order to correctly prune call patterns later on we must be able to determine which part of an... |

86 |
Compiling pattern matching
- Augustsson
- 1985
(Show Context)
Citation Context ... into sequences of test operations. Patterns must be unnested to yield flat patterns which can then be implemented as constructor tests and selector operations. Methods to achieve this are well known =-=[Aug85]-=-. Nested patterns are often a subtle source of inefficiency. In their presence it is quite often the case that function arguments are partially known so that the patterns of successive calls overlap. ... |

64 | Occam’s razor in metacomputation: the notion of a perfect process tree - Glück, Klimov - 1993 |

61 |
Safe fusion of functional expressions
- CHIN
- 1992
(Show Context)
Citation Context ...ate since there is only a finite number of functions and each has a finite number of arguments. 5 Related Work The deforestation algorithm originating from Wadler [Wad90b] and further pursued by Chin =-=[Chi92]-=- and Hamilton and Jones [HJ92] is conceived to eliminate intermediate structured data (trees, list, etc.) by symbolic composition. Our method can sometimes avoid data construction but it can not achie... |

29 | Arity raiser and its use in program specialization
- Romanenko
- 1990
(Show Context)
Citation Context ...low to memorize data constructors that are already tested and decomposed. The arguments of the remembered constructor are added to the function's argument list (this technique is called arity raising =-=[Rom90]-=-) and the structure remains unallocated. On the machine level functional values (partial applications) are represented as closures, i.e. tuples consisting of a code address and the values of some argu... |

25 | Towards unifying partial evaluation, deforestation, supercompilation, and GPC - Sørensen, Glück, et al. - 1994 |

20 | Towards unifying partial evaluation, deforestation, supercompilation, and GPC - S��rensen, Gluck, et al. - 1994 |

12 |
Extending deforestation for first order functional programs
- Hamilton, Jones
- 1992
(Show Context)
Citation Context ...e number of functions and each has a finite number of arguments. 5 Related Work The deforestation algorithm originating from Wadler [Wad90b] and further pursued by Chin [Chi92] and Hamilton and Jones =-=[HJ92]-=- is conceived to eliminate intermediate structured data (trees, list, etc.) by symbolic composition. Our method can sometimes avoid data construction but it can not achieve a deforestation effect sinc... |

4 |
Type Systems for Programming Languages, volume B of Handbook of Theoretical
- Mitchell
- 1990
(Show Context)
Citation Context ...type by listing all of its constructors and their types. Although types are not explicitly mentioned in the syntax we assume all expressions well-typed with a monomorphic typing discipline (see i.e., =-=[Mit90]-=-). We will only make use of type information to make the distinction between base types, algebraic types, and function types. An expression is either a variable, a constant of some base type, the name... |

4 |
Avoiding repeated tests in pattern matching
- Thiemann
(Show Context)
Citation Context ...e supercompilation only propagates positive information through execution histories. However, both have only been investigated for first-order languages. The present work generalizes a previous paper =-=[Thi93]-=- in several aspects: our earlier work only addresses a firstorder subset of ML. The use of type information is not considered and hence constants of base type cannot be handled. Furthermore the previo... |

4 | The De nition of Standard ML.MIT - Milner, Tofte, et al. - 1990 |

2 |
Parameter splitting in a higher-order functional language
- Steensgaard, Marquard
- 1990
(Show Context)
Citation Context ..., as our transformed programs use tupling a lot, they should benefit from his unboxed tuples. We were also made aware of the description of a higher-order arity raiser due to Steensgaard and Marquard =-=[SM90]-=-. Unfortunately we were unable to obtain it in time to discuss it here. 6 Conclusions and Future Work We have demonstrated a practically feasible analysis and specialization method which can speed up ... |

1 | Extending deforestation for rst order functional programs - Hamilton, Jones - 1992 |