Skip to main content
Log in

Colouring: execution, debug and analysis of QVT-relations transformations through coloured Petri nets

  • Regular Paper
  • Published:
Software & Systems Modeling Aims and scope Submit manuscript

Abstract

QVT is the standard language sponsored by the OMG to specify model-to-model transformations. It includes three different languages, being QVT-relations (QVT-R) the one with higher-level of abstraction. Unfortunately, there is scarce tool support for it nowadays, with incompatibilities and disagreements between the few tools implementing it, and lacking support for the analysis and verification of transformations. Part of this situation is due to the fact that the standard provides only a semi-formal semantics for QVT-R. In order to alleviate this situation, this paper provides a semantics for QVT-R through its compilation into coloured Petri nets. The theory of coloured Petri nets provides useful techniques to analyse transformations (e.g. detecting relation conflicts, or checking whether certain structures are generated or not in the target model) as well as to determine their confluence and termination given a starting model. Our semantics is flexible enough to permit the use of QVT-R specifications not only for transformation and check-only scenarios, but also for model matching and model comparison, not covered in the original standard. As a proof of concept, we report on the use of CPNTools for the execution, debugging, verification and validation of transformations, and on a tool chain (named Colouring) to transform QVT-R specifications and their input models into the input format of CPNTools, as well as to export and visualize the transformation results back as models.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28
Fig. 29
Fig. 30
Fig. 31
Fig. 32
Fig. 33
Fig. 34
Fig. 35
Fig. 36

Similar content being viewed by others

Notes

  1. For simplicity, by now we intentionally avoid using class inheritance in the meta-models. We will show how our method handles inheritance in Sect. 4.6.

  2. CPNTools depicts enabled transitions by highlighting them in green colour.

  3. The purpose of this somewhat artificial example is to show the effect of the CBE semantics in Sects. 4.5 and 7.

  4. A2 stores objects of type A, but we use a different name because CPNTools does not allow duplicated place names in the same page.

  5. Currently, our generator does not consider CBE semantics or optimizations of places. This is left as future work.

  6. Modelink is part of the GMT Epsilon project, available at http://www.eclipse.org/epsilon/doc/modelink/.

  7. MediniQVT does not prevent these queries and may produce target models that together with the source one would not pass the check-only scenario.

