ABSTRACT

In this chapter we consider examples of backtracking and exploratory transformations, and describe how such transformations can be implemented in UML-RSDS.

In some transformation problems it is difficult to formulate precisely how the transformation (considered as a collection of possibly nondeterministic rewrite rules) should behave. Instead, it is simpler to identify the characteristics of acceptable result models that should be produced by the transformation. This entails that the transformation should not terminate unless a satisfactory model is produced. For example, a program or class diagram refactoring transformation could apply automatically some rewrite rules to the program/model, and it is possible that the applications could lead to a model which is of unacceptably poor quality and the choices which led to this model must therefore be undone, and alternative rewrites applied. Other situations could be multi-objective optimisation problems, or exploratory program design. Figure 15.1 shows the execution behaviour which may occur, with some transformation executions having choice points which

may lead to either an acceptable or unacceptable final model being produced, depending on the choice made at the point.