Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sound, yet Flexible, Modeling: A Language Engineering Point Of View

352 views

Published on

Domain-Specific Languages (DSLs) are increasingly used by domain experts to handle various concerns in systems and software development. To support this trend, the Model-Driven Engineering community has developed advanced techniques for designing new DSLs. However, the widespread use of independently developed, and constantly evolving DSLs is hampered by the rigidity imposed to the language users by the DSLs and their tooling, e.g., for manipulating a model through various similar DSLs or successive versions of a given DSL.
In this talk, I discuss a sound yet flexible model type system to support various scenarios of flexible modeling. I review different existing approaches, and highlight how they provide flexibility to language users. Finally, I conclude with a long term initiative for a full-fledged unifying approach for language reuse, aka. a Concern-Oriented Language Development (COLD), and the expected flexibility for language users.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Sound, yet Flexible, Modeling: A Language Engineering Point Of View

  1. 1. KEYNOTE @ FLEXMDE 2017, AUSTIN, TX, USA. SOUND YET FLEXIBLE MODELING A LANGUAGE ENGINEERING POINT OF VIEW BENOIT COMBEMALE PROFESSOR, UNIV. TOULOUSE, FRANCE HTTP://COMBEMALE.FR BENOIT.COMBEMALE@IRIT.FR @BCOMBEMALE
  2. 2. Who Care About Flexible Modeling? Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Software intensive systems ▸ Multiple concerns & stakeholders ▸ Multi-engineering approach ▸ Software as an integration layer
  3. 3. Who Care About Flexible Modeling? Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Software intensive systems ▸ Recurring paradigms ▸ Evolving DSLs ▸ Collaborative modeling
  4. 4. FROM A LANGUAGE ENGINEER POINT OF VIEW
  5. 5. All different, but some are similar…
  6. 6. What it means from a language engineer point of view? Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 UML vs. Classical vs. Rhapsody Statecharts: Not All Models are Created Equal Michelle L. Crane, Jürgen Dingel In Software & Systems Modeling (SoSyM), 2007
  7. 7. What it means from a language engineer point of view? Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  8. 8. Language (and tool support) Interoperability ▸ Foster model sharing and collaboration ▸ Manipulate models in different environments ▸ Reuse tools and services Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  9. 9. In practice… Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  10. 10. GRAMMARWARE Parse… MODELWARE Conform To…
  11. 11. Limits of the conformance relation ▸ In MDE, a metamodel is the cornerstone artifact defining a DSL ▸ The conformance relation states ▸ Which models are valid instances of a given DSL ▸ How these models must be manipulated wrt. this DSL ▸ Theoretical limitations : ~ structural nominal typing ▸ Conformance is based on instantiation ▸ Conformance is nominal ▸ A model conforms to one and only one metamodel Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  12. 12. Limits of the conformance relation ▸ Analyze UML models publicly available on Github ▸ Conforming to the UML implementation of Eclipse ▸ 1651 models – UML2.2 to UML2.5 ▸ Force to bypass the conformance check ▸ Key findings ▸ 7% of the models are valid wrt. only one version of UML ▸ 83% of the models are valid wrt. every version of UML Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Safe model polymorphism for flexible modeling Thomas Degueule, Benoît Combemale, Arnaud Blouin, Olivier Barais, Jean-Marc Jézéquel In Computer Languages, Systems & Structures (COMLAN), 49: 176-195 , 2017
  13. 13. Towards a flexible typing relationship ▸ Conformance: ▸ Used for creating models ▸ Bounds to a language implementation (i.e., metamodel) ▸ Typing: ▸ Used to reason over models ▸ Relies on a language interface (which can possibly abstract a family of similar languages) Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 On model typing Jim Steel, Jean-Marc Jézéquel In Software and System Modeling (SoSyM), 2007
  14. 14. On Language Interface ▸ A language interface is a contract that exhibits the relevant information for a given purpose (i.e., to support specific operators or relations) Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Towards Language-Oriented Modeling Benoit Combemale, 2015 http://people.irisa.fr/Benoit.Combemale/hdr
  15. 15. On Language Interface ▸ Abstract over the intrinsic complexity of language implementations ▸ Expose meaningful information ▸ Concerning an aspect of a language (e.g. abstract syntax) ▸ For a given purpose (e.g. composition, coordination, analysis) ▸ In an appropriate formalism (e.g. a metamodel, a control-flow graph) ▸ Provide a reasoning layer atop a language implementation Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 xDSML2 xDSML1 structural/ axiomatic behavioral xDSML3 subtyping relation coordination pattern
  16. 16. TOWARDS A MODEL TYPE SYSTEM FOR MODEL POLYMORPHISM
  17. 17. Static Dynamic Structural Behavioral Dimensions of Model Typing Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 [Guy et al.] [Sun et al.] [Steel et al.] [Degueule et al.] [de Lara et al.] [de Lara et al.] Many more dimensions for model typing (e.g., [de Lara et al., TOSEM2017]), but no consensus on a proper classification of them…
  18. 18. Polymorphic language reuse with model typing Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 ▸ Conformance relation ensures safe manipulation regardless of context ▸ But it hinders flexibility
  19. 19. Polymorphic language reuse with model typing ▸ Proposition: ▸ Model Types as structural interfaces atop language implementations ▸ Flexible subtyping relations to support model polymorphism Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 On model typing Jim Steel, Jean-Marc Jézéquel In Software and System Modeling (SoSyM), 2007 On model subtyping Clement Guy, Benoît Combemale, Steven Derrien, Jim Steel, Jean-Marc Jézéquel In EU Conf. on Modelling Foundations and Applications (ECMFA), 2012 Using Model Types to Support Contract-Aware Model Substitutability Wuliang Sun, Benoît Combemale, Steven Derrien, Robert B. France In EU Conf. on Modelling Foundations and Applications (ECMFA), 2013
  20. 20. Model typing in Kermeta 1, 2, 3! Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Model types as structural interfaces atop language implementations @Aspect(className = FSM) class ExecutableFSM { State current def void execute() { _self.states.forEach[…] } } … <<implements>> § Manually written § Inferred from a language § Inferred from a footprint § Static (metamodel level) or dynamic (model level)
  21. 21. Model typing in Kermeta 1, 2, 3! Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 ▸ States whether models typed by a given MT can be substituted to models typed by another MT ▸ Different subtyping relations [Guy et al.] ▸ Total isomorphic ▸ Partial isomorphic ▸ Total non-isomorphic ▸ Partial non-isomorphic ▸ Up to behavioral substitutability [Sun et al.] ▸ The choice of a subtyping relation vary with particular needs
  22. 22. Model typing in Melange! ▸ Model types defined explicitly or inferred from implementations ▸ Implementation relations defined explicitly or automatically inferred ▸ Based on structural typing ▸ Using the total isomorphic subtyping relation ▸ Simple renaming operator to align structurally dissimilar languages Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 // Explicit model type definition // e.g. a footprint that captures // the contract of a transformation modeltype FsmMT { syntax ‘FsmMT.ecore’ } // Language definition language GuardFsm { syntax ‘GuardFsm.ecore’ with ExecutableFsm with ExecutableState with ExecutableTransition exactType GuardFsmMT } // Explicit implementation language OtherFsm implements FsmMT { […] renaming ‘otherfsm’ to ‘fsm’ } transformation p-print(FsmMT m) { val root = m.contents.head m.states.forEach[s | print(s)] }
  23. 23. Context Matters! Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Reuse is not enough! Context matters! Imported / inherited DSMLs may not fit exactly domain-specific requirements èFinely tune with customization facilities
  24. 24. Melange: Language algebra with substitutability ▸ Language extension with language inheritance ▸ Language unification with language merging ▸ Language restriction with language slicing ▸ Syntax merging and semantics’ weaving as fine-grained customization mechanisms Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Melange: a meta-language for modular and reusable development of DSLs Thomas Degueule, Benoît Combemale, Arnaud Blouin, Olivier Barais, Jean-Marc Jézéquel In Int. Conf. on Software Language Engineering (SLE), 2015
  25. 25. Melange Resource: Seamless Model Polymorphism Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Safe model polymorphism for flexible modeling Thomas Degueule, Benoît Combemale, Arnaud Blouin, Olivier Barais, Jean-Marc Jézéquel In Computer Languages, Systems & Structures (COMLAN), 49: 176-195 , 2017 "How to fit type group semantics, structural typing, and family polymorphism in a language (Java) and framework (EMF) that do not support any of them"
  26. 26. Experiment: a Family of FSM Languages Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 c module FlattenFsm; create OUT : FlatFsm from IN : CompositeFsmMT; -- Creates a new FlatFsm rule SM2SM { from sm1 : CompositeFsmMT!StateMachine to sm2 : FlatFsm!StateMachine } -- Initial states of composite -- states become regular states rule Initial2State { from is1 : CompositeFsmMT!InitialState (not is1.parentState.oclIsUndefined()) to is2 : FlatFsm!State( stateMachine <- is1.stateMachine, name <- is1.name) } -- Resolves a transition originating from -- a composite state rule T2TB { from t1: CompositeFsmMT!Transition, src : CompositeFsmMT!CompositeState, trg : CompositeFsmMT!State, c : CompositeFsmMT!State ( t1.source = src and t1.target = trg and c.parentState = src and not trg.oclIsTypeOf( CompositeFsmMT!CompositeState)) to t2 : FlatFsm!Transition ( name <- t1.name, stateMachine <- t1.stateMachine, source <- c, target <- trg ) } c modeltype FsmMT uses “http://fsmmt/”; modeltype Fsm uses “http://fsm/”; transformation dummyInvert( in inFsm : FsmMT, out outFsm : Fsm); main() { inFsm.rootObjects()[FsmMT::FSM] -> map mapFSM(); } mapping FsmMT::FSM::mapFSM():Fsm::FSM { ownedState := self.ownedState -> map mapState(); initialState := self.finalState -> first().map mapState(); finalState := self.initialState.map mapState(); } mapping FsmMT::State::mapState() : Fsm::State { name := self.name; outgoingTransition := self.incomingTransition -> map mapTransition(); } mapping FsmMT::Transition::mapTransition() : Fsm::Transition { input := self.input; output := self.output; target := self.source.map mapState(); } TransfoFsm.qvto c // Delegate the execution of the state // machine "fsm" to the "execute"method // of its operational semantics. public void execute( StateMachine fsm, String input) { // Dynamically dispatched on the actual // language implementation of execute() root.execute(input); } List<String> models = new ArrayList<>(); models.add( "melange:/m1.flat?mt=FlatFsmRtcMT"); models.add( "melange:/m2.timed?mt=FlatFsmRtcMT"); models.add( "melange:/m3.hier?mt=FlatFsmRtcMT"); models.add( "melange:/m4.timedhier?mt=FlatFsmRtcMT"); ResourceSet rs = new ResourceSetImpl(); // Load the model pointed by the given // URI, retrieve its root StateMachine, // and execute it for (String uri : models) { Resource res = rs.getResource(uri,true); StateMachine root = (StateMachine) res.getContents().get(0); execute(res, "{x;y;z;o;p;q}"); } ExecuteFsm.java
  27. 27. Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Syntax & Semantics Overview Inheritance, implementation, and subtyping relations Interfaces description Currently registered languages & interfaces
  28. 28. Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Syntax & Semantics Overview Inheritance, implementation, and subtyping relations Interfaces description Currently registered languages & interfaces Built atop Eclipse, EPL-1.0 license Seamlessly integrated with the EMF ecosystem ~30k Xtend LoC / 500k Java LoC 10 contributors, ~2000 commits http://melange-lang.org
  29. 29. Parametric language reuse with generic metamodeling ▸ Inspired from generic programming: ▸ Concept: additional typing to implement MT independently of metamodels ▸ Structural typing ▸ Bind to metamodels through explicit, possibly flexible, relationships ▸ Template: use concept as requirement for their generic parameters, and are applied to model/metamodel ▸ Mixin layers: define functional layers for metamodel extensibility ▸ Implemented in MetaDepth Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Juan de Lara, Esther Guerra Generic Meta-modelling with Concepts, Templates and Mixin Layers In Int. Conf. on Model Driven Engineering Languages and Systems (MoDELS), 2010
  30. 30. A-posteriori Typing ▸ Model retyping decouple object creation from classification ▸ Model retyping is ▸ Multiple classifiers, ▸ partial, ▸ either static (metamodel level) or dynamic (model level) ▸ Implemented in MetaDepth Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 A Posteriori Typing for Model-Driven Engineering: Concepts, Analysis, and Applications Juan de Lara, Esther Guerra In ACM Trans. Softw. Eng. Methodol. (TOSEM), 25:4, 2017
  31. 31. Other approaches (among others) ▸ Arnaud Cuccuru, Chokri Mraidha, François Terrier, Sébastien Gérard: Templatable Metamodels for Semantic Variation Points. ECMDA-FA 2007 ▸ Antonio Vallecillo, Martin Gogolla: Typing Model Transformations Using Tracts. ICMT 2012 ▸ Andrés Vignaga, Frédéric Jouault, María Cecilia Bastarrica, Hugo Brunelière: Typing artifacts in megamodeling. Software and System Modeling (SoSyM), 2013 ▸ Bernard Carré, Gilles Vanwormhoudt, Olivier Caron: From subsets of model elements to submodels - A characterization of submodels and their properties. Software and System Modeling (SoSyM), 2015 ▸ Louis M. Rose, Esther Guerra, Juan de Lara, Anne Etien, Dimitris S. Kolovos, Richard F. Paige: Genericity for model management operations. Software and System Modeling (SoSyM), 2013 ▸ Juan de Lara, Juri Di Rocco, Davide Di Ruscio, Esther Guerra, Ludovico Iovino, Alfonso Pierantonio, Jesús Sánchez Cuadrado: Reusing Model Transformations Through Typing Requirements Models. FASE 2017 ▸ Etc. Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  32. 32. TOWARDS CONCERN-ORIENTED LANGUAGE DEVELOPMENT
  33. 33. Concern-Oriented Development ▸ Concern = ▸ Unit of reuse ▸ Domain-specific: ▸ Encapsulates realization artifacts related to a specific feature or development issue ▸ Generic: ▸ Includes and integrates all relevant (functional) variations and realizations of solutions ▸ Crosscutting ▸ Long-lived Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Concern-Oriented Software Design Alam O., Kienzle J., Mussbacher G. In Int. Conf. on Model Driven Engineering Languages and Systems (MoDELS), 2013 Concern Customization Use Req Model Test Model Design Model <<trace>> <<trace>> Variability … <<trace>>
  34. 34. VCU: The Three Dimensions of Reuse • Variability: select/configure what you want to reuse • Customization: adapt it to your own context • Usage: use it! • VCU provides a powerful unified framework enhancing reuse, and cross- fertilizing various disciplines separately investigated (MDE, SPL, CBSE, OO…) Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Usage (U)Variation (V) Customization (C) VCU: The Three Dimensions of Reuse J. Kienzle, G. Mussbacher, O. Alam, M. Schöttle, N. Belloir, P. Collet, B. Combemale, J. DeAntoni, J. Klein, and B. Rumpe In Int. Conf. on Software Reuse (ICSR), 2016
  35. 35. Concern-Oriented Development: CORE/COLD ▸ CORE at the model-level ▸ COLD at the language-level Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Metalanguage Language Model COLD CORE
  36. 36. Concern-Oriented Language Development ▸ Research questions: ▸ V: what means a goal model? how to breakdown a DSL? ▸ C: which customization operators? ▸ U: how to get a full-fledged language protocol? Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017 Manuel Leduc’s PhD, Univ. Rennes 1, France xDSML Customization Use Abstract Syntax (AS) Concrete Syntax (CS) Semantics Domain (SD) Mac Mas VariabilityV&V tools editors generators
  37. 37. CONCLUSION
  38. 38. Take Away Messages ▸ Flexibility in MDE is key for further adoption ▸ the FlexMDE community is a great opportunity! ▸ This talk takes voluntarily an SLE point of view, others are relevant too! ▸ co-evolution, sketching, globalization, agile modeling… ▸ Proposal: a sound, yet flexible, model type system for MDE ▸ Typing relationship based on language interfaces ▸ Subtyping relationships with possible isomorphic adaptions ▸ Language algebra with substitutability (merge, slice, inherit…) ▸ Ongoing work ▸ concern-oriented language development (COLD) ▸ unifying theory for model and language reuse Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017
  39. 39. Hack your own languages? Join us in the MDE/SLE group of the CNRS IRIT lab, in a freshly rebuilt campus of the warm city of Toulouse! Open Positions for PhD and Postdoc BENOIT COMBEMALE PROFESSOR, UNIV. TOULOUSE, FRANCE HTTP://COMBEMALE.FR BENOIT.COMBEMALE@IRIT.FR @BCOMBEMALE
  40. 40. Sound Yet Flexible Modeling: A Language Engineering Point of View Abstract. Domain-Specific Languages (DSLs) are increasingly used by domain experts to handle various concerns in systems and software development. To support this trend, the Model-Driven Engineering community has developed advanced techniques for designing new DSLs. However, the widespread use of independently developed, and constantly evolving DSLs is hampered by the rigidity imposed to the language users by the DSLs and their tooling, e.g., for manipulating a model through various similar DSLs or successive versions of a given DSL. In this talk, I discuss a sound yet flexible model type system to support various scenarios of flexible modeling. I review different existing approaches, and highlight how they provide flexibility to language users. Finally, I conclude with a long term initiative for a full-fledged unifying approach for language reuse, aka. a Concern-Oriented Language Development (COLD), and the expected flexibility for language users. Sound yet Flexible Modeling Benoit Combemale @ FlexMDE, Sep. 2017

×