## Higher-Order Expression Procedures (1995)

Venue: | In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM |

Citations: | 8 - 2 self |

### BibTeX

@INPROCEEDINGS{Sands95higher-orderexpression,

author = {David Sands},

title = {Higher-Order Expression Procedures},

booktitle = {In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM},

year = {1995},

pages = {190--201},

publisher = {ACM Press}

}

### OpenURL

### Abstract

We investigate the soundness of a specialisation technique due to Scherlis, expression procedures, in the context of a higher-order non-strict functional language. An expression procedure is a generalised procedure construct providing a contextually specialised definition. The addition of expression procedures thereby facilitates the manipulation and specialisation of programs. In the expression procedure approach, programs thus generalised are transformed by means of three key transformation rules: composition, application and abstraction. Arguably, the most notable, yet most overlooked feature of the expression procedure approach to transformation, is that the transformation rules always preserve the meaning of programs. This is in contrast to the unfold-fold transformation rules of Burstall and Darlington. In Scherlis' thesis, this distinguishing property was shown to hold for a strict first-order language. Rules for call-by-name evaluation order were stated but not proved correct....

### Citations

570 | A Transformation System for Developing Recursive Programs
- Burstall, Darlington
- 1976
(Show Context)
Citation Context ...grams with higher-order functions, non-strict evaluation order, and lazy constructors. The principle differences between the expression procedure transformation, and the well-known unfold-fold method =-=[BD77], are that-=-: ffl recursion is not introduced by explicit folding, so the computation rules are never used "backwards"; ffl each transformation step only depends on the current definitions and expressio... |

400 | Deforestation: Transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...8]) corresponds to qualified expression procedures (see [Sch80]). These components are also explicitly present in Wegbreit 's early study of transformation [Weg76], and also in Wadler's deforestation =-=[Wad90]-=-. We have checked that the transformation in this paper is sufficient to provide a natural and direct encoding of the deforestation algorithm from [Wad90]. In this way we can show that the restriction... |

239 | The lazy lambda calculus
- Abramsky
- 1990
(Show Context)
Citation Context ...se is the standard Morris-style contextual ordering, or observational approximation [Plo75, Mil77]. The notion of "observation" we take is just the fact of convergence, as in the lazy lambda=-= calculus [Abr90]-=-. Operational equivalence equates two expressions if and only if in all closing contexts they give rise to the same observation - ie. either they both converge, or they both diverge. Note that for thi... |

220 | Call-by-name, call-by-value, and the #-calculus - Plotkin - 1975 |

