## Improving Programs which Recurse over Multiple Inductive Structures (1994)

### Cached

### Download Links

- [www-sop.inria.fr]
- [ftp.dina.kvl.dk]
- [www.dina.kvl.dk]
- [cse.ogi.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'94 |

Citations: | 25 - 6 self |

### BibTeX

@INPROCEEDINGS{Fegaras94improvingprograms,

author = {Leonidas Fegaras and Tim Sheard and Tong Zhou},

title = {Improving Programs which Recurse over Multiple Inductive Structures},

booktitle = {In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'94},

year = {1994},

pages = {21--32}

}

### OpenURL

### Abstract

This paper considers generic recursion schemes for programs which recurse over multiple inductive structures simultaneously, such as equality, zip and the nth element of a list function. Such schemes have been notably absent from previous work. This paper defines a uniform mechanism for defining such programs and shows that these programs satisfy generic theorems. These theorems are the basis for an automatic improvement algorithm. This algorithm is an improvement over the algorithm presented earlier [14] because, in addition to inducting over multiple structures, it can be incorporated into any algebraic language and is no longer restricted to a "safe" subset. 1 Introduction In previous work [14, 15, 6, 4, 5] we have shown how programming algebraically with generic recursion schemes provides a theory amenable to program calculation [13]. This theory provides a basis for automatic optimization techniques which capture many well-known transformations. Unfortunately, these recursion sc...

### Citations

400 | Deforestation: Transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...Work To our knowledge no other work deals with generic recursion schemes over multiple structures. For simple inductions our work is closely related to Wadler's work on listlessness and deforestation =-=[17, 7, 16]-=- and to Chin's work on fusion [2]. Deforestation works on all first order treeless terms. A treeless term is one which is exactly analogous to a safe term, but is described in a much different manner ... |

298 | Functional programming with bananas, lenses, envelopes and barbed wire
- Meijer, Fokkinga, et al.
- 1991
(Show Context)
Citation Context ...cted to a "safe" subset. 1 Introduction In previous work [14, 15, 6, 4, 5] we have shown how programming algebraically with generic recursion schemes provides a theory amenable to program ca=-=lculation [13]-=-. This theory provides a basis for automatic optimization techniques which capture many well-known transformations. Unfortunately, these recursion schemes may induct over only one structure at a time,... |

195 | A short cut to deforestation
- Gill, Launchbury, et al.
- 1993
(Show Context)
Citation Context ...r in the improvement phase. The application domain of our fusion algorithm is more restricted than the domain of all these methods, but our algorithm is more effective since it is fully automated. In =-=[8]-=- a new, simple, but very effective, automatic technique is presented for implementing deforestation in a compiler. This method requires that each list-producing functions is expressed as a build call ... |

112 | A fold for all seasons
- Sheard, Fegaras
- 1993
(Show Context)
Citation Context ...rams and shows that these programs satisfy generic theorems. These theorems are the basis for an automatic improvement algorithm. This algorithm is an improvement over the algorithm presented earlier =-=[14] because, -=-in addition to inducting over multiple structures, it can be incorporated into any algebraic language and is no longer restricted to a "safe" subset. 1 Introduction In previous work [14, 15,... |

105 |
Data structures and program transformation
- Malcolm
- 1990
(Show Context)
Citation Context ...is can be achieved effectively by applying promotion theorems. Our stereotyped recursion schemes as well as the promotion theorems are highly influenced by the Squiggol school of program construction =-=[12, 13, 11, 1]-=-. Their goal is to construct a calculus of programs based on some well-behaved recursion schemes, in which their inductive laws, proved once and for all in their generic form, can be instantiated and ... |

67 | A Categorical Programming Language
- Hagino
- 1987
(Show Context)
Citation Context ... lack the structure necessary for automatic optimization. Much recent research has focused on the design of programming systems whose control structures are exclusively some generic recursion schemes =-=[3, 9, 10]-=-. We call this programming style algebraic programming because of its reliance on algebras and combinators for encoding control. Notable absent from these works are generic recursion schemes for induc... |

60 |
Safe fusion of functional expressions
- Chin
- 1992
(Show Context)
Citation Context ... with generic recursion schemes over multiple structures. For simple inductions our work is closely related to Wadler's work on listlessness and deforestation [17, 7, 16] and to Chin's work on fusion =-=[2]-=-. Deforestation works on all first order treeless terms. A treeless term is one which is exactly analogous to a safe term, but is described in a much different manner due to the lack of structure impo... |

54 | A system which automatically improves programs - Darlington, Burstall - 1976 |

35 |
Homomorphisms and promotability
- Malcolm
- 1989
(Show Context)
Citation Context ... fc) (Cons(a; l)) = fc(a; red list (fn ; fc) l) For example, length(x) = red list (():Zero; (a; r):Succ(r)) x For each such inductive data type there is a generic theorem called the promotion theorem =-=[12, 13]-=-. For lists this theorem takes the following form: OE n() = g(fn()) OE c (a; g(r)) = g(fc(a; r)) g(red list (fn ; fc) x) = red list (OE n ; OE c ) x This states that the application of any unary funct... |

35 |
Listlessness is better than laziness: Lazy evaluation and garbage collection at compile-time
- Wadler
- 1984
(Show Context)
Citation Context ...Work To our knowledge no other work deals with generic recursion schemes over multiple structures. For simple inductions our work is closely related to Wadler's work on listlessness and deforestation =-=[17, 7, 16]-=- and to Chin's work on fusion [2]. Deforestation works on all first order treeless terms. A treeless term is one which is exactly analogous to a safe term, but is described in a much different manner ... |

21 | When will deforestation stop
- Ferguson, Wadler
- 1988
(Show Context)
Citation Context ...Work To our knowledge no other work deals with generic recursion schemes over multiple structures. For simple inductions our work is closely related to Wadler's work on listlessness and deforestation =-=[17, 7, 16]-=- and to Chin's work on fusion [2]. Deforestation works on all first order treeless terms. A treeless term is one which is exactly analogous to a safe term, but is described in a much different manner ... |

13 | Uniform traversal combinators: Definition, use and properties
- Fegaras, Sheard, et al.
- 1992
(Show Context)
Citation Context ...ier [14] because, in addition to inducting over multiple structures, it can be incorporated into any algebraic language and is no longer restricted to a "safe" subset. 1 Introduction In prev=-=ious work [14, 15, 6, 4, 5]-=- we have shown how programming algebraically with generic recursion schemes provides a theory amenable to program calculation [13]. This theory provides a basis for automatic optimization techniques w... |

12 | EOEcient Optimization of Iterative Queries
- Fegaras
- 1993
(Show Context)
Citation Context ...ier [14] because, in addition to inducting over multiple structures, it can be incorporated into any algebraic language and is no longer restricted to a "safe" subset. 1 Introduction In prev=-=ious work [14, 15, 6, 4, 5]-=- we have shown how programming algebraically with generic recursion schemes provides a theory amenable to program calculation [13]. This theory provides a basis for automatic optimization techniques w... |

11 | O.: Solving Optimisation Problems with Catamorphisms
- Bird, Moor
(Show Context)
Citation Context ...is can be achieved effectively by applying promotion theorems. Our stereotyped recursion schemes as well as the promotion theorems are highly influenced by the Squiggol school of program construction =-=[12, 13, 11, 1]-=-. Their goal is to construct a calculus of programs based on some well-behaved recursion schemes, in which their inductive laws, proved once and for all in their generic form, can be instantiated and ... |

8 |
Algebraic Design Language (preliminary definition
- Kieburtz, Lewis
- 1994
(Show Context)
Citation Context ... lack the structure necessary for automatic optimization. Much recent research has focused on the design of programming systems whose control structures are exclusively some generic recursion schemes =-=[3, 9, 10]-=-. We call this programming style algebraic programming because of its reliance on algebras and combinators for encoding control. Notable absent from these works are generic recursion schemes for induc... |

4 |
A Transformational Approach to Database System Implementation
- Fegaras
- 1993
(Show Context)
Citation Context ...ier [14] because, in addition to inducting over multiple structures, it can be incorporated into any algebraic language and is no longer restricted to a "safe" subset. 1 Introduction In prev=-=ious work [14, 15, 6, 4, 5]-=- we have shown how programming algebraically with generic recursion schemes provides a theory amenable to program calculation [13]. This theory provides a basis for automatic optimization techniques w... |

2 | A Fold for All Seasons. Sixth Conference on Functional Programming Languages and Computer Architecture - Sheard, Fegaras - 1993 |

1 |
Optimizing Algebraic Programs. Oregon Graduate Institute, Technical report #94-004 A version of this paper is ftp-able from cse.ogi.edu:/pub/pacsoft/papers/OptAlgProg.ps
- Sheard, Fegaras
(Show Context)
Citation Context ...ailed proof here. Instead we will present a sketch of the proof. The detailed correctness proof for the normalization algorithm which includes only the simple promotion theorem can be found elsewhere =-=[15]-=-. Theorem 3 (Correctness of Normalization) The normalization algorithm always preserves the meaning of a term. Proof sketch: All the transformation rules of the normalization algorithm can be easily p... |