| M. Wand. Continuation-based program transformation strategies. J.ACM, 27(1):164--180, 1980. |
....of a recursive function into tail recursive form, by introducing an accumulator. A tail recursive function may not necessarily be any more ecient but it may be converted easily into an ecient iterative loop. A continuation is a data structure which represents the future course of computation [Wan80] and the introduction of a continuation may be considered to be like the introduction of a higher order accumulator. With a continuation a function which calculates the return value is built up during the recursion and is evaluated on reaching the base case. This may not seem a particularly ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-180, January 1980.
....[15,21] They can be used for expressing the meaning of logical connectives. For instance, the meaning of the or connective can be expressed by the following program P1: F G F F G G Goal variables and goal arguments are also used for writing programs in a continuation passing style [18,20] like, for instance, the following program P2: p( Cont) Cont p( X jXs] Cont) p(Xs; q(X; Cont) q(0; Cont) Cont where the goal p(l; true) succeeds i the list l consists of 0 s only. Programs with goal variables and goal arguments, such as P1 and P2 above, are not allowed by the usual ....
....they improve program performance by anticipating tests and reducing the time complexity of program execution. The theory we have presented may be used to give sound semantic foundations to the development of logic programs which use higher order generalizations and continuations (see [12,18] and [13,20] for some examples of use of these techniques in the case of logic and functional programming, respectively) We leave for future work the development of suitable strategies for directing the use of the transformation rules we have proposed in this paper. Acknowledgements We would like to thank ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164180, 1980.
....continuation. Lambda abstraction enables a subexpression including an accumulating parameter to be taken out of an expression and it often helps program optimization, like deriving accumulative reverse from naive reverse which uses append, or tupling to avoid multiple traversals over inputs (e.g. [19, 25]; the latter also points out the relation of continuation or accumulation to attribute grammars) Lambda abstraction and composition strategy is presented in [18] However, it does not show how the composition of two nested expressions with lambda abstraction is treated. It seems they will not ....
M. Wand. Continuation-based program transformation strategies. J. ACM, 27(1): 164--180, 1980.
....of functional languages where lists and dynamically extensible structures are introduced. Among them we would like to recall: i) the techniques of Cohen [Coh83] by which arrays whose dimensions depend on the size of the input are introduced, ii) the continuation based transformations of Wand [Wan80], whereby one exploits the power of higher order arguments which store sequences of function calls, iii) the accumulation technique of Bird [Bir84] which works by introducing variables to collect a number of previously computed values. All these techniques follow a schemata approach, by which ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-180, 1980.
....of functional languages where lists and dynamically extensible structures are introduced. Among them we would like to recall: i) the techniques of Cohen [Coh83] by which arrays whose dimensions depend on the size of the input are introduced, ii) the continuation based transformations of Wand [Wan80], whereby one exploits the power of higher order arguments which store sequences of function calls, iii) the accumulation technique of Bird [Bir84] which works by introducing variables to collect a number of previously computed values. All these techniques follow a schemata approach, by which ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-180, 1980.
....so we can rewrite this to a call to revapp(xs ; nil ; ys) in the fourth line. The nal step follows directly from the de nition of rev2 . The accumulation program transformation used in this example is closely related to the continuation passing programming style. It is argued informally in [12] that accumulators are often just a data structure representing a continuation function, while [3] gives a survey of many ways of representing accumulators and presents continuations as one of them. From a purely algebraic view, both techniques exploit the associativity property and an existence ....
.... ; l2 ) revc (f ) l1 ; l2 ) l1 : nil f (nil) k (9x ; xs l1 : cons(x ; xs) revc ( y : 9r append(y ; cons(x ; nil) r) f (r) xs ; l2 ) This de nition of rev3 can also be proved equal to rev2 by techniques similar to those used in functional programming as described in [12]. 5 Example 2: sort The following example is inspired by [2] We start with the standard implementation of the naiveSort predicate that uses the generate and test method to sort a list: naiveSort(l1 ; l2 ) perm(l1 ; l2 ) isSorted(l2 ) isSorted(l) l : nil) k (9x l : cons(x ....
[Article contains additional citation context not shown here]
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1), 1980.
....inductively, although it certainly could be. Verification is subsumed by the pruning analysis. In fact, we haven t yet used the algebraic properties of addition. It requires associativity to obtain the iterative version of fibonnaci. This, too, is derivable, using techniques originating with Wand [17]. F(z; 1; 2) where F(z; u; v) Pi = if z 0 then u else F(z Gamma 1; v; u v) z; u; v : hinput ; 1; 2i; while z 0 do z; u; v : z Gamma 1; v; u v; output : v; 2.2 Example 2 Caching further extended Having come this far, let us briefly illustrate a further extension of caching ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27:164--180, 1980.
....is that the result is a linear recursion, derived, not proven (although it certainly could be) verification is subsumed by the pruning analysis. It requires associativity to obtain the iterative version of Fibonacci. This, too, is derivable using (for example) techniques originated by Wand [19]. F (z; 1; 2) where F (z; u; v) Pi = if z 0 then u else F (z Gamma 1; v; u v) For readers who prefer a statement oriented form, this function is expressed as fz = x 0 g u; v : h1; 2i; while z 0 do (z; u; v) hz Gamma 1; v; u vi; fv = F (x 0 )g Liu, Stoller and Teitelbaum ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27:164--180, 1980.
....before folding steps. Our extension of de nite logic programs makes it possible to perform in the case of logic programs, the kind of transformations which are done in the case of functional programming through the use of higher order generalizations (or lambda abstractions) 12] and continuations [18]. For instance, with reference to the example of Section 6, we have that in clause 14.f the third argument G of the predicate newp plays the role of a continuation, and indeed, the evaluation of ipcheck (X; Y ) consists of the evaluation of the goal newp(X; Y; G) followed by the evaluation of the ....
M. Wand, \Continuation-based program transformation strategies," Journal of the ACM, vol. 27, no. 1, pp. 164-180, 1980.
....is that the result is a linear recursion, derived, not proven (although it certainly could be) verification is subsumed by the pruning analysis. It requires associativity to obtain the iterative version of Fibonacci. This, too, is derivable using (for example) techniques originated by Wand [19]. F (z,1, 2) where F (z,u,v) # = if z # 0 then u else F (z 1,v,u v) For readers who prefer a statement oriented form, this function is expressed as z = x 0 u, v : #1, 2#; while z 0 do (z,u,v) #z 1,v,u v#; v = F (x 0 ) Liu, Stoller and Teitelbaum present a number of ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27:164--180, 1980.
....strategies for program transformation some algorithmic forms of theorem proving may also be added to the system. iv) Auxiliary transformation techniques. The transformation systems should allow an easy application of various transformation techniques such as: continuation based transformations [152], nite di erencing [112] schema transformations (see [113] for a survey) and changes of data structures [117] Acknowledgements We would like to thank A. Jung, E. Ritter, and the members of the Programme Committee of the ESSLLI 2000 European Summer School on Logic, Language, and Information. ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164180, 1980.
....in the literature for transforming functional and logic programs. They are related to higher order features, in the sense that continuations and communications among function calls and predicate evaluations, are created for the derivation of very efficient programs. The reader may refer to [Wand 80, Pettorossi Skowron 82] for the functional case and to [Tarau Boyer 90] for the logic case. For an introductory view of some methods for the transformation and the derivation of parallel and or concurrent programs the reader may refer to [Paige et al. 93] 4.1 Schemata Approach In the schemata ....
Wand, M.: Continuation-based Program Transformation Strategies. JACM 27 (1) (1980) 164--180
.... of the left and right hand side by the same new variable v) However, it is not easy to verify (its proof is essentially as hard as the proof of the original conjecture (5) 6 non tail recursive programs are transformed into tail recursive ones ( recursion removal , cf. e.g. Coo66,DB76,BD77,Wan80,BW82,AK82,HK92] As the goals of the existing program transformations are often opposite to ours, a promising approach is to use these classical transformations in the reverse direction. To our knowledge, such an application of these transformations for the purpose of veri cation has rarely ....
....Conditions (A) and (B) are just syntactic. In case of success, f 0 is generated and the term f(t ; e) in the algorithm g is replaced by f 0 (t ) Similar to context moving, a variant of the above rule if often used in the reverse direction (re bracketing, cf. e.g. Coo66,DB76,BD77,Wan80,BW82,PP96] Again, instead of directly reversing the technique, we modi ed and generalized it, e.g. by regarding several tail recursive and non tail recursive cases. An algorithm where this general form of our rule is needed will be presented in Sect. 5 and several others can be found in ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27:164-180, 1980.
.... verify (its proof is essentially as hard as the proof of the original conjecture (5) 5 into non tail recursive ones, but in the usual applications of program transformation, nontail recursive programs are transformed into tail recursive ones ( recursion removal , cf. e.g. Coo66, DB76, BD77, Wan80, BW82, AK82, HK92] As the goals of the existing program transformations are often opposite to ours, a promising approach is to use these classical transformations in the reverse direction. To our knowledge, such an application of these transformations for the purpose of veri cation has rarely ....
....Conditions (A) and (B) are just syntactic. In case of success, f 0 is generated and the term f(t ; e) in the algorithm g is replaced by f 0 (t ) Similar to context moving, a variant of the above rule if often used in the reverse direction (re bracketing, cf. e.g. Coo66, DB76, BD77, Wan80, BW82, PP96] Again, instead of directly reversing the technique, we modi ed and generalized this method, e.g. by regarding several tail recursive and non tail recursive cases. An algorithm where this general form of our rule is needed will be presented in Section 5 and several others can be ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27:164-180, 1980.
....VTS iota, into VTS iota clone, to assume that the top frame is a closure1. But at that time, it is no use building this top frame, one can simply add its slots as supplementary arguments to VTS iota clone. In other terms we specialize closure2 into closure2clone, in a manner reminiscent of [Wan80] such that: invoke VTS iota (extend q (make closure1 n) i j) invoke VTS iota clone q i j n) We accordingly modify the behavior of closure2 and thus define the closure2clone behavior to be: define method (invoke (self closure2) q 2 start stop) New (if ( start stop) if (closure1 ....
....Saint James who improved it to a very sophisticated level [SJ84, SJ87, SJ90] Our first motivation was to bring similar improvements to compiled Scheme. To use simultaneously VTS and the ability for functions to inspect their continuation was therefore a simple idea, at least tackled by Wand in [Wan80] A quite similar idea can be found in [CD91] who advocates the idea that partial evaluation of CPS transformed programs improves the quality of residual programs since CPS brings nearer the producers and consumers of intermediate data structures. Hence the idea of combining frames together. The ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-- 180, 1980.
....fully iterative, as in Minamide s paper [10] There should be some way to extend the iterative property to one spine of trees and other polynomial types, but we 9 have not yet discovered an elegant transformation (to follow the link inversion transformation) to produce this property. Wand [16] demonstrates an elegant sequence of transformations 7 that exploits the connection between CPS and accumulator passing style. He makes a different, but related, set of observations about the free variables in continuation terms, enabling recursive procedures to be converted to iterative ones ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the Association for Computing Machinery, 27(1):164--180, January 1980.
....folding steps. Our extension of de nite logic programs makes it possible to perform in the case of logic programs, the kind of transformations which are done in the case of functional programming through the use of higher order generalizations (or lambda abstractions) 12] and continuations [18]. For instance, with reference to the example of Section 6, we have that in clause 14.f the third argument G of the predicate newp plays the role of a continuation, and indeed, the evaluation of ipcheck(X; Y ) consists of the evaluation of the goal newp(X; Y; G) followed by the evaluation of the ....
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-180, 1980.
....The functions (a Phi i;j ) and compositions of such functions are all of the form (m ) for some m, and can be represented by the value m itself. Thus, rep g = g 0, abs m = m ) zero = 0 and Omega = Downwards accumulations with efficiently representable parameters can be computed efficiently [20]. Theorem 24. Suppose hf; Phii is efficiently representable. Then da hf; Phii t = unfold G 0 (t; zero) where 0 (in i x; p) abs p (f (inj i a) inj i (F 0 i (one; g 1 ; g k ) x) where a = F i (id; one) x g j y = y; p Omega rep (a Phi i;j ) This takes linear ....
....can be extended to regular but non polynomial datatypes. We have addressed the question of efficiency in computing downwards accumulations by assuming a particular data refinement of the operations concerned. This data refinement allows the order of evaluation of a path fold to be inverted [6, 20], so that it is computed from top to bottom instead of from bottom to top. This is a different approach to the one taken in the original definition of downwards accumulation [8, 9] There, the order of evaluation is reversed by switching to a dual path datatype informally, if the path datatypes ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164--180, January 1980.
....because the accumulating parameter is single threaded throughout the computation. It is possible to regain a characterization as a fold, but taking linear time, by abstracting from the accumulating parameter and constructing instead a function between lists 4 of lists, in a continuation based [26] or higher order fold [6] style: levelt : Tree a [ a] a] levelt = foldt f g where f a hss = a: hss g = foldr (lzw ( levelf : Forest a [ a] a] levelf = foldf f g but this is even more complicated, and moreover it requires higher order language features, ....
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-- 180, January 1980. 7
No context found.
M. Wand. Continuation-based program transformation strategies. J.ACM, 27(1):164--180, 1980.
No context found.
M. Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164--180, 1980.
No context found.
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164--180, 1980.
No context found.
M. Wand, `Continuation-based program transformation strategies', JACM, 27, (1), 164--180 (1980).
No context found.
M. Wand. Continuation-based program transformation strategies. Journal of the Association for Computing Machinery, 27(1):164--180, 1980.
No context found.
Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM 27(1):174--180, 1978.
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