AToMPM Solution for the IMDB Case Study.
Hüseyin Ergin, Eugene Syriani · 2014
AToMPM [3] (A Tool for Multi-Paradigm Modeling) allows one to model and execute model transformations. It provides a graphical user interface to define the metamodels of the input and output languages, define the transformation rules and their scheduling, and execute continuously or step-by-step transformations on given models. The model transformation language of AToMPM is MoTif [2]. In MoTif , rules consist of a preand a post-condition. The pre-condition pattern determines the applicability of the rule and is usually defined with a left-hand side (LHS) and optional negative application conditions (NAC). The post-condition determines the result of the rule and is defined by a right-hand side (RHS) which must be satisfied after the rule is applied. Furthermore, any element in a rule in the LHS or RHS may be assigned to a pivot. It acts as a variable that can be referred to by other rules. To use a pivot, an element from the LHS or NAC can be bound to that pivot. The rule in Fig. 1 is a MoTif rule with a NAC, LHS, and RHS (from left to right). For the remaining of the paper, we have used a more concise notation to save space and annotate the rules as needed. The scheduling, or the control flow, describes the order in which the rules are executed. Each rule is represented by a rule block having three ports. Conceptually, a rule receives models via the input port at the top. If the rule is successfully applied, the resulting model is output from the success port at the bottom left. Otherwise, the model does not satisfy the pre-condition and the original model is output from the fail port at the bottom right. Fig. 2 depicts an example of control flow structure to schedule MoTif rules. Some rule blocks are annotated in the scheduling, denoting a special behavior. The meaning of these rules are: (1) ARule: is a regular “Atomic Rule” that is executed once on a single match. It has no annotation. (e.g., resetIterator in Fig. 2) (2) FRule: stands for “For all Rule”. All matches are found first and then the rule is applied on all the matches. It is annotated with a letter ‘F’. (e.g., computeAverage in Fig. 4) (3) SRule: stands for “Star Rule”. It is a rule that is recursively applied on each match as long as matches are found. Therefore, the result of this rule is the accumulation of each application. It