213 |
Unfold/fold transformations of logic programs
- Tamaki, Sato
- 1984
(Show Context)
Citation Context ...almost always that case that specific transformation methods are expressed, and justified, within a framework which guarantees correctness (such as a variant of Tamaki and Sato's unfold-fold approach =-=[TS84] ---eg. [D-=-eb88] [Ale92]). Because of their "built-in" correctness property, we believe that the expression procedure method is a good high-level framework for describing more specific (and therefore m... |

168 | The concept of a supercompiler
- Turchin
- 1986
(Show Context)
Citation Context ...eve that the expression procedure method is a good high-level framework for describing more specific (and therefore more mechanisable) transformations. For example, Turchin's supercompilation methods =-=[Tur86]-=-, applied to a non-strict language 4 can be described very naturally in terms of Scherlis' expression procedure transformations. Turchin describes transformations of REFAL (a first-order functional la... |

116 |
A syntactic theory of sequential control
- Felleisen, Friedman, et al.
- 1987
(Show Context)
Citation Context ... functions, fe 1 : : : e k , 0sk ! ff f . The operational semantics is a standard call-by-name one, and + is defined in terms of a one-step evaluation relation using the notion of a reduction context =-=[FFK87]-=-: Reduction contexts, ranged over by IR, are contexts containing a single hole which is used to identify the next expression to be evaluated (reduced). Definition 1 (Reduction Contexts) A reduction co... |

95 | Equality in lazy computation systems - Howe - 1989 |

63 | Occam’s Razor in Metacomputation: the Notion of a Perfect Process Tree
- Glück, Klimov
- 1993
(Show Context)
Citation Context ...erms of Scherlis' expression procedure transformations. Turchin describes transformations of REFAL (a first-order functional language) via the construction of a "process graph" (in the termi=-=nology of [GK93]). The aim-=- is to construct a finite graph by "folding" equivalent nodes, according to some folding strategy (for example, syntactic equivalence modulo renaming) and finally to re-interpret the graph a... |

50 |
Generalized partial computation
- Futamura, Nogi
- 1987
(Show Context)
Citation Context ...nts of supercompilation are also seen to be present in Scherlis' transformation: driving corresponds to distribution laws for conditionals, information propagations(in a general sense such as that of =-=[FN88]-=-) corresponds to qualified expression procedures (see [Sch80]). These components are also explicitly present in Wegbreit 's early study of transformation [Weg76], and also in Wadler's deforestation [W... |

38 |
Synthesis: Dreams =⇒ programs
- Manna, Waldinger
- 1979
(Show Context)
Citation Context ...rect program transformation are reviewed extensively in [San94]. Scherlis compared his approach to that of Kott [Kot78] (rather less critically than the comparison in [San94]) and Manna and Waldinger =-=[MW79]-=-. Subsequently, the bulk of work on correct unfold-fold transformations is in the setting of logic programming (although references to Scherlis' method are rare). The first, and probably best-known ap... |

31 | Proving the correctness of recursion-based automatic program transformations
- Sands
- 1996
(Show Context)
Citation Context ...he restrictions we have placed on the abstraction rule are not severe in practice 5 . We believe that it can also cope with higher-order extensions, thus providing an alternative correctness proof to =-=[San95a]-=-. We leave the details to a longer version of the paper. The significance of viewing the above transformations in the expression-procedure framework is that it ensures 4 Only partial correctness is pr... |

24 | Unfold/Fold Transformations and Loop Optimization of Logic Programs
- Debray
- 1988
(Show Context)
Citation Context ...that case that specific transformation methods are expressed, and justified, within a framework which guarantees correctness (such as a variant of Tamaki and Sato's unfold-fold approach [TS84] ---eg. =-=[Deb88] [Ale92]).-=- Because of their "built-in" correctness property, we believe that the expression procedure method is a good high-level framework for describing more specific (and therefore more mechanisabl... |

23 |
The Semantics of Destructive Lisp
- Mason
- 1986
(Show Context)
Citation Context ...t to give an alternative (but perhaps less direct) correctness proof for the transformation studied in this paper. Another direction for further work is to consider languages with side-effects. Mason =-=[Mas86]-=-[Ch. 7] extends Sherlis' transformation rules to a first-order Lisp with destructive operations, but leaves the correctness as a conjecture. It would be interesting to see if the techniques of this pa... |

23 |
Goal-directed program transformation
- WEGBREIT
(Show Context)
Citation Context ...ions(in a general sense such as that of [FN88]) corresponds to qualified expression procedures (see [Sch80]). These components are also explicitly present in Wegbreit 's early study of transformation =-=[Weg76]-=-, and also in Wadler's deforestation [Wad90]. We have checked that the transformation in this paper is sufficient to provide a natural and direct encoding of the deforestation algorithm from [Wad90]. ... |

21 | Operational theories of improvement in functional languages
- Sands
- 1991
(Show Context)
Citation Context ...each function symbol in a given program. The "efficiency" is then the total "weight" of non-primitive function calls computed. The improvement relations are instances of the improv=-=ement theories from [San91]-=-, and generalise the specific improvement theory used in [San95b] (although we do not give an associated improvement theorem). From this we define a notion of strict improvement, and show that if he; ... |

20 | Total correctness by local improvement in program transformation
- Sands
- 1995
(Show Context)
Citation Context ...t the case, then the expression case e of true )true would converge with respect to the original program, but not with respect to the new. In the study of the correctness of program transformation in =-=[San95b]-=-, an equivalent condition is given, reformulated in terms of observational equivalence (which implicitly refers to a fixed set of function definitions); a transformation is viewed as a process of deri... |

20 |
Towards unifying partial evaluation, deforestation, supercompilation, and GPC
- S��rensen, Gluck, et al.
- 1994
(Show Context)
Citation Context ...ocedures, which can be converted to program form by abstraction and application (in the manner of the last two steps of the example in Section 2). With the insights from Srensen et al 's work, [Sr94] =-=[SGJ94]-=-, the basic ingredients of supercompilation are also seen to be present in Scherlis' transformation: driving corresponds to distribution laws for conditionals, information propagations(in a general se... |

18 |
Transforming Normal Programs by Replacement
- Bossi, Cocco, et al.
- 1992
(Show Context)
Citation Context ...e system themselves. To some degree this is inevitable, since the unfold-fold method always depends on older versions of functions in order to perform interesting fold-steps. In contrast, Bossi et al =-=[BCE92]-=- considered a replacement condition which is not history-sensitive---but it is a model theoretic condition, rather than a syntactic one. In previous work, the author also proposed a semantic condition... |

18 | Expression Procedures and Program Derivation - Scherlis - 1980 |

16 |
About Transformation System: A Theoretical Study”, 3ème Colloque International sur la Programmation
- Kott
- 1978
(Show Context)
Citation Context ...thod with methods for guaranteed correctsprogram transformation. Related methods for correct program transformation are reviewed extensively in [San94]. Scherlis compared his approach to that of Kott =-=[Kot78]-=- (rather less critically than the comparison in [San94]) and Manna and Waldinger [MW79]. Subsequently, the bulk of work on correct unfold-fold transformations is in the setting of logic programming (a... |

15 | Sharing of Computations
- Amtoft
- 1993
(Show Context)
Citation Context ...l) abstraction rule. The idea of using a weighted improvement came from Torben Amtoft (Aarhus), (the use of "weights" also oc10 curs in Amtoft's study of unfold-fold transformations of logic=-= programs [Amt93][Amt92]) w-=-hen the author was explaining the details of the proof of the improvement theorem. At the time, we concluded that a "weighted" improvement theorem looked like an easy generalisation, but tha... |

11 |
Turchin's Supercompiler Revisited: An Operational Theory of Positive Information Propagation
- Srensen
- 1994
(Show Context)
Citation Context ...sion procedures, which can be converted to program form by abstraction and application (in the manner of the last two steps of the example in Section 2). With the insights from Srensen et al 's work, =-=[Sr94]-=- [SGJ94], the basic ingredients of supercompilation are also seen to be present in Scherlis' transformation: driving corresponds to distribution laws for conditionals, information propagations(in a ge... |

10 | Unfold/fold Transformations Preserving Termination Properties
- Amtoft
- 1992
(Show Context)
Citation Context ...raction rule. The idea of using a weighted improvement came from Torben Amtoft (Aarhus), (the use of "weights" also oc10 curs in Amtoft's study of unfold-fold transformations of logic progra=-=ms [Amt93][Amt92]) when the-=- author was explaining the details of the proof of the improvement theorem. At the time, we concluded that a "weighted" improvement theorem looked like an easy generalisation, but that there... |

9 | Fully abstract models of the typed - calculus - Milner - 1977 |

8 | Transformation in a non-strict language: an approach to instantiation
- Runciman, Firth, et al.
- 1990
(Show Context)
Citation Context ...could give a looping computation on K 1 (loop1) where there was none previously. The importance of strictness properties for correct transformations on non-strict programs was noted by Runciman et al =-=[RFJ89]-=- in a study of correct instantiationsin unfold-fold transformation. The use of strictness in [RFJ89] corresponds to its use in the above distribution law for case expressions. In many cases, a simple ... |

5 |
Total Correctness and Improvement in the Transformation of Functional Programs
- Sands
- 1994
(Show Context)
Citation Context ...this paper) we should compare the expressionprocedure method with methods for guaranteed correctsprogram transformation. Related methods for correct program transformation are reviewed extensively in =-=[San94]-=-. Scherlis compared his approach to that of Kott [Kot78] (rather less critically than the comparison in [San94]) and Manna and Waldinger [MW79]. Subsequently, the bulk of work on correct unfold-fold t... |

2 |
Program improvement by internal specialisation
- Scherlis
- 1981
(Show Context)
Citation Context ...tion, namely correctness, is lost. In this paper we study the correctness of a transformation method for recursive programs in a higherorder functional language. The method was introduced by Scherlis =-=[Sch81]-=-[Sch80] for a first-order language, and proved correct with respect to a call-by-value semantics. 1.1 Expression Procedures The basic approach of Scherlis' transformation is that of contextual special... |

1 |
A technique for transforming logic programs by fold-unfold transformations
- Alexandre
- 1992
(Show Context)
Citation Context ...e that specific transformation methods are expressed, and justified, within a framework which guarantees correctness (such as a variant of Tamaki and Sato's unfold-fold approach [TS84] ---eg. [Deb88] =-=[Ale92]). Because-=- of their "built-in" correctness property, we believe that the expression procedure method is a good high-level framework for describing more specific (and therefore more mechanisable) trans... |