| S. Marlow.Deforestation for Higher-Order Functional Programs PhD Thesis, Department of Computer Science, University of Glasgow, 1995. |
....are intermediate structures which do not form part of the result. It is by now well known that many intermediate lists can be removed automatically by using program transformations and a considerable amount of research has gone into developing more powerful and easily applicable techniques, e.g. [Wad90, Mar96, TM95, CDPR99, Ham01, Chi99]. Perhaps the most successful method for removing intermediate data structures is shortcut fusion [GLJ93] It relies on writing list processing functions using two special functions foldr and build. Whenever a list is produced by build and consumed by foldr, that list can be removed. The ....
Simon Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, University of Glasgow, 1996.
....consumed by or and becomes garbage, which can be reclaimed automatically. Hence the function any runs in constant space. Furthermore, when or comes across the value True, the production of the list is aborted. Thus the termination condition is separated from the loop body . any ( 2) [1,2,3,4,5,6,7,8,9] or (map ( 2) 1,2,3,4,5,6,7,8,9] or (False : map ( 2) 2,3,4,5,6,7,8,9] or (map ( 2) 2,3,4,5,6,7,8,9] or (False : map ( 2) 3,4,5,6,7,8,9] or (map ( 2) 3,4,5,6,7,8,9] or (True : map ( 2) 4,5,6,7,8,9] True We can see from the discussion why the use ....
....which can be reclaimed automatically. Hence the function any runs in constant space. Furthermore, when or comes across the value True, the production of the list is aborted. Thus the termination condition is separated from the loop body . any ( 2) 1,2,3,4,5,6,7,8,9] or (map ( 2) [1,2,3,4,5,6,7,8,9]) or (False : map ( 2) 2,3,4,5,6,7,8,9] or (map ( 2) 2,3,4,5,6,7,8,9] or (False : map ( 2) 3,4,5,6,7,8,9] or (map ( 2) 3,4,5,6,7,8,9] or (True : map ( 2) 4,5,6,7,8,9] True We can see from the discussion why the use of intermediate data structures as ....
[Article contains additional citation context not shown here]
Simon Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, Glasgow University, 1995.
....suggests similar one to static argument transformation for SML NJ compiler to expose inlining recursive functions[1] O. Danvy suggests lambda dropping to restore the original block structure of lambda lifted program[4] Static argument transformation is used to preserve laziness in deforestation[15] and to make the application of strictness analysis more frequently[18] 6 Conclusion and Further Work We suggest a practical implementation of root optimization using new tags and specialized runtime routines to overlap the unwind operation and root operation. We apply the worker and wrapper ....
Simon David Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, Univ. of Glasgow, September 1995.
....has also been established. A fully automatic version of the pure treeless transformer has been implemented by Wadler, although a blazed counterpart is not currently available. There have been attempts to extend Wadler s deforestation techniques to programs in higher order languages ( Chi90] [Mar95]) but this seems to be quite difficult and many problems remain to be solved. 2.3 A Practical Approach to Fusion Wadler s algorithm for virtual data structure elimination based on fold unfold transformations restricts attention to a syntactically distinguished class of first order programs ....
S. Marlow. Deforestation for Higher-order Functional Programs. Dissertation, University of Glasgow, 1995.
....pure treeless transformer has also been established. A fully automatic implementation of the pure treeless transformer is available ( REF] although a blazed counterpart is not. There have been attempts to extend Wadler s deforestation techniques to programs in higher order languages ( Chi90] [Mar95]) but this seems to be quite difficult, and many problems remain to be solved. 2.3 A Practical Approach to Fusion Wadler s algorithm for virtual data structure elimination based on fold unfold transformations restricts attention to a syntactically distinguished class of first order programs ....
S. Marlow. Deforestation for Higher-order Functional Programs. Dissertation, University of Glasgow, 1995.
....from the fact that, in addition to the case reduction context, the language now has an application reduction context (IR e) plus an additional set of weak head normal forms the partially applied functions. More recent higher order generalisations are due to Hamilton [12] and also to Marlow [20]; notably both Hamilton and Marlow give a grammar of terms (a treeless form ) which is used to characterise a set of expressions for which their respective algorithms always terminates. Following [28] this style of stepwise transformation has been adopted by Nielsen and Srensen [21] in a study ....
S. D. Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, Dept. of Computing Science, University of Glasgow, 1995.
.... [MS99] But what if x is bound to a non value or C is not an reduction context To inline a non value in a non reduction context: let fx = Mg in C[x] let fx = Mg in C[M ] can sometimes be very worthwhile [PJS98] In more advanced transformations such as higher order deforestation [Wad90, Mar95] it is crucial. However, as is well known, the transformation risks duplicating computation, and this can lead to an asymptotically worse program in both space and time. The time issue is discussed in [PJS98] where they illustrate that the naive solution of ensuring that there is only one ....
Simon Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, University of Glasgow, 1995.
....of map will not be part of the producer. Deforestation requires inlining. The example also demonstrates that it is important not just to inline the right hand side of the definition but the whole recursive definition. Experiences with the implementation of other deforestation algorithms [Mar95, NP98] have shown that leaving inlining to a separate transformation pass gives unsatisfactory results. We can in fact use the type environment of a principal typing of the producer to determine the variables whose definitions need to be inlined. Determining which definitions can be inlined ....
....even more ambitious method of deriving a recursion skeleton from a definition and using its parametricity theorem for fusion. The sketched algorithms are still far from an implementation. Generally, implementations of deforestation have problems with controlling inlining to avoid code explosion [Mar95, NP98] Unlike the foldr build rule, most fusion laws that are based on regular producers or consumers still require some transformation of arbitrary expressions. All methods for automatically transforming programs into some regular form are purely syntax directed and raise the question of ....
[Article contains additional citation context not shown here]
Simon Marlow. Deforestation for Higher-Order Functional Programs. PhD thesis, Glasgow University, 1995.
....by sum. Successful deforestation removes this intermediate list, giving a single pass algorithm that traverses the list xs, doubling each element before adding it to the total. Full blown Wadler style deforestation for higher order programs is difficult; the only example we know of is described by Marlow [1996] and even that does not work for large programs. Instead, we developed a new, more practical, technique called short cut deforestation (Gill, Launchbury Peyton Jones [1993] As the name implies, our method does not remove all intermediate lists, but in exchange it is relatively easy to ....
S Marlow [1996], "Deforestation for Higher Order Functional Programs," PhD thesis, Department of Computing Science, University of Glasgow, March 1996.
....by sum. Successful deforestation removes this intermediate list, giving a single pass algorithm that traverses the list xs, doubling each element before adding it to the total. Full blown Wadler style deforestation for higher order programs is difficult; the only example we know of is described by Marlow [1996] and even that does not work for large programs. Instead, we developed a new, more practical, technique called short cut deforestation (Gill, Launchbury Peyton Jones [1993] As the name implies, our method does not remove all intermediate lists, but in exchange it is relatively easy to ....
S Marlow [March 1996], "Deforestation for Higher Order Functional Programs," PhD thesis, Department of Computing Science, University of Glasgow.
No context found.
S. Marlow.Deforestation for Higher-Order Functional Programs PhD Thesis, Department of Computer Science, University of Glasgow, 1995.
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