| W.N. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992. |
.... for later aggregate computation, we extend the algorithm by associating with each bucket with the number of records it has and the summation of the attributes manipulated by aggregate functions in the property description, its cost is the same as that in [FMMT96] linear) by using fusion technique [Chi92, OHIT97]. The remainder of this section will be explained on the ground that the relation has been bucketed into equal size blocks according to the range attribute. 4.2 Normalizing the Range Property For e#cient implementation, the range property specified by user should be first normalized into ....
....(4, 10) 5, 15) 6, 21) With the same trick, we can eliminate the other four. Consequently, the aggregate predicates can be expressed in the form of f (head) g (last) It should be noted that this preprocessing does not raise additional cost by using accumulation and fusion techniques [Bir84, Chi92]. Normalization of Composite Property Next, let us turn our attention to the composite property. With respect to it, we have the following Lemma holds. Lemma 2 (Normalization) Any composite predicate can be expressed in its canonical form, that is, the disjunction of a number of conjunction of ....
W.N. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992.
....application problems. APL compilers optimize aggregate array operations by performing computations in a piece wise and on demand fashion, avoiding unnecessary storage of large intermediate results in sequences of operations [29, 37, 77] The same basic idea underlies techniques such as fusion [3, 4, 15, 31, 74], deforestation [73] and transformation of series expressions [75] These optimizations do not aim to compute each piece of the aggregate operations incrementally using previous pieces and thus cannot produce as much speedup as our method can. Specialization techniques, such as data ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of the 1992.
....[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 exists a function ....
....i (id; rst) g i (E c i (id; second) i; g P x The explicit nature of control in algebraic programs make it possible to recognize and combine two traversals over a single data structure into a single traversal by inspection. 5. 3 Generating Distribution Laws for Zero Replacements Chin [2] relates how the use of laws may improve the deforestation process. We illustrated this in Section 2.3. The explicit structure of algebraic programs makes it possible to calculate some of the necessary laws on demand. In this section we describe how this may be done for a large class of programs. ....
[Article contains additional citation context not shown here]
W. Chin. Safe Fusion of Functional Expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
.... The method and algorithms for dead code elimination studied here have many applications: program slicing and specialization [64,50] strength reduction, nite di erencing, and incrementalization [7,46,39,37] caching intermediate results for program improvement [38] deforestation and fusion [59,6], as well as compile time garbage collection [28,24,47,61] The analysis results also provide a kind of type information. The overall goal of this work is to analyze dead data and eliminate computations of them across recursions and loops, possibly interleaved with wrappers such as classes in ....
W.-N. Chin. Safe fusion of functional expressions. In LFP 1992 [33], pages 11-20.
....a discussion of related work on rewriting strategies see [35] The relation to other systems for program transformation is discussed in [36] Techniques for program fusion can be classi ed into two broad categories: search based and calculation based. The earliest techniques for program fusion [6, 29, 37, 7] were search based. These rely on analyses of the fold unfold transformation process of Burstall and Darlington to fuse compositions of recursive functions. In search based fusion it is necessary to keep track at each step of the transformation process of all function calls that have been made. ....
.... Varsym cons( Subtraction ) 50 Varsym . Varsym VARSYM Varsymm Varsymm . Varsymm QVARSYM Qvarsym1 context free syntax CONID Modid CONID Tycon Tycon Qtycon QCONID Qtycon Qtycon Qtycls module Haskell Numbers exports lexical syntax [0 9] Digit [0 7] Octit [0 9A Fa f] Hexit Digit Decimal Octit Octal Hexit Hexadecimal Decimal INTEGER [0] Oo] Octal INTEGER [0] Xx] Hexadecimal INTEGER lexical restrictions INTEGER [0 9] lexical syntax Decimal . Decimal ( eE] Decimal) RATIONAL lexical restrictions ....
W. N. Chin. Safe fusion of functional expressions. ACM Lisp Pointers, 5(1):11-20, 1992. Proceedings of the 1992 ACM Conference on Lisp and Functional Programming.
....a discussion of related work on rewriting strategies see [34] The relation to other systems for program transformation is discussed in [35] Techniques for program fusion can be classi ed into two broad categories: search based and calculation based. The earliest techniques for program fusion [5,29,36,6] were search based. These rely on analyses of the fold unfold transformation process of Burstall and Darlington to fuse compositions of recursive functions. In search based fusion it is necessary to keep track at each step of the transformation process of all function calls that have been made. ....
W. N. Chin. Safe fusion of functional expressions. ACM Lisp Pointers, 5(1):11-20, 1992. Proceedings of the 1992 ACM Conference on Lisp and Functional Programming.
....a set of rewrite rules LR (inductive theorems of R) can be input to the synthesis process. These are the laws that usually facilitate the process in the fold unfold method. Diverses mechanisms to introduce automatically laws in the deforestation strategy has been explored by Chin and Bellegarde [10, 4]. The technique of rippling found in recent works [7] for automated theorem prover provide an interesting general mechanism to generate laws and synthesis rules. However, we have noticed [5] that most of the situations that requires laws in a deforestation can be simply handled by introducing ....
....: G ) v i ; 1 i n by changing the last application of G . Then we have u i r 0 by induction, and s r 0 by definition of . 2 4 Related works and Conclusion Fully automatized algorithms for deforestation based on a fold unfold method are those of Wadler [22] and more recently of Chin [10, 11]. Though this paper does not consider a particular tactical or the way we generate synthesis rules, let us observe the deforestation tactical. Its goal is to eliminate useless data structures. In the left hand side of the synthesis rule, there are functional symbols consumers of a data structure ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, Ca., pages 11--20, June 1992.
....supporting both mechanical implementation and flexible programming. ffl Explicit parallel programming in compositional style with fusion transformation. We can describe parallelism in an explicit way with our parallel primitives, and make use of the well known fusion transformation [Wad88, Chi92, OHIT97] for optimizations. Development of parallelism in parallel primitives and fusion transformation can be automated. ffl Implicit parallel programming in recursions with parallelization transformation. We are free from writing programs in terms of parallel primitives, and use a systematic ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992.
....2 Technical Report METR 95 11 There are two kinds of approaches dealing with such fusion. One, first proposed by Wadler as called deforestation, aims to fuse arbitrary functions by fold unfold transformations, keeping track of function calls and using clever control to avoid infinite unfolding[Chi92, Wad88]. The other, quite differently, makes use of some specific forms such as catamorphisms (or called folds) anamorphisms (or called unfolds) and hylomorphisms and finds how they interact[GLJ93, SF93, TM95] The second approach has been proved to be more practical in a real implementation in ....
W. Chin. Safe fusion of functional expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
....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 [21, 22, 24, 25] The essence of these techniques is to annotate all parts of the program that violate the treeless syntax, and then let the deforestation algorithm skip over annotated parts. A technique that annotates fewer parts of the program is due to Srensen [48] and ....
....Any such program typable in the HindleyMilner [27, 36] type system can be expanded out to a first order program, and transformed with first order deforestation. These programs include applications of the fold and map functions, but exclude useful constructions, e.g. lists of functions. Chin [7, 8, 10, 11] starts out with a higher order program and uses a higher order removal transformation [7, 9, 12] to eliminate some higherorder parts, resulting in a program in a restricted higherorder form. He then adopts a version of deforestation applicable to annotated programs in the restricted ....
W.-N. Chin. Safe fusion of functional expressions. In ACM Conference on Lisp and Functional Programming, pages 11--20. ACM Press, 1992.
....to a recursive form as argued in Section 4 based on the fact that a hylomorphism can be rewritten into a recursion. We would like to make it clear in our future research. Another seemly interesting topic is to investigate the relation between the Promotion Theorem and deforestation techniques [4, 10, 20, 25]. They both provide means for fusing a composition of functions. By imposing structure on functions with the aid of type functors, the Promotion Theorem seems simpler and more concise than deforestation techniques. However, in deforestation there have been many good results that we have not got ....
....of functions. By imposing structure on functions with the aid of type functors, the Promotion Theorem seems simpler and more concise than deforestation techniques. However, in deforestation there have been many good results that we have not got from the Promotion Theorem. For example, Chin [4] has proposed a terminative deforestation algorithm for first order and higher order functional languages. We believe that starting with the Promotion Theorem may give a more general and concise study on deforestation. Acknowledgements We gratefully acknowledge valuable discussions with Oege de ....
W. Chin. Safe fusion of functional expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
....whereby separate pieces of programs are fused into a single one, typically transforming a multi pass program into a single pass and thus leading to an efficient program without intermediate data structures. It has been gaining more and more interest even in functional programming community [Wad88, Chi92, GLJ93, TM95, HIT96c] 2 A Calculational Fusion System HYLO The purpose of this paper is to report our on going investigation on the design and implementation of an automatic system HYLO which implements fusion transformation in a more systematic and general way than any other transformation ....
....three component functions can be merged into a single one eliminating intermediate data structures. This is exactly what fusion aims to do. There are mainly two kinds of approaches to fusion transformation: search based fusion and calculational fusion. The traditional search based fusion [Wad88, Chi92] makes the composition of recursive functions into a simple function by fold unfold transformations [BD77] For our example, it unfolds recursive definitions of functions upto, map square and sum to some extent, manipulates the expression, and identifies suitable places where subexpressions are ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, San Francisco, California, June 1992. Discussions and Concluding Remarks 27
....be described as syntactically based offline call by name partial evaluation without information propagation of a subset of first order functional languages. People then refined this method by bettering the syntactic techniques to allow the transformation for all first order functional languages [4, 5]. Then came the generalisation to handle higher order languages [6, 7] but the termination methods were still only syntactical. This was bettered somewhat in [2] in that a constraint system is used to analyze wether deforestation will terminate. This was a improvement over the other offline ....
....this. But altough constant propagation would have positive synergistic effects, the perhaps most interesting aspect of call by name partial evaluation is its ability to remove intermediate datastructures. This ultimately comes down to another type of reduction examplified by: Example 3 case [1,2,3,4] of [ empty; A As] nonEmpty end transforms to nonEmpty The resulting program is the initial program completely deforested, there are no intermediate datastructures present in the resulting program. In general it makes sense to talk about complete partial execution as being when no ....
[Article contains additional citation context not shown here]
W.-N. Chin. Safe fusion of functional expressions. In ACM Conference on Lisp and Functional Programming, pages 11.29. ACM Press, 1992.
....analyze not only how much of each parameter of f is live, as described in Section 4, but also how much of each subexpression in the definition of f is live, in a similar way. Then dead code elimination can simply replace all subexpressions that are completely dead with . Deforestation and fusion [52, 8] combine function applications to avoid building large intermediate results. To guarantee that the optimization can be done effectively, the functions and subexpressions must satisfy certain conditions, e.g. be in blazed treeless form [52] Our analysis helps identify and eliminate functions and ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of the 1992 ACM Conference on LISP and Functional Programming, pages 11--20. ACM, New York, June 1992.
....on the right, n = 1000. APL compilers optimize aggregate array operations by performing computations in a piece wise and on demand fashion, avoiding unnecessary storage of large intermediate results in sequences of operations [24, 31, 61] The same basic idea underlies techniques such as fusion [2, 3, 11, 26, 58], deforestation [57] and transformation of series expressions [59] These optimizations do not aim to compute each piece of the aggregate operations incrementally using previous pieces and thus cannot produce as much speedup as our method can. Specialization techniques, such as data ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of the 1992 ACM Conference on LISP and Functional Programming, pages 11--20. ACM, New York, June 1992.
.... method and algorithms for dead code elimination studied here have many applications: program slicing and specialization [60, 45] strength reduction, finite differencing, and incrementalization [7, 41, 34, 32] caching intermediate results for program improvement [33] deforestation and fusion [55, 6], as well as compiletime garbage collection [24, 21, 42, 57] The analysis results also provide a kind of type information. The overall goal of this work is to analyze dead data and eliminate computations of them across recursions and loops, possibly interleaved with wrappers such as classes in ....
W.-N. Chin. Safe fusion of functional expressions. In LFP 1992 [29], pages 11--20.
....data as we do. The method and algorithms studied here have many applications: program slicing and specialization [51, 40] strength reduction, finite differencing, and incrementalization [7, 36, 31, 29] caching intermediate results for program improvement [30] deforestation and fusion [47, 6], as well as compile time garbage collection [22, 19, 37, 49] The analysis results also provide a kind of type information. The overall goal is to analyze dead data and eliminate computations of them across recursions and loops, possibly interleaved with wrappers like classes in object oriented ....
W.-N. Chin. Safe fusion of functional expressions. In LFP 1992 [27], pages 11--20.
....[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 ....
....lack of structure imposed on such terms. Wadler makes the observation that some intermediate data structures for primitive types, such as integers, characters, etc. do not really take up space, so he developed a method to handle such terms, using a technique he calls blazing. Chin s work on fusion [1] extends Wadler s work on deforestation. He generalizes Wadler s techniques to all first order programs, not just treeless ones, by recognizing and skipping over terms to which his techniques do not apply. His work also applies to higher order programs in general. This is accomplished by a higher ....
W. Chin. Safe Fusion of Functional Expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
....by Wadler [17] Several approaches for eliminating useless intermediate data structures have been proposed. First came the algorithm proposed by Wadler [17] which performs automatic deforestation on a restricted class of terms called treeless terms. Later, Chin s remarkable work on fusion [7] applies to a wider class of e treeless terms and to higher order programs in general. More recently, promotion theorems have been utilized to normalize programs [16] This technique is applicable to a class of potentially normalizable terms. Also an automatic way to implement deforestation inside ....
....candidate in S. Then, a program which implements the transition rules to transform the system S [ g d always terminates. The assumptions about g ensure that best deforestation candidates in the R h rules have depths no higher than 2. Proofs of similar results can be found in [17] or in [7]. Suppose we treat only deforestation eureka which obeys the assumptions of the above lemma, then more deforestation terms obeying the assumptions can be available, and so on. This bottom up process must terminate. Therefore if R contains no mutually recursive function, termination is guaranteed ....
[Article contains additional citation context not shown here]
W. N. Chin. Safe Fusion of Functional Expressions. Proc. of the Conference on Lisp and Functional Programming, San Francisco, 1992.
....provides a rule for fusing this function with any function. This method generalizes other approaches that use fixed parametricity theorems to fuse programs. 1 Introduction There is much work recently on using higher order operators, such as fold [11] and build [8, 5] to automate program fusion [2] and deforestation [13] Even though these methods do a good job on fusing programs, they are only effective if programs are expressed in terms of these operators. This limits their applicability to conventional functional languages. To ameliorate this problem, some researchers proposed methods to ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
.... n (i : int: x) sub = fi : x : vector(fi) n : int: x[fi] s : int: v : int fi: v n) update = fi : x : vector(fi) n : int: y : fi: x[vector(fi) s : int: v : int fi: ff: c : int (int fi) ff: c s (i : int: if[fi] eq n i) y (v i) The F 2 reduction rules can be used for program fusion [5] and deforestation (the elimination of intermediate data structures) 23] That is, when one program produces an intermediate data structure as output and another program consumes this data structure as input, we can fuse these two program in such a way that the intermediate data structure is no ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
....(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 first order programs, not just ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
....For example, in functional programs if we consider the call by value semantics, the innermost function calls should be evaluated before the outermost ones. Many techniques for controlling unfolding and driving have been proposed in the various models of symbolic computations (see for instance, [11, 43, 55] and the preceding compiling control example) In particular, several authors have studied the problem of when to stop unfolding, and for instance, one may decide to do so when unfolding is no longer deterministic [21] or when the expression in the node at hand can be embedded in the expression ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of ACM SIGPLAN Symposium on Lisp and Functional Programming, San Francisco, Calif., U.S.A., pages 11--20. ACM Press, 1992.
....transformation can change a polynomial time program into an exponential time program. In Wadler s deforestation (1990) this is avoided by considering only linear terms. Some weaker restrictions are adopted in partial evaluation (Sestoft, 1988; Bondorf, 1990) and other work on deforestation (Chin, 1992; Hamilton, 1993) We consider this an issue in its own right which should be dealt with separately, and is beyond the scope of this paper. The problem does not turn up in the examples we consider. Second, there is the problem of code duplication. Unrestrained unfolding may increase the size of a ....
....an important aspect of deforestation is that there is a syntactic class of function definitions, treeless definitions (Wadler, 1990) such that deforestation of any composition of functions with treeless definitions is guaranteed to terminate. This fact also forms the core of the techniques of Chin (1992) and Hamilton (1993) different techniques are due to S rensen (1994b) and Seidl (1996) The problem is more complex for positive supercompilation the extra power does not come for free. The following term is treeless (though not linear) so deforestation terminates, and yet positive ....
Chin, W.-N. 1992. Safe fusion of functional expressions. In ACM Conference on Lisp and Functional Programming, pages 11--20, ACM Press.
.... unnecessary traversals of intermediate data structures (see Section 2) Although this paper is mainly concerned with elimination of the inefficiency in the latter case, these two kinds of inefficiency are much related, for which there are two known tactics, namely Fusion (or called deforestation) [Wad88, Chi92] and Tupling [Chi93] Fusion is to merge nested compositions of recursive functions in order to obtain new recursions without unnecessary intermediate data structures, while tupling is to remove redundant recursive calls and multiple traversals of the same data structure from recursions. ....
....to obtain new recursions without unnecessary intermediate data structures, while tupling is to remove redundant recursive calls and multiple traversals of the same data structure from recursions. Different approaches are employed to formulate fusion and tupling. One, extensively studied by Chin [Chi92, Chi93], is based on the so called fold unfold transformation[BD77] It, however, suffers from the high cost of keeping track of function calls and has to use clever control to avoid infinite unfolding, which prevents fusion and tupling being embedded in a real practical compiler of functional languages. ....
[Article contains additional citation context not shown here]
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, San Francisco, California, June 1992.
....Moreover, we also guarantee that the process does not call for an infinite number of syntheses. Related approaches to automating elimination of useless intermediate data structures are the deforestation algorithm proposed by Wadler [6] and the extended deforestation algorithm proposed by Chin [3]. Also an automatic way to implement deforestation inside the Haskell s compiler has been shown in [5] By using completion 1 as a tool for synthesis, our transformation system is not restricted to the deforestation strategy and is able to automate transformations for a larger class of programs ....
W. N. Chin. Safe Fusion of Functional Expressions. Proc. of the Conference on Lisp and Functional Programming, San Francisco, 1992.
....provides a rule for fusing this function with any function. This method generalizes other approaches that use fixed parametricity theorems to fuse programs. 1 Introduction There is much work recently on using higher order operators, such as fold [9] and build [6, 5] to automate program fusion [2] and deforestation [11] Even though these methods do a good job on fusing programs, they are only effective if programs are expressed in terms of these operators. This limits their applicability to conventional functional languages. To ameliorate this problem, some researchers proposed methods to ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
.... n (i : int: x) sub = fi : x : vector(fi) n : int: x[fi] s : int: v : int fi: v n) update = fi : x : vector(fi) n : int: y : fi: x[vector(fi) s : int: v : int fi: ff: c : int (int fi) ff: c s (i : int: if[fi] eq n i) y (v i) The F 2 reduction rules can be used for program fusion [6] and deforestation (the elimination of intermediate data structures) 23] That is, when one program produces an intermediate data structure as output and another program consumes this data structure as input, we can fuse these two program in such a way that the intermediate data structure is no ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
....should receive marks to ensure safety. Wadler blazes programs on the basis of types. For instance, a subterm of integer type does not produce as a result a data structure, so nothing is lost by marking the subterm. The type based blazing is not generally safe (and was not mean to be) Chin [7,8,10,11] safely blazes all first order programs by, roughly, marking all subterms violating the linear, treeless syntax: i) for every definition, all arguments that are not variables; ii) for every definition, all selectors that are not variables; iii) for every definition and the main term, all ....
....Any such program typable in the Hindley Milner [29,38] type system can be expanded out to a first order program, and transformed with first order deforestation. These programs include applications of the fold and map functions, but exclude useful constructions, e.g. lists of functions. Chin [7,8,10,11] starts out with a higher order program and uses higher order removal [7,9,12] to eliminate some higher order parts, resulting in a program in a restricted higher order form. He then adopts a version of deforestation applicable to blazed programs in the restricted higher order form, and marks ....
W.-N. Chin. Safe fusion of functional expressions. In ACM Conference on Lisp and Functional Programming, pages 11--20. ACM Press, 1992.
....from recursively defined functions by means of tupling and how to calculate a new homomorphism from the old by means of fusion. Second, our main theorems for tupling and fusion are given in a calculational style [MFP91, TM95, HIT96] rather than being based on the fold unfold transformation [Chi92, Chi93]. Therefore, infinite unfoldings, once inherited in the fold unfold transformation, can be definitely avoided by the theorems themselves. Furthermore, although we restrict ourselves to list homomorphisms, our theorems could be extended naturally for homomorphisms of arbitrary data structures ....
....homomorphisms, namely the construction of almost homomorphisms from recursive definitions (Theorem 1) and the fusion of a function with almost homomorphisms (Theorem 3) It is different from Cole s informal way[Col93] Tupling and fusion are two well known techniques for improving programs. Chin [Chi92, Chi93] gave an intensive study on it. His method tries to fuse and or tuple arbitrary functions by fold unfold transformations while keeping track of function calls and using clever control to avoid infinite unfolding. In contrast to his costly and complicated algorithm to keep out of non termination, ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, San Francisco, California, June 1992.
....a discussion of related work on rewriting strategies see [25] The relation to other systems for program transformation is discussed in [26] Techniques for program fusion can be classi ed into two broad categories: search based and calculation based. The earliest techniques for program fusion [2, 22, 27, 3] were search based, relying on analyses of the fold unfold transformation process of Burstall and Darlington to fuse compositions of recursive functions. In search based fusion it is necessary to keep track at each step of the transformation process of all function calls that have been made. New ....
W. Chin. Safe fusion of functional expressions. In Lisp and Functional Programming, San-Francisco, California, June 1992.
....Booleans is never produced. To appear in the ACM SIGPLAN International Conference on Functional Programming, Philadephia, May 24 26, 1996. all p = xs: case xs of Nil True; Cons (a; as) p a (all p as) There are two kinds of approaches dealing with such fusion. One, first proposed by Wadler [Wad88, Chi92] as called deforestation, aims to fuse arbitrary functions by foldunfold transformations, keeping track of function calls and using clever control to avoid infinite unfolding. The other [GLJ93, SF93, TM95] quite differently, makes use of some specific forms such as catamorphisms (or called ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, San Francisco, California, June 1992.
....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 there exists a ....
....(id; first) g i ffi (E c i (id; second) i; g P x The explicit nature of control in algebraic programs make it possible to recognize and combine two traversals over a single data structure into a single traversal by inspection. 5. 3 Generating Distribution Laws for Zero Replacements Chin [2] relates how the use of laws may improve the deforestation process. We illustrated this in Section 2.3. The explicit structure of algebraic programs makes it possible to calculate some of the necessary laws on demand. In this section we describe how this may be done for a large class of programs. ....
[Article contains additional citation context not shown here]
W. Chin. Safe Fusion of Functional Expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
....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 there exists a ....
....(id; first) g i ffi (E c i (id; second) i; g P x The explicit nature of control in algebraic programs make it possible to recognize and combine two traversals over a single data structure into a single traversal by inspection. 5. 3 Generating Distribution Laws for Zero Replacements Chin [2] relates how the use of laws may improve the deforestation process. We illustrated this in Section 2.3. The explicit structure of algebraic programs makes it possible to calculate some of the necessary laws on demand. In this section we describe how this may be done for a large class of programs. ....
[Article contains additional citation context not shown here]
W. Chin. Safe Fusion of Functional Expressions. In Proc. 1992 ACM Conference on Lisp and Functional Programming, San Francisco, Ca., June 1992.
....the abstract syntax of the object language. These problems can be addressed by two parametric transformation strategies: fusion or deforestation, in which identical control structures of sequentially applied functions are merged, often allowing an intermediate data structure to be eliminated [25, 8], and the tupling, or parallel fusion strategy [6, 9] in which a pair of functions that operate on the same data are transformed into a single function that returns a result pair. Symbolically, this transformation is (f x; g x) hf; gi x When applied to traditional functional programs, ....
W.-N. Chin. Safe fusion of functional expressions. In Proc. of 1992 ACM Conf. on Lisp and Functional Programming, pages 11--20, June 1992.
....For a discussion of related work on rewriting strategies see [25] The relation to other systems for program transformation is discussed in [26] Techniques for program fusion can be classi ed into two broad categories: search based and calculation based. The earliest techniques for program fusion [2, 22, 27, 3] were search based, relying on analyses of the fold unfold transformation process of Burstall and Darlington to fuse compositions of recursive functions. In search based fusion it is necessary to keep track at each step of the transformation process of all function calls that have been made. New ....
W. Chin. Safe fusion of functional expressions. In Lisp and Functional Programming, San-Francisco, California, June 1992.
....representations can be used in the same system. Her system assigns local constraints on list structures, in the form of selector fields attached to the list type, that are propagated using a Hindley Milner type system. Our work on compact data representation is complementary to program fusion [2] and deforestation (the elimination of intermediate data structures) 14] Catamorphisms have already been used as a good intermediate representation of programs that supports fusion and deforestation [13, 3, 7, 1] Even though these methods do a good job on eliminating the unnecessary ....
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, California, pp 11--20, June 1992.
....component functions can be merged into a single one eliminating intermediate data structures. This is exactly what fusion aims to do. There are mainly two kinds of approaches to fusion transformation: searchbased fusion and calculational fusion. The traditional search based fusion (Wadler 1988, Chin 1992) turns the composition of recursive functions into a simple function by fold unfold transformations (Burstall Darlington 1977) For our example, it unfolds recursive definitions of functions upto, map square and sum to some extent, manipulates the expression, and identifies suitable places ....
Chin, W. (1992), Safe fusion of functional expressions, in `Proc. Conference on Lisp and Functional Programming', San Francisco, California.
....these components: upto (1 ; n) passes the list [1; 2; 1 1 1 ; n] to map square, which passes the list [1; 4; 1 1 1 ; n 2 ] to sum. Unfortunately, all these intermediate lists need to be produced, traversed, and discarded, degrading execution time dreadfully. Program fusion (or deforestation) [11, 1] is a well known transformation whereby compositions of several pieces of code are fused into a single one, resulting in an efficient functional program without intermediate data structures. Recent work [4, 9, 7, 10] has made it clear that fusion transformation is especially successful if ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, San Francisco, California, June 1992.
.... The method and algorithms for dead code elimination studied here have many applications: program slicing and specialization [59, 44] strength reduction, finite differencing, and incrementalization [7, 39, 34, 32] caching intermediate results for program improvement [33] deforestation and fusion [54, 6], as well as compiletime garbage collection [24, 21, 40, 56] The analysis results also provide a kind of type information. The overall goal of this work is to analyze dead data and eliminate computations of them across recursions and loops, possibly interleaved with wrappers such as classes in ....
W.-N. Chin. Safe fusion of functional expressions. In LFP 1992 [29], pages 11--20.
....application problems. APL compilers optimize aggregate array operations by performing computations in a piece wise and on demand fashion, avoiding unnecessary storage of large intermediate results in sequences of operations [26, 36, 49, 70] The same basic idea underlies techniques such as fusion [3, 5, 13, 29, 66], deforestation [65] and transformation of series expressions [67, 68] These optimizations do not aim to compute each piece of the aggregate operations incrementally using previous pieces and thus cannot produce as much speedup as our method can. Specialization techniques, such as data ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of the 1992 ACM Conference on LFP, pages 11--20, June 1992.
....optimizations or reorganizations, such as deforestation, incrementalization, and code reuse. Deforestation and fusion. These optimizations combine function applications to avoid building large intermediate results, i.e. results of function calls to be passed as arguments to other function calls [40, 7]. To guarantee that the optimizations can be done effectively, the functions and subexpressions involved must satisfy certain conditions, e.g. be in blazed treeless forms [40] Our analysis can help identify dead functions and subexpressions not satisfying these conditions and prune them out, ....
W.-N. Chin. Safe fusion of functional expressions. In Proceedings of the 1992 ACM Conference on LFP, pages 11--20, June 1992.
....During transformation process, we need transformation techniques [Fea87] or strategies [PP96] that guide the application of the transformation rules and may allowus to derive programs with improved performance. We outline some transformation techniques used in this paper. ffl Fusion [Wad89, Chi92, OHIT97] Fusion is to merge nested compositions of functions in order to obtain new functions without unnecessary intermediate data structures. For instance, the composition of function # for computing the length of a list and (1 )3 for incrementing every element of a list can be fused into a ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992.
.... a related but little known problem, called maximum segment product, can be similarly derived by our approach (Sec 4) We then compare with a classical derivation via Horner s rule (Sec 5) before an advice on the use of accumulation technique (Sec 6) 2 Enhanced Fusion with Laws Fusion method [Chi92,TM95,CK01] is potentially a useful and prevalent transformation technique. Given a composition f(g(x) where g(x) yields an intermediate data structure for use by f, fusion would attempt to merge the composition into a specialised function p(x) with the same semantics as f(g(x) but without the need for an ....
Wei-Ngan Chin. Safe fusion of functional expressions. In 7th ACM LISP and Functional Programming Conference, pages 11-20, San Francisco, California, June 1992. ACM Press.
....vss least) subs os) 1 We assume that the readers are familiar with the Haskell language [Bir98] in this paper. In addition, we say that our Haskell programs are pseudo in the sense that they include some additional notations for sets. 4 by using the known calculation techniques of fusion [Chi92] generalization (accumulation) Bir84, HIT99] base case lter promotion [Chi90] and tabulation [Bir80, CH95] Our derivation strategy is rather standard for program optimization and can be summarized as follows. First, we eliminate as much unnecessary intermediate data structures as possible ....
....recursion function. Then, we reuse necessary intermediate data structures by generalization, and we lter out unnecessary recursive calls by base case lter promotion transformation. Finally, we reuse partial results to produce the whole result by tabulation transformation. 3. 1 Fusion Fusion [Chi92] is used to merge two passes (from nested recursive calls) into a single one, by eliminating intermediate the data structure passing between the two passes. Notice that our fs has two passes, and the intermediate data structure is huge containing all the sublists of os. We shall apply the fusion ....
W.N. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11-20, San Francisco, California, June 1992.
....calls are possible. Some examples are: 1. unfolding intermediate (e.g. nonrecursive) function calls [Chi94] and 2. replacing calls by their approximate constructor based equivalents as proposed in [Thi94] These techniques will not be investigated in this paper. 3 Treeless Consumers In [Chi92], it was suggested that each parameter of a function is a safe consumer if its corresponding argument is a tuple of zero or more variables in all its recursive calls. This property was also known as the nonaccumulating parameter criterion. If all the parameters of a given mutually recursive ....
....present (in various forms) in a number of past works. In their Elimination Procedure for logic programs, Proietti and Pettorossi [PP91] made use of nonascending clauses to ensure terminating transformations. Similarly, Chin required parameters to be nonaccumulating for safe fusion transformation [Chi92], while Holst [Hol91] analyzed for 3 This is discussed further in Section 5.2.3. 12 The Journal of Functional and Logic Programming 1996 4 Chin and Khoo Better Consumers for Program Specializations x5.1 nonincreasing static parameters to ensure a terminating partial evaluator. All of these ....
[Article contains additional citation context not shown here]
W.-N. Chin. Safe fusion of functional expressions. In Jon L. White, editor, Proceedings of the ACM Conference on LISP and Functional Programming, pages 11--20, New York, NY, June 1992. ACM Press.
....search space of our initial concise program can be reduced dramatically via program calculation. Specifically, we will derive an efficient program for finding frequent sets from the specification fs os vss least = fsp vss least) subs os) by using the known calculation techniques of fusion [Chi92] generalization (accumulation) Bir84, HIT99] base case filter promotion [Chi90] and tabulation [Bir80, CH95] 5 3.1 Fusion Fusion is used to merge two passes (from nested recursive calls) into a single one, by eliminating intermediate the data structure passing between the two passes. ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992.
....During transformation process, we need transformation techniques [Fea87] or strategies [PP96] that guide the application of the transformation rules and may allow us to derive programs with improved performance. We outline some transformation techniques used in this paper. ffl Fusion [Wad89, Chi92, OHIT97] Fusion is to merge nested compositions of functions in order to obtain new functions without unnecessary intermediate data structures. For instance, the composition of function # for computing the length of a list and (1 )3 for incrementing every element of a list can be fused into a ....
W. Chin. Safe fusion of functional expressions. In Proc. Conference on Lisp and Functional Programming, pages 11--20, San Francisco, California, June 1992.
No context found.
Chin, W.-N.: Safe Fusion of Functional Expressions. Proceedings of ACM SIGPLAN Symposium on Lisp and Functional Programming, San Francisco, Calif., U.S.A., ACM Press (1992) 11--20
No context found.
W. Chin. Safe Fusion of Functional Expressions. Proceedings of the ACM Symposium on Lisp and Functional Programming, San Francisco, Ca., pages 11--20, June 1992.
First 50 documents Next 50
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