Generating Model with Uncertainty by Means of JTL

In Model-Driven Engineering, the potential advantages of using bidirectional transformations are largely recognized. Despite its crucial function, in certain cases bidirectionality has somewhat limited success because of the ambivalence concerning non-bijectivity. In fact, consistently propagating changes from one side to the other is typically non univocal as more than one correct solution is admitted. This gives place to a form of uncertainty which means that, rather than having a single model, we actually have a set of possible models but we do not know what is the right one. In this paper, we discuss how dealing with multiple solutions is important and requires specialized tools and support. In particular, handling a set of models explicitly is generally non-viable. Thus, we extended the JTL semantics to generate a model with uncertainty which is semantically equivalent to the set of models it represents. The approach is implemented and a metamodel-independent technique is proposed. I. PROBLEM AND MOTIVATION In Model-Driven Engineering [20] (MDE) bidirectionality in transformations has been always regarded as a key mechanism [21]. Its employment comprises mapping models to other models to focus on particular features of a system, simulate/validate a given application, and primarily keeping a set of interrelated models synchronized or in a consistent state. Despite its relevance, bidirectionality has rarely produced anticipated benefits as demonstrated by the lack of a language comparable to what ATL1 represents for unidirectional transformations. Probably the main reason why bidirectional techniques had limited success can be found to some extent in the ambivalence concerning non-bijectivity. For instance, while MDE requirements demand enough expressiveness to write non-bijective transformations [23], the QVT standard is somewhat uncertain in asserting whether the language permits such transformations [22]. In particular, when reversing a noninjective bidirectional mapping more than one admissible solution can be found. This gives place to a form of uncertainty (as known in [18]): rather than having a single model, we actually have a set of possible models and we are not sure which is the right one. On the other hand, while a transformation can always be disambiguated at design-time by fixing those details that leave the solution open to multiple alternatives, in many cases this is non-viable because the designer does not detain enough information beforehand for establishing a general solution. Thus, harnessing declarative approaches capable of dealing with the intrinsic uncertainty of non-bijective bidirectional transformations in a rigorous and precise way can be 1http://www.eclipse. org/atl/ key to success. Recently, few declarative approaches [2], [3], [16] to bidirectionality have been proposed. They are able to cope with the non-bijectivity by generating all the admissible solutions of a transformation at once. Among them, the Janus Transformation Language [3] (JTL) is a model transformation language specifically tailored to support bidirectionality and change propagation. The problem of managing a set of models explicitly is impractical as its size might be quite large, designers need to be supported with suitable mechanism and tools in order to avoid the effect of having multiple design alternatives. The solution proposed in this paper, is an extension of the JTL semantics and of its engine capable of generating a uniform characterization of the solution in terms of models with uncertainty instead of a set of models, such that a) the approach is metamodel-independent, in sense that starting from an arbitrary base metamodel can automatically generate the corresponding uncertainty metamodel; b) the resulting model conforms to the uncertainty metamodel; and c) each model with uncertainty has to be considered semantically equivalent to the set of its concretizations, i.e. the models obtainable from the uncertainty model by resolving the point of uncertainties. By way of example, consider the Collapse/Expand State Diagrams round-trip benchmark [4]. The forward transformation − →T translates the hierarchical state machine in Fig. 1(a) into the flatten version in Fig. 1(b). − →T is clearly non-injective because different hierarchical machines can be translated into the same model. Let us suppose now that the designer wants to manually modify the target model by means of the changes ∆ highlighted in bold and with thicker lines in Fig. 1(c). More in details, ∆ consists of the following modifications: – a new state Printing is added, – a new transition print from Active to Printing is added, – the transition done from Active to Idle is deleted and replaced by a new transition completed, – a new transition done from Printing to Idle is added, and finally – a new transition critical error from Out of services to the initial state Off is added. At this point, the original source model and the revised target model are not consistent any longer. Therefore, the backward transformation ←− T −1 can be used to restore the consistency by propagating the changes in ∆. Not surprisingly, there is Fig. 1. Collapse/expand state diagrams in a round-trip process not a unique way of updating the source model. In fact, the added transitions in the target may be mapped to either of the nested states as well as to the container state itself, as illustrated in Fig. 1(d), where the dotted edges represent the alternative transitions. Despite the changes on the target model are relatively simple, their impact on the source model is typically exponential. In fact, the overall number of admissible models in this case is |print| × |completed| × |critical error| = 4× 4× 3 = 48 where |name| is the number of alternative model elements called name. It is worth noting that the models in Fig. 1(d) are represented by means of the dotted notation, which is informal: in this case a bidirectional transformation implemented in JTL would generate a collection of 48 distinguished models. Clearly, whenever the implementor is unable to disambiguate the transformation by making it deterministic, the decision must be left to the modeler rather than to the language internals. It is not difficult to demonstrate that for a specific instance, if n is the number of uncertainty points and m the number of alternative model elements for each of them, then the result consists of m different alternative solutions. Hence, it is of crucial relevance that modelers are adequately assisted in dealing with the combinatorial explosion of design alternatives as described in the sequel. The paper is organized as follows. Section II describes related work about this topic, Section III presents the proposed approach to represent uncertainty by means of JTL, Section IV proposes a new semantic for the JTL engine able to generate and manage models with uncertainty. Finally, Section V draws some conclusion and future work.