Results 1 
2 of
2
Warm Fusion in Stratego: A Case Study in Generation of Program Transformation Systems
, 2000
"... Stratego is a domainspecic language for the specication of program transformation systems. The design of Stratego is based on the paradigm of rewriting strategies: userdenable programs in a little language of strategy operators determine where and in what order transformation rules are (automat ..."
Abstract

Cited by 23 (13 self)
 Add to MetaCart
(Show Context)
Stratego is a domainspecic language for the specication of program transformation systems. The design of Stratego is based on the paradigm of rewriting strategies: userdenable programs in a little language of strategy operators determine where and in what order transformation rules are (automatically) applied to a program. The separation of rules and strategies supports modularity of specications. Stratego also provides generic features for specication of program traversals. In this paper we present a case study of Stratego as applied to a nontrivial problem in program transformation. We demonstrate the use of Stratego in eliminating intermediate data structures from (also known as deforesting) functional programs via the warm fusion algorithm of Launchbury and Sheard. This algorithm has been specied in Stratego and embedded in a fully automatic transformation system for kernel Haskell. The entire system consists of about 2600 lines of specication code, which bre...
Short cut fusion: Proved and improved
 Pages 47–71 of: Semantics, Applications, and Implementation of Program Generation
, 2001
"... Abstract. Short cut fusion is a particular program transformation technique which uses a single, local transformation — called the foldrbuild rule — to remove certain intermediate lists from modularly constructed functional programs. Arguments that short cut fusion is correct typically appeal eithe ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
(Show Context)
Abstract. Short cut fusion is a particular program transformation technique which uses a single, local transformation — called the foldrbuild rule — to remove certain intermediate lists from modularly constructed functional programs. Arguments that short cut fusion is correct typically appeal either to intuition or to “free theorems ” — even though the latter have not been known to hold for the languages supporting higherorder polymorphic functions and fixed point recursion in which short cut fusion is usually applied. In this paper we use Pitts ’ recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short cut fusion are contextually equivalent to their unfused counterparts. The same techniques in fact yield a much more general result. For each algebraic data type we define a generalization augment of build which constructs substitution instances of its associated data structures. Together with the wellknown generalization cata of foldr to arbitrary algebraic data types, this allows us to formulate and prove correct for each a contextual equivalencepreserving cataaugment fusion rule. These rules optimize compositions of functions that uniformly consume algebraic data structures with functions that uniformly produce substitution instances of them. 1