References

  1. Barkaoui, K., Dutheillet, C., Haddad, S.: An efficient algorithm for finding structural deadlocks in colored Petri nets. In: APN’93, pp. 69–88 (1993)

  2. Boronat, A.: MOMENT: A formal framework for MOdel managemMENT. PhD thesis, Universitat Politécnica de Valencia (2007). http://moment.dsic.upv.es/content/view/34/75/. Accessed Nov 2010

  3. Boronat, A., Carsí, J.A., Ramos, I.: Algebraic specification of a model transformation engine. In: FASE’06. LNCS, vol. 3922, pp. 262–277. Springer, Berlin (2006)

  4. Boronat, A., Heckel, R., Meseguer, J.: Rewriting logic semantics and verification of model transformations. In: FASE’09. LNCS, vol. 5503, pp. 18–33. Springer, Berlin (2009)

  5. Cabot, J., Clarisó, R., Guerra, E., de Lara, J.: Verification and validation of declarative model-to-model transformations through invariants. J. Syst. Softw. 83(2), 283–302 (2010)

    Article  Google Scholar 

  6. Cheng, A., Christensen, S., Mortensen, K.H.: Model checking coloured Petri nets exploiting strongly connected components. In: WODES’96, pp. 169–177 (1996)

  7. Clarke, E.M., Grumberg, O., Peled, D.A.: Model Checking. MIT Press, Cambridge (1999)

    Google Scholar 

  8. Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.L. (eds.): All About Maude—A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic. LNCS, vol. 4350. Springer, Berlin (2007)

  9. Colouring. http://astreo.ii.uam.es/~eguerra/tools/colouring/main.htm. Accessed July 2011

  10. de Lara, J., Guerra, E.: Formal support for QVT-Relations with coloured Petri nets. In: MoDELS’09. LNCS, vol. 5795, pp. 256–270. Springer, Berlin (2009)

  11. Ehrig, H., Ehrig, K., Prange, U., Taentzer, G.: Fundamentals of Algebraic Graph Transformation. Springer, Berlin (2006)

    MATH  Google Scholar 

  12. Evangelista, S., Haddad, S., Pradat, J.-F.: Syntactical colored Petri nets reductions. In: ATVA’05. LNCS, vol. 3707, pp. 202–216. Springer, Berlin (2005)

  13. Fujaba. http://www.fujaba.de/. Accessed Nov 2010

  14. García, M.: Formalization of QVT-Relations: OCL-based static semantics and alloy-based validation. In: MDSD Today, pp. 21–30. Shaker Verlag (2008)

  15. Greenyer, J., Kindler, E.: Comparing relational model transformation technologies: implementing Query/View/Transformation with triple graph grammars. Softw. Syst. Model. 9(1), 21–46 (2010)

    Google Scholar 

  16. Guerra, E., de Lara, J., Orejas, F.: Inter-modelling with patterns. Softw. Syst. Model (2011, in press)

  17. Heckel, R., Küster, J.M., Taentzer, G.: Confluence of typed attributed graph transformation systems. In: ICGT. LNCS, vol. 2505, pp. 161–176. Springer, Berlin (2002)

  18. Jensen, K.: Coloured Petri Nets Basic Concepts, Analysis Methods and Practical Use. Monographs in Theoretical Computer Science. Springer, Berlin (1997)

    Google Scholar 

  19. Jensen, K., Kristensen, L.M., Wells, L.: Coloured Petri nets and CPN tools for modelling and validation of concurrent systems. STTT 9(3–4):213–254 (2007). http://cpntools.org. Accessed July 2011

    Google Scholar 

  20. JET. http://www.eclipse.org/modeling/m2t/?project=jet. Access- ed Accessed Nov 2010

  21. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: a model transformation tool. Sci. Comput. Program. 72(1–2), 31–39 (2008). http://www.emn.fr/z-info/atlanmod/index.php/Main_Page. Accessed Nov 2010

    Google Scholar 

  22. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I., Valduriez, P.: ATL: a QVT-like transformation language. In: OOPSLA’06, pp. 719–720. ACM, New York (2006)

  23. Jouault, F., Kurtev, I.: On the architectural alignment of ATL and QVT. In: SAC’06, pp. 1188–1195 (2006). http://www.eclipse.org/m2m/atl/usecases/QVT2ATLVM/

  24. Kolovos, D.S.: Establishing correspondences between models with the Epsilon Comparison Language. In: ECMDA-FA’09. LNCS, vol. 5562, pp. 146–157. Springer, Berlin (2009)

  25. Kolovos, D.S., Paige, R.F., Polack, F.: Merging models with the Epsilon Merging Language (EML). In: MoDELS’06. LNCS, vol. 4199, pp. 215–229. Springer, Berlin (2006)

  26. Kolovos, D.S., Paige, R.F., Polack, F.: The Epsilon Transformation Language. In: ICMT’08. LNCS, vol. 5063, pp. 46–60. Springer, Berlin (2008)

  27. Kolovos, D.S., Ruscio, D.D., Pierantonio, A., Paige, R.F.: Different models for model matching: an analysis of approaches to support model differencing. In: CVSM’09, pp. 1–6. IEEE CS (2009)

  28. Königs, A., Schürr, A.: Tool integration with triple graph grammars: a survey. ENTCS 148(1), 113–150 (2006)

    Google Scholar 

  29. Landweber, L.H., Robertson, E.L.: Properties of conflict-free and persistent Petri nets. J. ACM 25(3), 352–364 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  30. Lucas, F.J., Álvarez, J.A.T.: Model transformations powered by rewriting logic. In: CAiSE Forum. CEUR Proceedings, vol. 344, pp. 41–44 (2008)

  31. MediniQVT. http://projects.ikv.de/qvt/. Accessed Nov 2010

  32. Mellor, S.J., Scott, K., Uhl, A., Weise, D.: MDA Distilled. Addison-Wesley Object Technology Series (2004)

  33. ModelMorf. http://www.tcs-trddc.com/trddc_website/scripts/project_detail.php?lab=SWRD&project_id=44. Accessed Nov 2010

  34. MOFLON. http://www.moflon.org/. Accessed: Nov 2010

  35. Ohta, A., Tsuji, K.: On some analysis properties of colored Petri net using underlying net. In: MWSCAS’04, vol. 3, pp. 395–398. IEEE CS (2004)

  36. Petter, A., Behring, A., Mühlhäuser, M.: Solving constraints in model transformations. In: ICMT’09. LNCS, vol. 5563, pp. 132–147. Springer, Berlin (2009)

  37. QVT1.1. http://www.omg.org/spec/QVT/. Accessed May 2012, 2011

  38. Romeikat, R., Roser, S., Müllender, P., Bauer, B.: Translation of QVT relations into QVT operational mappings. In: ICMT’08. LNCS, vol. 5063, pp. 137–151. Springer, Berlin (2008)

  39. Schürr, A.: Specification of graph translators with triple graph grammars. In: WG’94. LNCS, vol. 903, pp. 151–163. Springer, Berlin (1994)

  40. SmartQVT. http://sourceforge.net/projects/smartqvt/. Accessed June 2010

  41. Stahl, T., Volter, M.: Model-Driven Software Development: Technology, Engineering, Management. Wiley, New York (2006)

  42. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2nd edn. Addison-Wesley Professional (2008). http://www.eclipse.org/modeling/emf/. Accessed: Nov 2010

  43. Stevens, P.: A simple game-theoretic approach to checkonly QVT relations. Softw. Syst. Model (2012, in press)

  44. van Amstel, M., Bosems, S., Kurtev, I., Pires, L.F.: Performance in model transformations: experiments with ATL and QVT. In: ICMT’11. LNCS, vol. 6707, pp. 198–212. Springer, Berlin (2011)

  45. Wimmer, M., Kappel, G., Schönböck, J., Kusel, A., Retschitzegger, W., Schwinger, W.: A Petri net based debugging environment for QVT relations. In: ASE’09, pp. 3–14. IEEE CS (2009). http://www.modeltransformation.net/. Accessed Nov 2010

