## An Intermediate Meta-Language for Program Transformation (1998)

Citations: | 5 - 0 self |

### BibTeX

@TECHREPORT{Tullsen98anintermediate,

author = {Mark Tullsen and Paul Hudak},

title = {An Intermediate Meta-Language for Program Transformation},

institution = {},

year = {1998}

}

### OpenURL

### Abstract

As part of an effort to bridge the gap between the theory and practice of program transformation, we have designed a meta-language for transforming functional programs. The metalanguage is sound in preserving both value and termination properties of programs (and is thus superior to the unfold/fold methodology). Our key contribution is an equational specification of Scherlis's expression procedures, in which we express the essence of expression procedures as a single transformation rule. Our approach has the following advantages over both unfold/fold and expression procedures: (1) all program derivations are reversible; (2) many transformations can be done which unfold/fold and expression procedures cannot do; and (3) the proof of correctness is far simpler. 1 Introduction Program transformation has been an elusive goal of the programming language research community. We talk about it, write about it, preach about it, but in practice don't use it very much. In the functional p...

### Citations

604 | A Transformation System for Developing Recursive Programs
- Burstall, Darlington
- 1977
(Show Context)
Citation Context ...termediate meta-language for PATH. 2 2 Approaches to Program Transformation 2.1 Unfold/Fold The best known approach to program transformation is the unfold/fold methodology of Burstall and Darlington =-=[3]-=-. This approach is based on six rules: (1) unfold: the unfolding of function calls by replacing the call with the body of the function where actual parameters are substituted for formal parameters; (2... |

497 |
Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory
- STOY
- 1977
(Show Context)
Citation Context ...eversible rule. If we did so we would have this rule C[f.D[f]] = g.E[g] if C[D[f]] = E[C[f]], C[] strict which is valid, it is simply a free theorem [22] of . This theorem is found in numerous places =-=[1, 7, 20, 13]-=-; we take its name, Fix-Point Fusion, from Meijer et al [13] where the power of the theorem is exploited considerably: most of their transformations are instances of this one general theorem. So, we h... |

339 | Theorems for free
- Wadler
- 1989
(Show Context)
Citation Context ...ace ) ep with = in the above rule we would have a reversible rule. If we did so we would have this rule C[f.D[f]] = g.E[g] if C[D[f]] = E[C[f]], C[] strict which is valid, it is simply a free theorem =-=[22]-=- of . This theorem is found in numerous places [1, 7, 20, 13]; we take its name, Fix-Point Fusion, from Meijer et al [13] where the power of the theorem is exploited considerably: most of their transf... |

308 | Functional programming with bananas, lenses, envelopes and barbed wire
- Meijer, Paterson
- 1991
(Show Context)
Citation Context ...eversible rule. If we did so we would have this rule C[f.D[f]] = g.E[g] if C[D[f]] = E[C[f]], C[] strict which is valid, it is simply a free theorem [22] of . This theorem is found in numerous places =-=[1, 7, 20, 13]-=-; we take its name, Fix-Point Fusion, from Meijer et al [13] where the power of the theorem is exploited considerably: most of their transformations are instances of this one general theorem. So, we h... |

159 | Semantic domains
- Gunter, Scott
- 1990
(Show Context)
Citation Context ...eversible rule. If we did so we would have this rule C[f.D[f]] = g.E[g] if C[D[f]] = E[C[f]], C[] strict which is valid, it is simply a free theorem [22] of . This theorem is found in numerous places =-=[1, 7, 20, 13]-=-; we take its name, Fix-Point Fusion, from Meijer et al [13] where the power of the theorem is exploited considerably: most of their transformations are instances of this one general theorem. So, we h... |

153 |
Proving and applying program transformations expressed with second- order patterns
- HUET, LANG
- 1978
(Show Context)
Citation Context ...our case (though we hope to eventually support full Haskell). transformation rules. Semantics preserving transformation rules for the object-language; they are in the form of transformation templates =-=[9], "P -=-1 = P 2 if C", where P 1 and P 2 are program schemes and C is an applicability condition. meta-language. The language that describes the application of a transformation rule at a point in a progr... |

113 |
Program transformation systems
- Partsch, Steinbrüggen
- 1983
(Show Context)
Citation Context ... could ever be advantageous). 6 By showing how to do expression procedure transformations with a single transformation rule we have integrated two different approaches to doing program transformation =-=[14]-=-: (1) the schematic, or catalog, approach which is based on using a large catalog of rules, each performing a significant transformation and (2) the generative set approach, which is based on a small ... |

99 |
de Moor O., Algebra of Programming
- Bird
- 1997
(Show Context)
Citation Context ...ing a significant transformation and (2) the generative set approach, which is based on a small set of simple rules which in combination are very expressive. The Bird-Meertens Formalism (or Squiggol) =-=[2, 12, 13]-=- is an example of the former. Unfold/fold and expression procedures are examples of the latter. The schematic approach can be more concise and allow for the development of powerful laws which do major... |

