## Optimizing Algebraic Programs (1994)

Citations: | 4 - 1 self |

### BibTeX

@MISC{Sheard94optimizingalgebraic,

author = {Tim Sheard and Leonidas Fegaras},

title = {Optimizing Algebraic Programs},

year = {1994}

}

### OpenURL

### Abstract

This paper considers a programming language where all control is encoded in algebras

### Citations

421 | Deforestation: transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...n theorem rather than red, second it computes over a richer language, and terminates over the complete language rather than a syntactically identifiable subset. This algorithm automates deforestation =-=[8, 20, 19]-=- and fusion [2] for algebraic programs. From the promotion theorems we know only the property that the h i 's should obey, not how to compute them. The following construction is the basis for the norm... |

307 | Functional programming with bananas, lenses, envelopes, and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ...slated by the compiler into hom. 4 The Promotion Theorem. The promotion theorem for red describes the conditions under which the composition of a function g with a red can be expressed as another red =-=[14, 15]-=-. For a list algebra the theorem is given below. OE n () = g(f n ()) OE c (a; g(r)) = g(f c (a; r)) g(red[list]ff n ; f c g x) = red[list]fOE n ; OE c g x A similar theorem can be expressed for every ... |

201 | A short cut to deforestation
- Gill, Launchbury, et al.
- 1993
(Show Context)
Citation Context ...igher order removal phase and as illustrated in Section 6 can actually simplify higher order functions, and invents laws on the fly that Chin's algorithm must know a priori. Gill, Launchbury and Jones=-=[11]-=- describe a deforestation algorithm currently used in the Glasgow Haskell compiler. It uses two combinators fold -- and build k , and a higher order theorem which relates the composition of the two. T... |

113 | A fold for all seasons
- Sheard, Fougaras
- 1993
(Show Context)
Citation Context ...ch allow arbitrary recursive programs lack the structure necessary for this kind of automation without expensive analysis. The contributions of this paper are several. First we extend our earlier work=-=[5, 6, 17]-=- by embedding our optimizations in a richer language, and describe an improved algorithm for computing them. Our previous work focused on a restricted language which has now been extended to include a... |

60 |
Safe fusion of functional expressions
- Chin
- 1992
(Show Context)
Citation Context ...ed, second it computes over a richer language, and terminates over the complete language rather than a syntactically identifiable subset. This algorithm automates deforestation [8, 20, 19] and fusion =-=[2]-=- for algebraic programs. From the promotion theorems we know only the property that the h i 's should obey, not how to compute them. The following construction is the basis for the normalization algor... |

56 |
A system which automatically improves programs, Acta Informatica
- Burstall, Darlington
- 1976
(Show Context)
Citation Context ...this section we quickly outline three transformations in terms of traditional functional programming. The first two were first described over traditional functional programs by Burstall and Darlington=-=[1]-=-, the third is a generic construction of distributive laws we believe is new in any context. In subsequent sections we describe how algebraic programs make these transformations evident. 2.1 Simultane... |

50 |
Strong categorical datatypes I
- Cockett, Spencer
(Show Context)
Citation Context ...ugh composition of existing ones. Our implementation of ADL is the result of the influence of ideas from several areas. First, work by Malcom [14], Meijer, Fokkinga, and Paterson [15, 9], and Cockett =-=[3, 4]-=- which describe how to capture patterns of recursion for a large class of algebraic types in a uniform way. Many of the theorems which our transformation algorithms are based upon can be found here, s... |

36 |
Homomorphisms and promotability
- Malcolm
- 1989
(Show Context)
Citation Context ...slated by the compiler into hom. 4 The Promotion Theorem. The promotion theorem for red describes the conditions under which the composition of a function g with a red can be expressed as another red =-=[14, 15]-=-. For a list algebra the theorem is given below. OE n () = g(f n ()) OE c (a; g(r)) = g(f c (a; r)) g(red[list]ff n ; f c g x) = red[list]fOE n ; OE c g x A similar theorem can be expressed for every ... |

34 |
Listlessness is better than laziness: Lazy evaluation and garbage collection at compile time
- Wadler
- 1984
(Show Context)
Citation Context ...n theorem rather than red, second it computes over a richer language, and terminates over the complete language rather than a syntactically identifiable subset. This algorithm automates deforestation =-=[8, 20, 19]-=- and fusion [2] for algebraic programs. From the promotion theorems we know only the property that the h i 's should obey, not how to compute them. The following construction is the basis for the norm... |

26 |
Automatic Transformation of Series Expressions into Loops
- Waters
- 1991
(Show Context)
Citation Context ...on like theorems but while our experience with generic transformations is limited, our results so far have been quite encouraging. 8 Related Work This work is related to Water's on series expressions =-=[21]-=-. His techniques apply only to traversals of linear data structures such as lists, vectors, and streams. It is also related to Wadler's work on listlessness, and deforestation [19, 20, 8]. Deforestati... |

25 | Improving programs which recurse over multiple inductive structures
- Fegaras, Sheard, et al.
- 1994
(Show Context)
Citation Context ...ike to encode simple algorithms such as equality, unification, zip, and the nth element of a list function algebraically, and for these functions to be amenable to automatic transformations. Elsewhere=-=[7]-=- we report initial results on encoding these functions algebraically by generalizing the E$c i functors and the combinators. These generalizations have promotion like theorems but while our experience... |

23 | About charity
- Cockett, Fukushima
- 1992
(Show Context)
Citation Context ...ugh composition of existing ones. Our implementation of ADL is the result of the influence of ideas from several areas. First, work by Malcom [14], Meijer, Fokkinga, and Paterson [15, 9], and Cockett =-=[3, 4]-=- which describe how to capture patterns of recursion for a large class of algebraic types in a uniform way. Many of the theorems which our transformation algorithms are based upon can be found here, s... |

21 | When will deforestation stop
- Ferguson, Wadler
- 1988
(Show Context)
Citation Context ...n theorem rather than red, second it computes over a richer language, and terminates over the complete language rather than a syntactically identifiable subset. This algorithm automates deforestation =-=[8, 20, 19]-=- and fusion [2] for algebraic programs. From the promotion theorems we know only the property that the h i 's should obey, not how to compute them. The following construction is the basis for the norm... |

13 | Uniform traversal combinators: Definition, use and properties
- Fegaras, Sheard, et al.
- 1992
(Show Context)
Citation Context ...ch allow arbitrary recursive programs lack the structure necessary for this kind of automation without expensive analysis. The contributions of this paper are several. First we extend our earlier work=-=[5, 6, 17]-=- by embedding our optimizations in a richer language, and describe an improved algorithm for computing them. Our previous work focused on a restricted language which has now been extended to include a... |

13 | Type parametric programming
- Sheard
- 1993
(Show Context)
Citation Context ...ecursion for a large class of algebraic types in a uniform way. Many of the theorems which our transformation algorithms are based upon can be found here, second, our previous work on type reflection =-=[13, 16]-=-, and our work on program normalization[5, 6, 17]. 9 Conclusion The formalism outlined above combining normalization, Zr law calculation, and the tupling lemma with beta and eta contraction provides a... |

8 |
Algebraic Design Language (preliminary definition
- Kieburtz, Lewis
- 1994
(Show Context)
Citation Context ...orithm works over the entire extended language while the original algorithm worked only on a syntactically identifiable subset of the restricted language. Second, we report on an actual implementation=-=[12]-=- which includes a user oriented front-end as well as our optimizing back-end, and a compiler. Experiments with our implementation illustrate that is feasible, practical, and beneficial to program in a... |

4 |
A Transformational Approach to Database System Implementation
- Fegaras
- 1993
(Show Context)
Citation Context ...ch allow arbitrary recursive programs lack the structure necessary for this kind of automation without expensive analysis. The contributions of this paper are several. First we extend our earlier work=-=[5, 6, 17]-=- by embedding our optimizations in a richer language, and describe an improved algorithm for computing them. Our previous work focused on a restricted language which has now been extended to include a... |

3 |
Calculate Categorically! Formal Aspects
- Fokkinga
- 1992
(Show Context)
Citation Context ... own, other than through composition of existing ones. Our implementation of ADL is the result of the influence of ideas from several areas. First, work by Malcom [14], Meijer, Fokkinga, and Paterson =-=[15, 9]-=-, and Cockett [3, 4] which describe how to capture patterns of recursion for a large class of algebraic types in a uniform way. Many of the theorems which our transformation algorithms are based upon ... |

3 |
Tupling and Mutamorphisms
- Fokkinga
- 1989
(Show Context)
Citation Context ...l := 0; $cons :=s(x; y) : x+ yg x) This example transforms into red[list]f$nil := (0; 0); $cons :=s(x; (u; v)) : (1 + u; x + v)g x A general formula for this transformation is called the Tupling lemma=-=[10]-=-. It can be stated for red as follows: ( red[T ]f: : : ; $c i := f i ; : : :g x ; red[T ]f: : : ; $c i := g i ; : : :g x ) = red[T ]f: : : ; h (f i ffi (E$c i (id; first)); (g i ffi (E$c i (id; second... |

3 |
Generating Programs by Reflection. Oregon Graduate Institute
- Hook, Kieburtz, et al.
(Show Context)
Citation Context ...nction. Zr T has type T ! T ! T . A function h(x; y) = Zr y x is associative ( h(w; h(x; y)) = h(h(w; x); y) ), and has the zero, Z, for both a left and right identity ( h(x; Z) = x and h(Z; y) = y ) =-=[13]-=-. Recognize that Zr list is the list append operator, and that Zr nat is natural number addition. We postulate that zero replacement functions have an additional important property: 8 f ffl red[T ]; 9... |

2 | Uniform Traversal Combinators: De Use and Properties - Fegaras, Sheard, et al. - 1992 |

1 |
Optimizing Algebraic Programs. OGI, Tech-report #94-004. The Extended version of this paper. Ftp-able from cse.ogi.edu:/pub/pacsoft/papers/OptAlgProg.ps
- Sheard, Fegaras
(Show Context)
Citation Context ...ormalizing the two pieces of the promotion step independently, thereby no longer introducing any inverse terms. A proof of correctness of the normalization algorithm can be found in a technical report=-=[18]-=-. y Since in reality inv g may not exist, in the algorithm it only plays the role of a placeholder as shall see in the sequel. 5.2 Simultaneous Traversal and the Tupling Lemma Algebraic programs make ... |

1 | Generating Programs by Re Oregon Graduate Institute - Hook, Kieburtz, et al. |