Skip to main content

Model Transformation with Immutable Data

  • Conference paper
  • First Online:
Theory and Practice of Model Transformations (ICMT 2016)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9765))

Abstract

Mainstream model transformation tools operate on graph structured models which are described by class-based meta-models. In the traditional grammarware space, transformation tools consume and produce tree structured terms, which are described by some kind of algebraic datatype or grammar. In this paper we explore a functional style of model transformation using Rascal, a meta-programming language, that seamlessly integrates functional programming, flexible static typing, and syntax-based analysis and transformation. We represent meta-models as algebraic data types (ADTs), and models as immutable values conforming to those data types. Our main contributions are (a) REFS a simple encoding and API, to deal with cross references among model elements that are represented as ADTs; (b) a mapping from models to ADTs augmented with REFS; (c) evaluation of our encoding by implementing various well-known model transformations on state machines, meta-models, and activity diagrams. Our approach can be seen as a first step towards making existing techniques and tools from the modelware domain available for reuse within Rascal, and opening up Rascal’s transformation capabilities for use in model driven engineering scenarios.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    See http://www.eclipse.org/modeling/emf/.

  2. 2.

    See http://www.eclipse.org/ecoretools/.

  3. 3.

    See https://www.eclipse.org/emf/compare/.

  4. 4.

    See http://www.eclipse.org/gmf-tooling/.

  5. 5.

    See http://www.rascal-mpl.org.

  6. 6.

    Recall that an Abstract Data Type is characterized by a set of values (created using constructor functions) and a set of functions that define operations on those values.

  7. 7.

    Also known as named parameters or keyword arguments in other languages.

  8. 8.

    All visualizations are created automatically: for each meta-model we specify a transformation to a standard graph model. The latter is then visualized using Rascal ’s visualization library.

  9. 9.

    The concept of reset events is inspired by Fowler’s example state machine DSL [5].

  10. 10.

    The type parameter of is technically not needed, but allows declarations of s document what they are referring to.

  11. 11.

    Source lines of code, not counting empty lines or comments.

  12. 12.

    See http://www.eclipse.org/atl/atlTransformations/.

  13. 13.

    Can be found on Github at http://bit.ly/1puz0tC.

  14. 14.

    An optimization technique that caches the result of expensive computations.

References

  1. Chlipala, A.: Parametric higher-order abstract syntax for mechanized semantics. In: ICFP 2008, pp. 143–156 (2008)

    Google Scholar 

  2. Claessen, K., Sands, D.: Observable sharing for functional circuit description. In: Thiagarajan, P.S., Yap, R.H.C. (eds.) ASIAN 1999. LNCS, vol. 1742, pp. 62–73. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  3. Czarnecki, K., Helsen, S.: Feature-based survey of model transformation approaches. IBM Syst. J. 45(3), 621–646 (2006)

    Article  Google Scholar 

  4. Erwig, M.: Inductive graphs and functional graph algorithms. J. Funct. Program. 11(05), 467–492 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  5. Fowler, M.: Domain Specific Languages, 1st edn. Addison-Wesley Professional, Boston (2010)

    Google Scholar 

  6. George, L., Wider, A., Scheidgen, M.: Type-safe model transformation languages as internal DSLs in scala. In: Hu, Z., de Lara, J. (eds.) ICMT 2012. LNCS, vol. 7307, pp. 160–175. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  7. Gill, A.: Type-safe observable sharing in Haskell. In: Haskell 2009, pp. 117–128. ACM (2009)

    Google Scholar 

  8. Goldschmidt, T., Becker, S., Uhl, A.: Classification of concrete textual syntax mapping approaches. In: Schieferdecker, I., Hartman, A. (eds.) ECMDA-FA 2008. LNCS, vol. 5095, pp. 169–184. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  9. Horn, T.: Model querying with FunnyQT - (extended abstract). In: ICMT 2013, pp. 56–57 (2013)

    Google Scholar 

  10. Inostroza, P., van der Storm, T., Erdweg, S.: Tracing program transformations with string origins. In: Di Ruscio, D., Varró, D. (eds.) ICMT 2014. LNCS, vol. 8568, pp. 154–169. Springer, Heidelberg (2014)

    Google Scholar 

  11. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: a model transformation tool. Sci. Comput. Program. 72(1), 31–39 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  12. Jouault, F., Bézivin, J.: KM3: a DSL for metamodel specification. In: Gorrieri, R., Wehrheim, H. (eds.) FMOODS 2006. LNCS, vol. 4037, pp. 171–185. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  13. Klint, P., Lämmel, R., Verhoef, C.: Toward an engineering discipline for grammarware. ACM Trans. Softw. Eng. Methodol. 14(3), 331–380 (2005)

    Article  Google Scholar 

  14. Klint, P., van der Storm, T., Vinju, J.: EASY meta-programming with Rascal. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) Generative and Transformational Techniques in Software Engineering III. LNCS, vol. 6491, pp. 222–289. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  15. Kolovos, D.S., Paige, R.F., Polack, F.A.C.: The Epsilon transformation language. In: Vallecillo, A., Gray, J., Pierantonio, A. (eds.) ICMT 2008. LNCS, vol. 5063, pp. 46–60. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  16. Mayerhofer, T., Wimmer, M.: The TTC 2015 model execution case. In: TTC 2015, pp. 2–18 (2015)

    Google Scholar 

  17. Mens, T., Van Gorp, P.: A taxonomy of model transformation. Electron. Notes Theor. Comput. Sci. 152, 125–142 (2006)

    Article  Google Scholar 

  18. Oliveira, B.C., Cook, W.R.: Functional programming with structured graphs. ICFP 47(9), 77–88 (2012)

    MATH  Google Scholar 

  19. Rose, L.M., Horn, T., Krikava, F. (eds.): TTC 2015, CEUR Workshop Proceedings, vol. 1524. CEUR-WS.org (2015)

    Google Scholar 

  20. Steinberg, D., Budinsky, F., Merks, E., Paternostro, M.: EMF: Eclipse Modeling Framework. Pearson Education, Upper Saddle River (2008)

    Google Scholar 

  21. Terese. Term Rewriting Systems. Cambridge Tracts in Theoretical Computer Science. Cambridge University Press (2003)

    Google Scholar 

  22. van der Storm, T., Cook, W.R., Loh, A.: The design and implementation of object grammars. Sci. Comput. Program. 96(P4), 460–487 (2014)

    Article  Google Scholar 

  23. Van Deursen, A., Klint, P., Tip, F.: Origin tracking. J. Symbol. Comput. 15(5), 523–545 (1993)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tijs van der Storm .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Klint, P., van der Storm, T. (2016). Model Transformation with Immutable Data. In: Van Gorp, P., Engels, G. (eds) Theory and Practice of Model Transformations. ICMT 2016. Lecture Notes in Computer Science(), vol 9765. Springer, Cham. https://doi.org/10.1007/978-3-319-42064-6_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-42064-6_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-42063-9

  • Online ISBN: 978-3-319-42064-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics