| A.B. Ferguson and P. Wadler. When will deforestation stop? In Glasgow Workshop on Functional Programming, pages 39--56, 1988. |
....and consumption of intermediate results can cause ineciencies, in particular, if the intermediate results are structured objects like lists or trees. There are several techniques for transforming programs which use intermediate results into programs which do not. We compare deforestation [20, 5], which is a well known optimization technique for functional programs, with some composition techniques from the theory of tree transducers [7] The comparison is restricted to the twofold composition of rst order functions, which are de ned by an extended scheme of primitive recursion, in ....
.... pairs (p 1 ; e 1 ) and (p 2 ; e 2 ) are called equivalent, denoted by (p 1 ; e 1 ) p 2 ; e 2 ) if C p1 = C p2 and if for every substitution = v=t v j v 2 var(e 1 ) var (e 2 ) t v 2 TCp 1 ] nf ( p1 ; e 1 ) nf ( p2 ; e 2 ) 2 4 Deforestation The (classical) deforestation technique [20, 5] can be seen as algorithmic instance of the fold unfold technique in [1] The presentation of deforestation in Transformation 4.1 obeys the syntax of our language P and is similar to e.g. 18] Deforestation mimics call by name reduction steps (unfold steps) on expressions with variables, i.e. ....
A.B. Ferguson and P. Wadler. When will deforestation stop? In 1988 Glasgow Workshop on Functional Programming, pages 39-56, 1988.
....upon the algorithm of [17] extended in the following ways. First, it is based upon the hom promotion theorem rather than red, second it computes over a richer language, and terminates over the complete language rather than a syntactically identi able 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 algorithm. Given: h i E c i (id; g) g f i the requisite property suppose there ....
....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]. Deforestation works on all rst order treeless terms. Treelessness is a syntactic property which guarantees that terms can be unfolded without introducing in nite regress. Wadler makes the observation that some intermediate data structures for primitive types, such as integers, booleans, etc. do ....
A. Ferguson, and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming (also as research report 89/R4 of Glasgow University) , pp 39-56, Rothesay, Isle of Bute, August 1988.
....analysis [Thi94, CK96] have been developed for online specialisers as well. Deforestation Deforestation is an online, unfold fold based program transformation technique aimed at eliminating intermediate data structures ( trees ) from functional programs. As defined originally in [Wad88, Wad90, FW88] deforestation can be applied to first order functional programs containing only treeless functions, that is, functions guaranteed not to generate intermediate data structures when evaluated. Given a non treeless term and a treeless program, deforestation generates an operationally equivalent ....
....program. Termination of the original deforestation algorithm is ensured by a basic folding step for generating recursive functions in the transformed program. This folding step is sufficient for guaranteeing termination of the algorithm because of the restrictive nature of the treeless form [FW88] Recent research in deforestation has concentrated on extending its application to both arbitrary first order and higher order functional programs. Wadler developed two methods for extending the domain of deforestation: blazing and higher order macros [Wad90] Since then, a number of static ....
A.B. Ferguson and P. Wadler. When will deforestation stop? In Glasgow Workshop on Functional Programming, pages 39--56, 1988.
....which they are derived. That it not degrade the performance of acceptable input programs is, of course, critical to any practical virtual data structure elimination method. Finally, it has been shown that applications of Wadler s transformations to compositions of treeless forms always terminate ([FW88]) Observing that intermediate data structures of atomic types need not be removed from programs, Wadler ( Wad90] introduced a second treeless form for programs, called blazed treeless form. Blazed treeless form is defined in terms of an annotation scheme which marks each atomic type ....
A. Ferguson and P. Wadler. When Will Deforestation Stop? In Proceedings, Glasgow Workshop on Functional Programming, pp. 39 -- 56, 1988.
....is based solely on the fact that the fold step will always occur eventually. Treeless form is formulated in such a way that this will always happen, and Wadler provides an outline of a proof of termination in his paper. A more complete proof of termination is presented by Ferguson and Wadler [FW89] Chapter 1 : Optimisation by Transformation 11 Unfortunately treeless form is a very restrictive language, both in its form and expressiveness. It is first order only, whereas most modern functional programming languages are higher order. The two other restrictions, that arguments to a function ....
A. B. Ferguson and P. Wadler. When will deforestation stop. In Functional Programming, Glasgow, Workshops in Computing. Springer-Verlag, August 1989. 169 170 Chapter 1 : Conclusion
....which they are derived. That it not degrade the performance of acceptable input programs is, of course, critical to any practical virtual data structure elimination method. Finally, it has been shown that applications of Wadler s transformations to compositions of treeless forms always terminate ([FW88]) Correctness of the treeless transformer, on the other hand, has never been formally established. Observing that intermediate data structures of atomic types need not be removed from programs, Wadler ( Wad90] also introduced a second treeless form for programs, called blazed treeless form. ....
A. Ferguson and P. Wadler. When Will Deforestation Stop? In Proceedings, Glasgow Workshop on Functional Programming, pp. 39 -- 56, 1988.
....a program like the following. h 0 1 n where h a m n a if m n h (a m) m 1) n otherwise The inefficiency has been removed since no intermediate list is constructed. 2 Wadler invented a technique to transform functional programs of the former kind into the latter, deforestation [Wad88, Fer88], and proved that the deforestation algorithm terminated when applied to so called treeless programs. Later a fully automatic technique for applying deforestation to arbitrary first order terms was described by Chin [Chi90, Chi93] He invented an extended deforestation algorithm which essentially ....
....for deforestation to partial evaluation of logic programs. This paper takes the first steps in applying our technique to ensure termination of the elimination procedure and partial evaluation of logic programs. 2 The deforestation algorithm We study the same language as the one studied in [Fer88]. Definition 1 (Language. t : v j c t 1 : t n j f t 1 : t n j g t 0 : t n (variables, constructors, function calls) p : c v 1 : v n (patterns) d : f v 1 : v n t (f function definition) j g p 1 v 1 : v n t 1 . g function definition with patterns) g p m ....
A. B. Ferguson & Philip Wadler. When will Deforestation Stop?. In 1988 Glasgow Workshop on Functional Programming. August 1988.
....da = x; y; z: case x of [ a 0 y z (h : t) h : da t y z a 0 = y; z: case y of [ z (h : t) h : a 0 t z in u; v; w: da u v w 2 Ideally we should write the first version, and have it translated to the second automatically, e.g. by our compiler. This is indeed done by Wadler s [17, 54, 55] deforestation which eliminates intermediate data structures from first order functional programs. 1 Deforestation terminates on treeless programs. Subsequent techniques to ensure termination of deforestation on all firstorder programs are due to Chin [7, 8, 10, 11, 13] and later to Hamilton ....
A. Ferguson and P.L. Wadler. When will deforestation stop? In Glasgow Workshop on Functional Programming, pages 39--56, 1988.
....tree produced by T into a finite graph, by collapsing equivalent nodes. For deforestation, nodes 19 are considered equivalent if they are are equivalence up to variable renaming (so called identical folding in [9] See for example Ferguson and Wadler s account of folding in deforestation [7], and related descriptions of folding for process trees in [9] Wadler originally argued that the expression level transformation is obviously correct (since it essentially uses just unfolding, and simplifications which eliminate constructors) But the property that the local steps are ....
....folding. Since folding is so crucial to the deforestation algorithm, and is at the heart of the problem of proving correctness, we will present a modification of the transformation rules which makes folding explicit. 4. 1 Explicit Memoisation and Folding Some earlier explicit accounts of folding [7,19] have taken the declarative view mentioned above. 5 Firstly, the infinite expression tree produced by T [ is annotated with expressions; if e annotates some expression tree t, then t (ignoring annotations which might occur therein) was obtained by applying T [ to e. Folding is then ....
[Article contains additional citation context not shown here]
A. Ferguson and P. Wadler. When will deforestation stop. In Proceedings of the 1988 Glasgow Workshop on Functional Programming, Glasgow Coputer Science Department Research Report 89/R4, 1988.
....be simplified. A second is that the structure of arguments presented in recursive calls of functions to be fused must not increase in complexity, or the deforestation algorithm will continue to search deeper and deeper in an unending elaboration of recursive function calls. Ferguson and Wadler [FW89] gave a sufficient condition, called treeless functions , to avoid this undesired behavior. Another, powerful approach to transforming function compositions is supercompilation [Tur79, Tur86b, Tur86a] In this technique, the strategy is driving of the outermost application into the unfolded ....
A. B. Ferguson and P. Wadler. When will deforestation stop? In Proceedings of 1989 Glasgow Workshop on Functional Programming, pages 39--56, 1989.
....[4] without the intervention of explicit laws. In addition, eureka steps are not necessary here during folding to a function call as they are incorporated in the generalization part of the normalization algorithm. ffl Automation of the techniques of listlessness, deforestation and fusion [15, 1, 8, 14] for a class of fold programs. These techniques remove unnecessary intermediate data structures produced during nested calls. ffl Automation of a simple form of partial evaluation. If the parameter of a fold term is instantiated with other fold terms, for example a piece of data , i.e. a ....
....His techniques apply only to linear data structures such as lists, vectors, and streams, yet his techniques automatically detect and fuse multiple walks down the same data structure, unlike some of the more general techniques. It is also related to Wadler s work on listlessness, and deforestation [14, 15, 8]. Deforestation works on all first order treeless terms. A treeless term is one which is exactly analogous to a potentially normalizable term, but is described in a much different manner due to lack of structure imposed on such terms. Wadler makes the observation that some intermediate data ....
A. Ferguson, and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming (also as research report 89/R4 of Glasgow University), pp 39-56, Rothesay, Isle of Bute, August 1988.
....in inefficient programs. Early work on automatic elimination of intermediate data structures from functional programs includes Turchin s supercompiler [Tur80, Tur82] and Wadler s listless transformer [Wad84, Wad85] The latter eliminates intermediate lists, but later Wadler invented deforestation [Wad88, Fer88], which eliminates intermediate data structures in general, and proved that the deforestation algorithm terminates when applied to treeless programs. A method for applying deforestation to all first order programs was later described by Chin [Chi90, Chi94] Inspired by Wadler s blazed ....
....Section 8: an improvement of the basic method. Section 9: an explanation of the fact that our method extends the methods by Wadler and Chin; the improvement of Section 8 is necessary for this. Section 10: conclusion. 2 Language and notation We study the same language as the one studied in [Fer88]. Definition1 Object language. Let c; v; f; g range over constructor names, variable names, f function names, and g function names, respectively. Let t; p; d range over terms, patterns, and definitions, respectively. t : v j c t 1 : t n j f t 1 : t n j g t 0 : t n j let v = t in ....
[Article contains additional citation context not shown here]
A. B. Ferguson & Philip Wadler. When will Deforestation Stop?. In 1988 Glasgow Workshop on Functional Programming. August 1988.
....the type coercion case, a r around an application of a variable which is bound by a Delta is cancelled. The Inversion Principle also occurs in other areas of which we briefly review below. Program transformation. The Listless transformer [Wad84] Wad85] and the Deforestation algorithm [Wad88] [Fer88] transform functional programs which use intermediate data structures into semantically equivalent programs which do not use intermediate data structures. An intermediate structure is something which is constructed and subsequently destructed. For instance, an implementation of the factorial ....
A. B. Ferguson & Philip Wadler. When will Deforestation Stop?. In 1988 Glasgow Workshop on Functional Programming. August 1988.
....( Nil; b; s) Nil; a; r) Nil; a; b; r s) Cons( f a; g b) r s) x; y) 5 Related 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 [18, 8, 17] 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 imposed on such terms. Chin generalizes Wadler s techniques to all ....
A. Ferguson and P. Wadler. When will Deforestation Stop. In Proceedings of 1988 Glasgow Workshop on Functional Programming, Rothesay, Isle of Bute, pp 39--56, August 1988. Also as research report 89/R4 of Glasgow University.
....head and tail operators to the basic functions. The patterns used in case expressions may not be nested. Methods to transform case expressions with nested patterns into ones without nested patterns are described in [ 1 ] and [ 13 ] In the reformulations of the deforestation algorithm given in [ 4 ] , 2 ] 3 ] and [ 8 ] pattern matching function definitions are used rather than case expressions. Less transformation rules are required when this approach is taken, but these rules are slightly more difficult to understand. Also, the case expression is a primitive in many functional ....
A.B. Ferguson and P.L. Wadler. When will deforestation stop? In 1988 Glasgow Workshop on Functional Programming, pages 39--56, August 1988.
....constructors nil and cons xxs. a [ ys 4 = ys a (x : xs) ys 4 = x : a xs ys Fig. 2. Example program append. Our language contained case expressions in [76, 74] because the connection between positive supercompilation and deforestation is clearest for case expressions. However, g functions [21] lead to a simpler presentation of generalization. 2 Driving Driving takes a term and a program and constructs a possibly infinite process tree, representing all possible computations with the term, in a certain sense. Figure 3 shows part of the infinite process tree for the term a (a xs ys) xs ....
A. Ferguson and P.L. Wadler. When will deforestation stop? In 1988 Glasgow Workshop on Functional Programming, pages 39--56, 1988.
....obtained from P by replacing rules (5,8) of driving by (5d,8d) see Figure 10. The resulting set of rules is identical to the rules for deforestation as defined in (Wadler, 1990) except that D also deals with the equality construct and that D is formulated using evaluation contexts as in (Ferguson and Wadler, 1988). However, it should be noted that we are using D beyond the original, intended scope of deforestation, since we apply D to arbitrary terms rather than just A Positive Supercompiler 15 compositions of functions with treeless definitions. From now on, we shall identify deforestation with ....
Ferguson, A.B. and Wadler, P.L. 1988. When will deforestation stop?. In 1988 Glasgow Workshop on Functional Programming, pages 39--56.
....following. h 0 1 n where h a m n = a; if m n = h (a square m) m 1) n; otherwise The inefficiency has been removed by eliminating the intermediate lists. 2 A technique to transform programs of the former kind into the latter, deforestation, has been invented by Philip Wadler [Wad88] [Fer88]. In the example above the intermediate data structure is a list, and indeed Wadler s deforestation algorithm which handles general data structures is a successor of his earlier work on a method of eliminating intermediate lists [Wad84] Wad85] Both of these techniques were inspired by the ....
....the syntax of our language. The next reviews some notational conventions that we shall employ throughout the paper. The last section describes the operational semantics of our language by a simple rewrite interpreter. 2. 1 Syntax The syntax of our language is defined by the same grammar as in [Fer88]. Definition 1 (Language. We assume mutually disjoint infinite sets of variable names, constructor names, f function names and g function names, ranged over by the generic variables v, c, f and g, respectively. We use h to range over functions which are either f or g functions. The generic ....
[Article contains additional citation context not shown here]
A. B. Ferguson & Philip Wadler. When will Deforestation Stop?. In 1988 Glasgow Workshop on Functional Programming. August 1988.
....automatically, e.g. by our compiler. Some early techniques for this are due to Burstall and Darlington [6] Manna and Waldinger [35] Darlington [14] Kierburtz and Schultis [32] Feather [15] Turchin [62] Bird [3] Wadler [63 65] and Scherlis [48] This paper is about Wadler s deforestation [17,66,68], an algorithm eliminating intermediate data structures from first order functional programs in which (i) no definition contains an argument which is not a variable; ii) no definition contains a selector which is not a variable; iii) no definition nor the main term contains a non linear ....
A. Ferguson and P.L. Wadler. When will deforestation stop? In Glasgow Workshop on Functional Programming, pages 39--56, 1988.
....upon the algorithm of [17] extended in the following ways. First, it is based upon the hom promotion 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 normalization algorithm. Given: h i ffi E c i (id; g) g ffi f i the requisite property suppose ....
....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]. Deforestation works on all first order treeless terms. Treelessness is a syntactic property which guarantees that terms can be unfolded without introducing infinite regress. Wadler makes the observation that some intermediate data structures for primitive types, such as integers, booleans, etc. ....
A. Ferguson, and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming (also as research report 89/R4 of Glasgow University) , pp 39-56, Rothesay, Isle of Bute, August 1988.
No context found.
A.B. Ferguson and P. Wadler. When will deforestation stop? In Glasgow Workshop on Functional Programming, pages 39--56, 1988.
No context found.
A. Ferguson and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming, pp 39--56, Rothasay, Isle of Bute, August 1988.
No context found.
A. Ferguson and P. Wadler. When will Deforestation Stop. In Proc. of 1988 Glasgow Workshop on Functional Programming, pp 39--56, Rothasay, Isle of Bute, August 1988.
No context found.
A. B. Ferguson and P. Wadler. When will deforestation stop? In Functional Programming, Glasgow 1988. Workshops in Computing, pages 3956, 1988.
No context found.
A.B. Ferguson and P. Wadler. When will deforestation stop? In 1988 Glasgow Workshop on Functional Programming, pages 39--56, 1988.
First 50 documents
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC