We study one dimension in program evolution, namely the evolution of the datatype declarations in a program. To this end, a suite of basic transformation operators is designed. We cover structure-preserving refactorings, but also structure-extending and -reducing adaptations. Both the object programs that are subject to datatype transformations, and the meta programs that encode datatype transformations are functional programs.
Formal program transformation @cite_0 separates two concerns: the development of an initial, maybe inefficient program the correctness of which can easily be shown, and the stepwise derivation of a better implementation in a semantics-preserving manner. Partsch's textbook @cite_8 describes the formal approach to this kind of software development. Pettorossi and Proietti study typical transformation rules (for functional and logic) programs in @cite_17 . Formal program transformation, in part, also addresses datatype transformation @cite_3 , say data refinement. Here, one gives different axiomatisations or implementations of an abstract datatype which are then related by well-founded transformation steps. This typically involves some amount of mathematical program calculation. By contrast, we deliberately focus on the more syntactical transformations that a programmer uses anyway to adapt evolving programs.
@cite_0 @cite_17 @cite_3 @cite_8
2023299380 1988290118 1554561354
A system of rules for transforming programs is described, with the programs in the form of recursion equations. An initially very simple, lucid, and hopefully correct program is transformed into a more efficient one by altering the recursion structure. Illustrative examples of program transformations are given, and a tentative implementation is described. Alternative structures for programs are shown, and a possible initial phase for an automatic or semiautomatic program-manipulation system is indicated. We present an overview of the program transformation methodology, focusing our attention on the so-called “rules + strategies” approach in the case of functional and logic programs. The paper is intended to offer an introduction to the subject. The various techniques we present are illustrated via simple examples. The process of software development is gradually achieving more rigor. Proficient developers now construct software indirectly through the abstraction of models. Models allow a developer to focus on the essential aspects of an application and defer details. Transformations extend the power of models, as the developer can substitute refinement and optimization of models for tedious manipulation of code. We catalog object modeling transformations that we have encountered in our application work.