• Nem Talált Eredményt

(b) Then the execution ofGiveRule follows, which is performed againN times. This rule enables the next process in the ring to reserve the resource by giving the token to the process. The result model is depicted in Fig. 5.7(c).

(c) The iterative execution ofRequestRuleinitiates a process to issue a request on the resource for which the process already has a token. As a result of an iteration of length N, we obtain the model of Fig. 5.7(d).

(d) Finally,TakeRuleis executedN times. This rule assigns a process to a resource if the process has already reserved a token for the requested resource. The final instance model is isomorphic to the initial model. However, in the final model, a given resource is held by the next process in the token ring (see Fig. 5.7(e) vs. Fig. 5.7(a)).

Transformation sequence length and the number of matchings can be expressed as 4N andN, respectively.

Optimization possibilities.

• Since the order of rule applications inside a macro step is irrelevant, the specific rule can be applied concurrently (in parallel) on different processes. As a consequence, if each macro step consists of the parallel execution of the prescribed rule, then parallel and sequential transforma-tions yield equivalent results.

• Moreover, each rule application of a macro step disables the execution of the same rule on the same process, it leaves the enabledness of the same rule on other processes unchanged, and finally, it enables the execution of the following rule on the same process. These observations yield an ’as long as possible’ style application of rules appearing in the same macro step.

5.3.4 Feature matrix

Afeature matrixsummarizes the features of test sets. A sample feature matrix for the test sets of the mutual exclusion benchmark example is shown in Table 5.3. Rows of the upper and the lower table correspond to paradigm and tool features, respectively. Columns represent test sets. Moreover, these test sets can be grouped to form a benchmark example. Identifiers of the benchmark example (Mutex) and the test set (e.g.,STS) are presented in the topmost two header fields of the column in turn. A field in the table contains the feature value that characterizes the given feature of a test set.

As the domain of feature values differ for paradigm and tool features, the possible values in the fea-ture matrices are also different. Paradigm feafea-tures may have values that have been defined in Sec. 5.2.2, or they may be parameter dependent (PD), which means that their categorization may vary depending on the runtime parameter settings. Tool features can be characterized by three values. LabelON(OFF) is used if the corresponding optimization strategy is applicable and it is switched on (off) in our mea-surements. LabelN/Adenotes that the optimization strategy for the tool feature is not applicable.

5.4 The object-relational mapping as a benchmark example

The object-relational mapping can be considered as an incarnation of a typical model transformation scenario, which can be characterized by a graph structure that always increases in size as the trans-formation progresses, and by rules with such negative application conditions that inhibit the repeated

66 CHAPTER 5. BENCHMARKING FRAMEWORK FOR GRAPH TRANSFORMATION

ALAP execution LHS size

(small/large) fan-out (small/large) matchings (few/many)

(short/long)

STS LTS

transformation

sequence length PD PD

Paradigm features

PD PD Mutex

small small small

PD small small

PD PD

ALAP execution parameter passing ON/OFF OFF N/A 0..1 multiplicities ON/OFF OFF OFF parallel execution OFF OFF ON/OFF as long as possible N/A OFF OFF

STS LTS

Tool features

Mutex

Table 5.3: Paradigm and tool features of the mutual exclusion benchmark example

execution of the given rule on the same matching. The metamodel and the set of graph transformation rules needed to specify this benchmark example have already been introduced in Sections 2.2 and 3.1, respectively. For the object-relational mapping, only a single test set has been defined.

Test set specification

This test set can be characterized by patterns from the range between thesmalland thelargecategories.

The number of matchings, the maximum degree of nodes (i.e., the fan-out) and the length of the trans-formation sequence are parameter dependent.

The single runtime parameterN denotes the number ofClasses in the initial instance model, and it influences both the model size and the transformation sequence length on a quadratic scale.

The initial instance model has a singlePackagethat containsN Classes. An Associationand two

AssociationEndsare added to the model for each pair ofClasses, thus initially, we haveN(N −1)/2

AssociationsandN(N −1)AssociationEnds. Associationsare also contained by the singlePackageas expressed by the corresponding links of typeEO. EachAssociationEndis connected to a correspond-ingAssociationandClass by aCF andSFTlink, respectively. A sample initial model is presented in Fig. 5.8(a) for theN = 2case.

The transformation sequence consists of 4 macro steps that are executed in this specific order.

(a) The first macro step is a single application ofPackageRule(Fig. 3.1(a)), which results in a model shown in Fig. 5.8(b).

(b) This is followed by a macro step that consists N(N − 1)/2 applications of AssociationRule

(Fig. 3.1(c)). The model at this point is depicted by Fig. 5.8(c).

(c) Then classes are transformed by the execution ofClassRule(Fig. 3.1(b)) forN times. The re-sulting model after the intermediate step of the N = 2case is presented in Fig. 5.8(d), while Fig. 5.8(e) shows the model obtained at the end of this macro step.

5.4. THE OBJECT-RELATIONAL MAPPING AS A BENCHMARK EXAMPLE 67

(b) Model after the 1st macro step

p:Package

(c) Model after the 2nd macro step

p:Package

(d) Model under transformation during the 3rd macro step

(e) Model after the 3rd macro step

p:Package

(f) Model under transformation during the 4th macro step

(g) Model after the 4th macro step

Figure 5.8: Models in different phases of rule execution

68 CHAPTER 5. BENCHMARKING FRAMEWORK FOR GRAPH TRANSFORMATION

(d) Finally, a macro step of lengthN(N −1)follows, which prescribes the application of Assoc-EndRule (Fig. 3.1(f)). Models resulted by the intermediate and final steps are depicted in Fig-ures 5.8(f) and 5.8(g), respectively.

The transformation sequence consists of(3N2−N+ 2)/2rule applications altogether. The largest instance model has4N2+ 2objects and(21N2−7N+ 4)/2links as shown by Fig. 5.8(g).

Optimization possibilities.

• Since the order of rule applications inside a macro step is irrelevant, the specific rule can be applied concurrently (in parallel). As a consequence, if each macro step consists of the parallel execution of the prescribed rule, then parallel and sequential transformations yield equivalent results.

• Since negative application conditions in the rule set of this benchmark example inhibit the re-peated execution of the given rule on the same matching, an ’as long as possible’ style rule application is allowed for each macro step.