## Strongly typed rewriting for coupled software transformation (2006)

Venue: | Proc. 7th Int. Workshop on Rule-Based Programming (RULE 2006), ENTCS |

Citations: | 12 - 4 self |

### BibTeX

@INPROCEEDINGS{Cunha06stronglytyped,

author = {Alcino Cunha and Joost Visser},

title = {Strongly typed rewriting for coupled software transformation},

booktitle = {Proc. 7th Int. Workshop on Rule-Based Programming (RULE 2006), ENTCS},

year = {2006},

pages = {17--34},

publisher = {Elsevier}

}

### Years of Citing Articles

### OpenURL

### Abstract

Coupled transformations occur in software evolution when multiple artifacts must be modified in such a way that they remain consistent with each other. An important example involves the coupled transformation of a data type, its instances, and the programs that consume or produce it. Previously, we have provided a formal treatment of transformation of the first two: data types and instances. The treatment involved the construction of typesafe, type-changing strategic rewrite systems. In this paper, we extend our treatment to the transformation of corresponding data processing programs. The key insight underlying the extension is that both data migration functions and data processors can be represented type-safely by a generalized abstract data type (GADT). These representations are then subjected to program calculation rules, harnessed in typesafe, type-preserving strategic rewrite systems. For ease of calculation, we use point-free representations and corresponding calculation rules. Thus, coupled transformations are carried out in two steps. First, a type-changing rewrite system is applied to a source type to obtain a target type together with (representations of) migration functions between source and target. Then, a type-preserving rewrite system is applied to the composition of a migration function and a data processor on the source (or target) type to obtain a data processor on the target (or source) type. All rewrites are type-safe. Key words: Program transformation, term rewriting, strategic programming, generalized abstract datatypes, data refinement.

### Citations

400 | Deforestation: Transforming programs to eliminate trees
- Wadler
- 1990
(Show Context)
Citation Context ...eserving strategic rewrite sys2sCunha and Visser tem on type-safe representations of the functions (queries, producers, migrations) involved. The key idea is to use fusion or deforestation techniques =-=[24]-=- in order to eliminate the intermediate data type A. In Section 2 we present a concrete example to motivate our approach to coupled transformation. In Section 6 we show how the type-preserving rewrite... |

215 |
Introduction to Functional Programming using Haskell, 2nd edition
- Bird
- 1998
(Show Context)
Citation Context ...ting by hand, this rule is implicitly assumed by omitting parentheses around composition combinators. This strategy has been hard-wired into some rewrite systems, such as Bird’s functional calculator =-=[2]-=-, by using a composition operator of variable arity and implementing a dedicated pattern matching mechanism modulo Comp-Assoc. We used a different approach. Before applying any rule concerning product... |

123 | Combinators for bi-directional tree transformations: a linguistic approach to the view update problem
- Foster, Greenwald, et al.
(Show Context)
Citation Context ...o drive normalization further. We believe that our techniques for coupled 16sCunha and Visser transformations can equally be beneficial in related areas such as bi-directional programming with lenses =-=[10]-=-. In particular, we intend to design rewrite systems for checking and inferring types of bi-directional programs, optimizing them and proving their properties. To support migration of structure-shy qu... |

74 | A lightweight implementation of generics and dynamics
- Cheney, Hinze
- 2002
(Show Context)
Citation Context ...int-free rewrite rules. Although convenient, GADTs are not essential for these particular tasks. For example, it is possible to encode type representations in Haskell using existential quantification =-=[1,3]-=-. Type-directed rewrite rules could in principle be encoded also with type-classes using the techniques described in [18]. It would be interesting to see whether all ingredients of our solution to cou... |

62 |
Scrap your boilerplate with class: extensible generic functions. Pages 204–215 of: ICFP’05
- Lämmel, Jones, et al.
- 2005
(Show Context)
Citation Context ...le to encode type representations in Haskell using existential quantification [1,3]. Type-directed rewrite rules could in principle be encoded also with type-classes using the techniques described in =-=[18]-=-. It would be interesting to see whether all ingredients of our solution to coupled rewriting could be realized with similar elegance without resorting to GADTs. 8 Concluding remarks We have shown tha... |

