Results 1 
3 of
3
Generic Program Transformation
 Proc. 3rd International Summer School on Advanced Functional Programming, LNCS 1608
, 1998
"... ion versus efficiency For concreteness, let us first examine a number of examples of the type of optimisation that we wish to capture, and the kind of programs on which they operate. This will give us a specific aim when developing the machinery for automating the process, and a yardstick for evalu ..."
Abstract

Cited by 32 (5 self)
 Add to MetaCart
(Show Context)
ion versus efficiency For concreteness, let us first examine a number of examples of the type of optimisation that we wish to capture, and the kind of programs on which they operate. This will give us a specific aim when developing the machinery for automating the process, and a yardstick for evaluating our results. 2.1 Minimum depth of a tree Consider the data type of leaf labelled binary trees: dataBtreea = Leaf a j Bin (Btree a)(Btree a) The minimum depth of such a tree is returned by the function mindepth :: Btree a ! Int : mindepth (Leaf a) = 0 mindepth (Bin s t) = min (mindepth s)(mindepth t) + 1 This program is clear, but rather inefficient. It traverses the whole tree, regardless of leaves that may occur at a small depth. A better program would keep track of the `minimum depth so far', and never explore subtrees beyond that current best solution. One possible implementation of that idea is mindepth t = md t 01 md (Leaf a)d m = mindm md (Bin s t)d m = if d 0 m then m...
Correctness of Monadic State: An Imperative CallbyNeed Calculus
 In Proc. 25th ACM Symposium on Principles of Programming Languages
, 1998
"... The extension of Haskell with a builtin state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the imp ..."
Abstract

Cited by 20 (2 self)
 Add to MetaCart
The extension of Haskell with a builtin state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the implementation level, constructs that act on the state are viewed as statements whose evaluation has the sideeffect of updating the implicit global store in place. There are several unproven conjectures that the two views are consistent. Recently, we have noted that the consistency of the two views is far from obvious: all it takes for the implementation to become unsound is one judiciouslyplaced betastep in the optimization phase of the compiler. This discovery motivates the current paper in which we formalize and show the correctness of the implementation of monadic state. For the proof, we first design a typed callbyneed language that models the intermediate language of the compiler, to...