Rete Network Slicing for Model Queries

  • Zoltán UjhelyiEmail author
  • Gábor Bergmann
  • Dániel Varró
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9761)


Declarative model queries captured by graph patterns are frequently used in model driven engineering tools for the validation of well-formedness constraint or the calculation of various model metrics. However, their high level nature might make it hard to understand all corner cases of complex queries. When debugging erroneous patterns, a common task is to identify which conditions or constraints of a query caused some model elements to appear in the results. Slicing techniques in traditional programming environments are used to calculate similar dependencies between program statements. Here, we introduce a slicing approach for model queries based on Rete networks, a cache structure applied for the incremental evaluation of model queries. The proposed method reuses the structural information encoded in the Rete networks to calculate and present a trace of operations resulting in some model elements to appear in the result set. The approach is illustrated on a running example of validating well-formedness over UML state machine models using graph patterns as a model query formalism.


Program slicing Model queries Graph patterns 



The authors would like to thank István Ráth for the valuable discussions during the preparation of this paper.


  1. 1.
    Reder, A., Egyed, A.: Incremental consistency checking for complex design rules and larger model changes. In: France, R.B., Kazmeier, J., Breu, R., Atkinson, C. (eds.) MODELS 2012. LNCS, vol. 7590, pp. 202–218. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  2. 2.
    Bergmann, G., Horváth, A., Ráth, I., Varró, D., Balogh, A., Balogh, Z., Ökrös, A.: Incremental evaluation of model queries over EMF models. In: Rouquette, N., Haugen, Ø., Petriu, D.C. (eds.) MODELS 2010, Part I. LNCS, vol. 6394, pp. 76–90. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  3. 3.
    Ujhelyi, Z., Hegedüs, A., Bergmann, G., Horváth, A., Ráth, I., Varró, D.: EMF-IncQuery: an integrated development environment for live model queries. Sci. Comput. Program. 98, 80–99 (2015)CrossRefGoogle Scholar
  4. 4.
    Hegedüs, A., Horváth, A., Ráth, I., Starr, R., Varró, D.: Query-driven soft traceability links for models. Softw. Syst. Model. 1–24 (2014).
  5. 5.
    Bergmann, G., Ujhelyi, Z., Ráth, I., Varró, D.: A graph query language for EMF models. In: Cabot, J., Visser, E. (eds.) ICMT 2011. LNCS, vol. 6707, pp. 167–182. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  6. 6.
    Forgy, C.L.: Rete: A fast algorithm for the many pattern/many object pattern match problem. Artif. Intell. 19(1), 17–37 (1982)CrossRefGoogle Scholar
  7. 7.
    Varró, G., Friedl, K., Varró, D.: Adaptive graph pattern matching for model transformations using model-sensitive search plans. Electron. Notes Theoret. Comput. Sci. 152, 191–205 (2006). Proceedings of the International Workshop on Graph and Model Transformation (GraMoT 2005)CrossRefGoogle Scholar
  8. 8.
    Búr, M., Ujhelyi, Z., Horváth, Á., Varró, D.: Local search-based pattern matching features in EMF-IncQuery. In: Parisi-Presicce, F., Westfechtel, B. (eds.) ICGT 2015. LNCS, vol. 9151, pp. 275–282. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  9. 9.
    Ujhelyi, Z., Horváth, A., Varró, D.: Dynamic backward slicing of model transformations. In: Proceedings of the 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation. ICST 2012, Computer Society , pp. 1–10. IEEE, Washington, DC (2012)Google Scholar
  10. 10.
    Clarisó, R., Cabot, J., Guerra, E., de Lara, J.: Backwards reasoning for model transformations: method and applications. J. Syst. Softw. 116, 113–132 (2016).
  11. 11.
    Burgueno, L., Troya, J., Wimmer, M., Vallecillo, A.: Static fault localization in model transformations. IEEE Trans. Softw. Eng. 41(5), 490–506 (2015)CrossRefGoogle Scholar
  12. 12.
    Bergmann, G.: Incremental model queries in model-driven design. Ph.D. dissertation, Budapest University of Technology and Economics, Budapest (2013)Google Scholar
  13. 13.
    Gurevich, Y.: Sequential abstract-state machines capture sequential algorithms. ACM Trans. Comput. Logic 1(1), 77–111 (2000)MathSciNetCrossRefGoogle Scholar
  14. 14.
    The JBoss Project: Drools - The Business Logic integration Platform (2014).
  15. 15.
    Ghamarian, A., Jalali, A., Rensink, A.: Incremental pattern matching in graph-based state space exploration. Electron. Commun. EASST 32 (2011)Google Scholar
  16. 16.
    Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3(3), 121–189 (1995)Google Scholar
  17. 17.
    Xu, B., Qian, J., Zhang, X., Wu, Z., Chen, L.: A brief survey of program slicing. ACM SIGSOFT Softw. Eng. Notes 30(2), 1–36 (2005)CrossRefGoogle Scholar
  18. 18.
    Varró, D., Balogh, A.: The model transformation language of the VIATRA2 framework. Sci. Comput. Program. 68(3), 214–234 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Leuschel, M., Vidal, G.: Forward slicing by conjunctive partial deduction and argument filtering. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 61–76. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  20. 20.
    Weber Vasconcelos, W.: A flexible framework for dynamic and static slicing of logic programs. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, p. 259. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  21. 21.
    Szilágyi, G., Harmath, L., Gyimóthy, T.: The debug slicing of logic programs. Acta Cybernetica 15(2), 257–278 (2001)MathSciNetzbMATHGoogle Scholar
  22. 22.
    Szilágyi, G., Gyimóthy, T., Małuszyński, J.: Static and dynamic slicing of constraint logic programs. Autom. Softw. Eng. 9, 41–65 (2002)CrossRefzbMATHGoogle Scholar
  23. 23.
    Uzuncaova, E., Khurshid, S.: Kato: A program slicing tool for declarative specifications. In: 29th International Conference on Software Engineering, pp. 767–770. IEEE (2007)Google Scholar
  24. 24.
    Cui, Y., Widom, J., Wiener, J.L.: Tracing the lineage of view data in a warehousing environment. ACM Trans. Database Syst. 25(2), 179–227 (2000)CrossRefGoogle Scholar
  25. 25.
    Freire, J., Koop, D., Santos, E., Silva, C.T.: Provenance for computational tasks: a survey. Comput. Sci. Eng. 10(3), 11–21 (2008)CrossRefGoogle Scholar
  26. 26.
    Kagdi, H., Maletic, J.I., Sutton, A.: Context-free slicing of UML class models. In: 21st International Conference on Software Maintenance ICSM 2005, pp. 635–638. IEEE (2005)Google Scholar
  27. 27.
    Schaefer, I., Poetzsch-Heffter, A.: Slicing for model reduction in adaptive embedded systems development. In: International Workshop on Software Engineering for Adaptive and Self-managing Systems, pp. 25–32. ACM, NewYork (2008)Google Scholar
  28. 28.
    Shaikh, A., Clarisó, R., Wiil, U.K., Memon, N.: Verification-driven slicing of UML/OCL models. In: 25th IEEE/ACM International Conference on Automated Software Engineering, pp. 185–194. ACM (2010)Google Scholar
  29. 29.
    Lano, K., Kolahdouz-Rahimi, S.: Slicing of UML models using model transformations. In: Petriu, D.C., Rouquette, N., Haugen, Ø. (eds.) MODELS 2010, Part II. LNCS, vol. 6395, pp. 228–242. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  30. 30.
    Androutsopoulos, K., Clark, D., Harman, M., Li, Z., Tratt, L.: Control dependence for extended finite state machines. In: Chechik, M., Wirsing, M. (eds.) FASE 2009. LNCS, vol. 5503, pp. 216–230. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  31. 31.
    Korel, B., Singh, I., Tahat, L., Vaysburg, B.: Slicing of state-based models. In: IEEE International Conference on Software Maintenance, pp. 34–43 (2003)Google Scholar
  32. 32.
    Lallchandani, J.T., Mall, R.: A dynamic slicing technique for UML architectural models. IEEE Trans. Softw. Eng. 37(6), 737–771 (2011)CrossRefGoogle Scholar
  33. 33.
    Sen, S., Moha, N., Baudry, B., Jézéquel, J.-M.: Meta-model Pruning. In: Schürr, A., Selic, B. (eds.) MODELS 2009. LNCS, vol. 5795, pp. 32–46. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  34. 34.
    Bae, J.H., Lee, K., Chae, H.S.: Modularization of the UML metamodel using model slicing. In: 3rd International Conference on Information Technology: New Generations, IEEE, pp. 1253–1254 (2008)Google Scholar
  35. 35.
    Blouin, A., Combemale, B., Baudry, B., Beaudoux, O.: Modeling model slicers. In: Whittle, J., Clark, T., Kühne, T. (eds.) MODELS 2011. LNCS, vol. 6981, pp. 62–76. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  36. 36.
    Dhoolia, P., Mani, S., Sinha, V.S., Sinha, S.: Debugging model-transformation failures using dynamic tainting. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 26–51. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  37. 37.
    Mani, S., Sinha, V.S., Dhoolia, P., Sinha, S.: Automated support for repairing input-model faults. In: 25th IEEE/ACM International Conference on Automated Software Engineering, pp. 195–204. ACM (2010)Google Scholar
  38. 38.
    Schoenboeck, J., Kappel, G., Kusel, A., Retschitzegger, W., Schwinger, W., Wimmer, M.: Catch me if you can – debugging support for model transformations. In: Ghosh, S. (ed.) MODELS 2009. LNCS, vol. 6002, pp. 5–20. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  39. 39.
    Seifert, M., Katscher, S.: Debugging triple graph grammar-based model transformations. In: Fujaba Days, pp. 19–25 (2008)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Zoltán Ujhelyi
    • 2
    Email author
  • Gábor Bergmann
    • 1
  • Dániel Varró
    • 1
  1. 1.Department of Measurement and Information Systems, MTA-BME Lendület Research Group on Cyber-Physical SystemsBudapest University of Technology and EconomicsBudapestHungary
  2. 2.IncQuery Labs Ltd.BudapestHungary

Personalised recommendations