96 |
Algorithmics — towards programming as a mathematical activity
- Meertens
- 1986
(Show Context)
Citation Context ...ing a significant transformation and (2) the generative set approach, which is based on a small set of simple rules which in combination are very expressive. The Bird-Meertens Formalism (or Squiggol) =-=[2, 12, 13]-=- is an example of the former. Unfold/fold and expression procedures are examples of the latter. The schematic approach can be more concise and allow for the development of powerful laws which do major... |

83 |
Report on the Programming Language Haskell
- Hudak, Jones, et al.
- 1988
(Show Context)
Citation Context ...dge the gap between the theory and practice of program transformation, we are developing PATH (Programmer Assistant for Transforming Haskell), a program transformation system for the language Haskell =-=[8]. A key de-=-sign step in PATH was to recognize the need for a well designed "intermediate meta-language". But what is an intermediate meta-language? In order to answer this question, we distinguish diff... |

50 | Essence of generalized partial computation - Futamura, Nogi, et al. - 1991 |

39 |
Synthesis: dreams ! programs
- Manna, Waldinger
- 1979
(Show Context)
Citation Context ... with other approaches. 6.1 Transforming an Infinite List Here we derive a program which is an infinite list. The standard technique of using a well-founded ordering to prove termination of functions =-=[5, 11]-=- is inapplicable for recursively defined data-structures. Another technique would be needed in unfold/fold to verify the correctness of the following transformation. We assume that map and succ are pr... |

30 |
Program improvement by internal specialization
- Scherlis
- 1981
(Show Context)
Citation Context ... is needed because a previous definition of a function is used to give folding its power. 2.2 Expression Procedures Motivated by the problems with unfold/fold, Scherlis invented expression procedures =-=[18, 19]-=-. (More recently Sands [16] extended this work to a higher-order non-strict language.) Scherlis's key innovation was to add a new procedure definition mechanism to his language: expression procedures.... |

21 |
Some Techniques for Recursion Removal From Recursive Functions
- Arsac, Kodratoff
- 1982
(Show Context)
Citation Context |

20 | Total correctness by local improvement in program transformation
- Sands
- 1995
(Show Context)
Citation Context ...roposed by Kott [10]. Another is to provide a separate proof of termination. Yet another is the "tick algebra" of Sands, which guarantees incremental improvement in performance to all transf=-=ormations [17]-=-. Besides the problem with correctness, unfold/fold has a significant inconvenience in practice: a history must be kept of all versions of the program as it is being transformed (or the user must spec... |

18 |
Expression Procedures and Program Derivation
- Scherlis
- 1980
(Show Context)
Citation Context ... is needed because a previous definition of a function is used to give folding its power. 2.2 Expression Procedures Motivated by the problems with unfold/fold, Scherlis invented expression procedures =-=[18, 19]-=-. (More recently Sands [16] extended this work to a higher-order non-strict language.) Scherlis's key innovation was to add a new procedure definition mechanism to his language: expression procedures.... |

15 | Generalized partial computation for a lazy functional language - Takano - 1991 |

8 | Transformation in a non-strict language: an approach to instantiation
- Runciman, Firth, et al.
- 1990
(Show Context)
Citation Context ...ds to the instantiation rule in unfold/fold (which only goes in one direction). The context C[] must be strict: as Sands [16] has noted, this corresponds to the conditions described by Runciman et al =-=[15]-=- for safe instantiation in a non-strict language. The strictness condition needed by Instantiation and Fix-point Fusion is, in actual use, often detected syntactically: the contexts defined by S are s... |

7 |
A Fold/Unfold Transformation System for a Nonstrict Language
- Firth
- 1990
(Show Context)
Citation Context ... with other approaches. 6.1 Transforming an Infinite List Here we derive a program which is an infinite list. The standard technique of using a well-founded ordering to prove termination of functions =-=[5, 11]-=- is inapplicable for recursively defined data-structures. Another technique would be needed in unfold/fold to verify the correctness of the following transformation. We assume that map and succ are pr... |

7 | Higher-Order Expression Procedures
- Sands
- 1995
(Show Context)
Citation Context ...efinition of a function is used to give folding its power. 2.2 Expression Procedures Motivated by the problems with unfold/fold, Scherlis invented expression procedures [18, 19]. (More recently Sands =-=[16]-=- extended this work to a higher-order non-strict language.) Scherlis's key innovation was to add a new procedure definition mechanism to his language: expression procedures. The left hand side of an e... |

5 |
Unfold/Fold Transformations
- Kott
- 1985
(Show Context)
Citation Context ...tion can be introduced inadvertently. Several approaches have been proposed to solve this problem of partial correctness. One is to suitably constrain the use of fold, for example as proposed by Kott =-=[10]. Another -=-is to provide a separate proof of termination. Yet another is the "tick algebra" of Sands, which guarantees incremental improvement in performance to all transformations [17]. Besides the pr... |

3 |
Schematic rules within unfold/fold approach to program transformation
- Chin, Darlington
- 1989
(Show Context)
Citation Context ...ease of use---there is no need to search a catalog. A disadvantage is that derivations are more verbose: many of the same steps (unfold, simplify, fold) are taken again and again. Chin and Darlington =-=[4]-=- noted the need to integrate these two approaches and added schematic rules to unfold/fold and a method to generate new schematic rules using unfold/fold. In contrast, our method of integration is to ... |