57 | Typing dynamic typing
- Baars, Swierstra
- 2002
(Show Context)
Citation Context ... type and migration functions. Instead, we can make judicious use of existential and universally quantified types to model dynamic types and dynamically typed values and functions, in a type-safe way =-=[1]-=-. With these, migration functions can be computed and used in a single stage. 6 Coupled transformation Now we will demonstrate how the rewrite systems introduced in the previous section allow us to ad... |

48 | Wobbly types: type inference for generalised algebraic data types
- Jones, Washburn, et al.
- 2004
(Show Context)
Citation Context ...write system performs rewrites on types themselves. To ensure type-safety of both rewrite systems, a universal representation of types does not suffice. Using generalized algebraic data types (GADTs) =-=[22]-=-, a recent extension to the Haskell type system, it is possible to declare a parameterized data type Type a whose inhabitants must be representations of type a [12]: data Type a where Int :: Type Int ... |

41 | scrap your boilerplate” reloaded
- Hinze, Löh, et al.
- 2006
(Show Context)
Citation Context ...alized algebraic data types (GADTs) [22], a recent extension to the Haskell type system, it is possible to declare a parameterized data type Type a whose inhabitants must be representations of type a =-=[12]-=-: data Type a where Int :: Type Int String :: Type String One :: Type () Either :: Type a → Type b → Type (Either a b) Prod :: Type a → Type b → Type (a, b) Func :: Type a → Type b → Type (a → b) List... |

39 |
Data refinement by calculation
- Morgan, Gardiner
- 1990
(Show Context)
Citation Context ...examples of coupled transformation of data format and instances, identified by Lämmel et al [16,17]. Our approach to such two-level transformations ([6], Section 5) is based on data refinement theory =-=[20,21]-=-. Co-transformation Cleve et al use the term ‘co-transformation’ for the process of re-engineering three kinds of artifacts simultaneously: a database schema, database contents, and application progra... |

30 | G.: Generic program transformation
- Moor, Sittampalam
- 1998
(Show Context)
Citation Context ...ted to involve fusion. Program transformation in calculational form Several systems have been developed for performing program transformation in calculational form using fusion laws. Among these, MAG =-=[19]-=- and Yicho [13] are prominent, but both are targeted towards Haskell programs written in the pointwise style. In order to cope with fusion laws for generic recursion patterns both resort to advanced h... |

27 | Calculating Functional Programs
- Gibbons
- 2002
(Show Context)
Citation Context ... arguments explicitly. In fact, the getArtists query was defined in this style. Point-free combinators satisfy a powerful set of equational laws for reasoning about functional programs by calculation =-=[11]-=-, and due to the absence of variables and λ-abstractions, implementing a rewrite system to automate such calculations is straightforward. Point-free combinators and their laws The most fundamental com... |