Download references

Acknowledgments

This work was funded by the Spanish Ministry of Economy and Competitivity (project “Go Lite” TIN2011-24139) and the R&D programme of the Madrid Region (project “e-Madrid” S2009/TIC-1650).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Esther Guerra.

Appendix

Appendix

1.1 A.1 Compilation of meta-models into colour sets

Listing 4 shows the procedure to compile meta-models with and without inheritance into colour sets. We assume that we can access the name of meta-models, classes and associations through the dot notation “.\(\langle \)name\(\rangle \)”, the name of the variable associated to the meta-model \(M\) in a QVT-R specification \(S\) through “M.\(\langle \)id\(\rangle \)”, the ancestors of a class through the dot notation “.\(\langle \)anc\(\rangle \)”, and assume binary associations with named roles at both ends. If a role is missing, we take as role the name of the class in the association end. We assume that the two roles of an association have different names.

figure a4

In the compilation, step 1 creates a page for the meta-model, step 2 creates a record and a place of the record sort for each class, and step 3 does the same for each association. Records associated to classes include an object identifier and one field for each attribute in the class or its ancestors. Records derived from associations store the identifier of the objects in each association end. The name of the records for the associations is given by the concatenation of names of the source and target types and roles.

1.2 A.2 Compilation of relations: graphical pattern

The compilation of the relations in a QVT-R specification consists of two steps: the creation of colour sets and places to store the execution traces, and the generation of transitions modelling the relations. Listing 5 shows the pseudocode for the first step assuming relations without when and where clauses, which are handled in Appendix A.3. We assume that we can access the variable name of an object in a relation by using the dot notation “o.\(\langle \)id\(\rangle \)”, and all objects in both domains of a relation \(r\) through “r.\(\langle \)domains\(\rangle \)”. According to the standard, the traces store the identifier of all objects involved in a relation.

figure a5

Listing 6 shows the translation of each relation into a CPN transition. The handling of identifiers for the created objects is managed through the use of a global counter called \(ID\), which gets incremented each time the transitions fire (step 8). In particular, firing a transition increments the counter as many units as objects the relation creates. Then, if a relation creates several objects \(\text{ o}_i\), their identifier is assigned the value \(ID-i\).

figure a6

1.3 A.3 Compilation of relations: when and where

In order to handle the when and where sections of a relation, we have to perform the following modifications to Listing 6:

  • For each relation \(r\) invoked in the where clause, we create an additional place and colour set called “Param”+r. \(\langle \)name\(\rangle \) to store the identifier of the objects used in the invocation. The calling relation is connected to the place with a write arc. The called relation \(r\) is connected to the place with a self-loop arc.

  • For each relation \(r\) inspected in the when clause, we add a self-loop arc from the place “Trace”+r.\(\langle \)name\(\rangle \) of the inspected relation to the transition of the actual relation.

  • If a relation is invoked from a where clause from which it receives certain parameter objects, then the arcs that write tokens to the places for these objects are not created (i.e. step 3.1.5 in Listing 6 is not performed for the received objects).

  • If a relation checks certain object in the when clause, then the arc that writes tokens to the place for this object is not generated (i.e. step 3.1.5 in Listing 6 is not performed for the checked objects).

In our current compilation, we restrict to when and where sections that contain sequences of calls to other relations, but not arbitrary formulae involving relations.

1.4 A.4 Model matching scenario

The procedure for generating transitions in the model matching scenario is similar to Listing 6, but both domains are check-only, and hence places of both domains are connected to the transition with self-loop arcs. Moreover, we do not make use of the global counter \(ID\), so that transitions are not added any action (i.e. step 8 is not performed) and arcs always use the variables used in the relation (i.e. in steps 3.1.5 and 6, the object identifiers are read from the corresponding variable).

Rights and permissions

Reprints and permissions

About this article

Cite this article

Guerra, E., de Lara, J. Colouring: execution, debug and analysis of QVT-relations transformations through coloured Petri nets. Softw Syst Model 13, 1447–1472 (2014). https://doi.org/10.1007/s10270-012-0292-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-012-0292-6

Keywords

Navigation