21 | Coupled software transformations (extended abstract
- Lämmel
- 2004
(Show Context)
Citation Context ...tatypes, data refinement. 1 Introduction Coupled transformations occur in software evolution when multiple artifacts must be modified in such a way that they remain consistent with each other. Lämmel =-=[14]-=- identified the category of coupled transformations and discussed their widespread 1 Email: alcino@di.uminho.pt 2 Email: joost.visser@di.uminho.pt 3 Work funded by Fundação para a Ciência e a Tecnolog... |

21 | Format Evolution
- Lämmel, Lohmann
- 2001
(Show Context)
Citation Context ...gram transformation into account. Two-level transformation Format evolution and data mappings are important examples of coupled transformation of data format and instances, identified by Lämmel et al =-=[16,17]-=-. Our approach to such two-level transformations ([6], Section 5) is based on data refinement theory [20,21]. Co-transformation Cleve et al use the term ‘co-transformation’ for the process of re-engin... |

21 | A reification calculus for model-oriented software specification
- Oliveira
- 1990
(Show Context)
Citation Context ...examples of coupled transformation of data format and instances, identified by Lämmel et al [16,17]. Our approach to such two-level transformations ([6], Section 5) is based on data refinement theory =-=[20,21]-=-. Co-transformation Cleve et al use the term ‘co-transformation’ for the process of re-engineering three kinds of artifacts simultaneously: a database schema, database contents, and application progra... |

20 | Some lambda calculi with categorical sums and products
- Dougherty
- 1993
(Show Context)
Citation Context ...a × b → a × b. The use of such type-directed expansions is becoming extremely relevant; they were fundamental, for example, in establishing the decidability of equality in the simply typed λ-calculus =-=[8,9]-=-. As an example of encoding a type-directed rule, consider Bang-Eta (left to right): bang eta :: Rule bang eta Bang = mzero bang eta (Func One) = return Bang bang eta = mzero In order to avoid non-ter... |

9 | Point-free Program Transformation
- Cunha
- 2005
(Show Context)
Citation Context ...fusion is easier to encode. A disadvantage of the MAG system is that it uses a fixed strategy to apply the transformation rules, while Yicho provides some basic strategy combinators. In previous work =-=[7]-=- the first author presented a rewriting system for simplifying point-free expressions, which was used to optimize expressions resulting from a program transformation tool that translates pointwise Has... |

9 |
Generic proofs for combinator-based generic programs
- Reig
(Show Context)
Citation Context ...rt migration of structure-shy queries, we would like to extend our point-free expressions with generic programming primitives, and to extend our type-preserving rewrite system with corresponding laws =-=[23]-=-. Work is underway to apply our rewrite systems to XML and SQL systems. Implementation All Haskell code shown is part of an implementation that contains a wide range of rules and strategies for couple... |

8 | Co-transformations in Database Applications Evolution
- Cleve, Hainaut
- 2006
(Show Context)
Citation Context ...et al use the term ‘co-transformation’ for the process of re-engineering three kinds of artifacts simultaneously: a database schema, database contents, and application programs linked to the database =-=[5,4]-=-. Their approach involves generative and transformational techniques to transform data manipulation statements of legacy information systems, but is limited to information preserving transformations o... |

8 | Type-safe two-level data transformation
- Cunha, Oliveira, et al.
- 2006
(Show Context)
Citation Context ... we have taken first steps to providing such a framework. In particular, we have provided a formal treatment of two-level data transformations, i.e. coupled transformation of data types and instances =-=[6]-=-. In this paper, we extend our previous treatment to include transformations of data processors. A global overview of our perspective on the coupled transformation problem is given in Figure 1. A type... |

5 | Mappings Make Data Processing Go ’Round
- Lämmel, Meijer
(Show Context)
Citation Context ...gram transformation into account. Two-level transformation Format evolution and data mappings are important examples of coupled transformation of data format and instances, identified by Lämmel et al =-=[16,17]-=-. Our approach to such two-level transformations ([6], Section 5) is based on data refinement theory [20,21]. Co-transformation Cleve et al use the term ‘co-transformation’ for the process of re-engin... |

3 |
Co-transformations in information system reengineering
- Cleve, Henrard, et al.
- 2005
(Show Context)
Citation Context ...et al use the term ‘co-transformation’ for the process of re-engineering three kinds of artifacts simultaneously: a database schema, database contents, and application programs linked to the database =-=[5,4]-=-. Their approach involves generative and transformational techniques to transform data manipulation statements of legacy information systems, but is limited to information preserving transformations o... |

3 |
A confluent reduction for the extensional typed λ-calculus with pairs, sums, recursion and terminal object
- Cosmo, Kesner
- 1993
(Show Context)
Citation Context ...a × b → a × b. The use of such type-directed expansions is becoming extremely relevant; they were fundamental, for example, in establishing the decidability of equality in the simply typed λ-calculus =-=[8,9]-=-. As an example of encoding a type-directed rule, consider Bang-Eta (left to right): bang eta :: Rule bang eta Bang = mzero bang eta (Func One) = return Bang bang eta = mzero In order to avoid non-ter... |

2 |
Optimizations and transformations in calculation form
- Hu, Yokoyama, et al.
- 2006
(Show Context)
Citation Context ...fusion. Program transformation in calculational form Several systems have been developed for performing program transformation in calculational form using fusion laws. Among these, MAG [19] and Yicho =-=[13]-=- are prominent, but both are targeted towards Haskell programs written in the pointwise style. In order to cope with fusion laws for generic recursion patterns both resort to advanced higher-order mat... |

2 |
Transformations everywhere. Sci. Comput. Program., 52:1–8, 2004. Guest editor’s introduction to special issue on program transformation
- Lämmel
(Show Context)
Citation Context ...ith updates of the programs that connect to these database instances. An important research challenge remains in providing a general and comprehensive conceptual framework for coupled transformations =-=[15]-=-. Previously, we have taken first steps to providing such a framework. In particular, we have provided a formal treatment of two-level data transformations, i.e. coupled transformation of data types a... |