Meta-model Pruning Sagar Sen, Naouel Moha, Benoit Baudry, Jean-Marc Jézéquel Equipe TRISKELL, INRIA Rennes Bretagne-Atlantique October 3-9, MODELS 2009 Denver Colorado 1
Outline Where do large meta-models come from? Why a need to extract subsets of large meta-models ? How to prune a meta-model to obtain subsets called effective meta-models ? What are the type properties of effective meta-models ? Illustrative Case Study : French Space Agency Transformation Input Meta-model Conclusion 2
Where do large me Where do large meta-models come fr ta-models come from? om? A widely used large meta-model is that of a General Purpose Modelling Language such as the UML 3
Wh Why is the UML me y is the UML meta-model large? (1) ta-model large? (1) Member Space About 389 official participating stakeholders… Contribute to / use… 4
Wh Why is the UML me y is the UML meta-model large? (2) ta-model large? (2) Tool Space Editors: Topcased, StarUML, ArgoUML… Code generators: Acceleo, BOUML, Eclipse.. Transformation Tech: Kermeta Conform to & Use EMF ATL … 5
UML is gr UML is growing t wing to address domain-specif o address domain-specific ic needs… needs… Service Modelling Real-time Embedded Systems UML Testing Profile Distributed Objects Domain specific needs have led to the extension of UML to UML Profiles… 6
Com Comple plexity of UML xity of UML Too large and Very large meta-model spec. : complex to 246 Classes, 583 properties learn and adopt… Source: Wikipedia on UML Infact, Not conducive to application many tools need and use of formal methods… only a small subset of UML ! 7
Outline Where do large meta-models come from? Why a need to extract subsets of large meta- models ? How to prune a meta-model to obtain subsets called effective meta-models ? What are the type properties of effective meta-models ? Illustrative Case Study : French Space Agency Transformation Input Meta-model Conclusion 8
Scenario 1: Why need subsets? UML in Software Process Depl. Impl. Test Design Analysis Use Case Model Model Model Model Model Model Rational Unified Process 9
Scenario 1: RUP models via UML Depl. Impl. Test Design Analysis Use Case Model Model Model Model Model Model Use Case Diagram Class Diagram Activity Diagram Component Diagram Statechart Diagram Sequence Diagram Collaboration Diagram UML Diagrams 10
Scenario 1: RUP models via UML Depl. Impl. Test Design Analysis Use Case Model Model Model Model Model Model Use Case Diagram Class Diagram Activity Diagram Component Diagram Statechart Diagram Sequence Diagram Collaboration Diagram UML Diagrams 11
Scenario 2: Why need subsets? Chain of Model Transformations Are outputs of MT1 valid Large Meta-model inputs for MT2? Eg: UML Do the models use the same concepts? We need to compare subsets first. output domain input domain conforms to conforms to MT1 MT2 12
Scenario 3 Existence of hand-made subsets of UML Google search : “UML subset“ You will find at least 1,450 hits (done on Sept. 17,2009) screaming out the use of UML subsets… Executable UML UML subset for FPGA ICONIX Process: A Core UML subset UML subset for Model-based Testing Model checking for executable UML subset and many more… 13
Outline Where do large meta-models come from? Why extract subsets of large meta-models ? How to prune a meta-model to obtain subsets called effective meta-models ? What are the type properties of effective meta-models ? Illustrative Case Study : French Space Agency Transformation Input Meta-model Conclusion 14
Prune based on required concepts INPUT Meta-model OUTPUT Pruner Effective 1. Large Meta-model Meta-model MM MM e 2. Initial Required Types (Classes, Enumerations, Primitives) Where does this come from? T initial Static Analysis of a Model Transformation 3. Initial Required Properties or P initial Manually Specified 15
Pruning controlled by options OPTIONS INPUT Meta-model OUTPUT Pruner Effective 1. Large Meta-model Meta-model MM MM e 2. Initial Required Types (Classes, Enumerations, Primitives) T initial 3. Initial Required Properties P initial 16
Meta-model Pruning Internals Meta-model Pruner So, what is pruned? 17
Meta-model Pruning 1. Rules to find set of required types (classes, enumerations, primitives) 2. Rules to find set of required properties 3. Optional rules to add additional types/properties 4. Repeat 1,2,3 until rules cannot be applied anymore Lets look at some of these rules… 18
Meta-model Pruning Couple of rules to conserve types… 19
Finding Required Types Rule: Conser ule: Conserve Initial R e Initial Req equired Class uired Class Class i Conserve T req T req + Class i , if Class i in T initial 20
Finding Required Types Rule: Conser ule: Conserve All Super Classes of e All Super Classes of Req equired Class uired Class SuperClass d SuperClass a SuperClass b SuperClass c Conserve Class i T req T req + SuperClass i , if Class i is derived from SuperClass i 21
Meta-model Pruning Couple of rules to conserve properties… 22
Finding Required Properties Rule: Conser ule: Conserve Pr e Proper operty of R ty of Req equired T uired Type ype Class i Conserve opposite property[0, b] Class j if property.type = Class j in T req P req property P req + P req opposite P req + 23
Finding Required Properties Rule: Conser ule: Conserve Multiplicity Pr e Multiplicity Proper operty ty Class i Conserve attribute: PrimitiveType[>0, a ] opposite reference [>0, b] Class j P req property if property.lower > 0 and Class i in T req , P req + P req opposite P req T req T req + Class j + 24
Meta-model Pruning A rule to illustrate options… 25
Optional R Optional Rule: Conser ule: Conserve Zer e Zero Multiplicity o Multiplicity Pr Proper operty ty Class i Conserve opposite property[0, b] Need not be Class j Required Class P req property if property.lower == 0 and P req + property.type.isInstanceOf(Class), P req opposite P req + 26
Meta-model Pruning Apply rules (about 16) until no rule can be applied anymore… 27
Meta-model Pruning Remove types and properties not conserved… 28
Meta-model Pruning Implementation Meta-model Pruner Implemented in Kermeta (http://www.kermeta.org) Conforms to the EMF Ecore file format for input Download at: http://www.irisa.fr/triskell/softwares-fr/protos/metamodelpruner/ 29
Outline Where do large meta-models come from? Why extract subsets of large meta-models ? How to prune a meta-model to obtain subsets called effective meta-models ? What are the type properties of an effective meta- model ? Illustrative Case Study : French Space Agency Transformation Input Meta-model Conclusion 30
Model Typing Does the effective meta-model MM e match the large meta-model MM ? aC2 0..1 aCTwo 0..1 matches ? Meta-model MM e Meta-model MM Meta-model MM e matches another meta-model MM iff for each class C in MM, there is one and only one corresponding class C’ in MM e Set of rules guarantees a subtype relationship btw the two MMs [Steel 07, SoSyM] If transformation T works for MM, and if MM e is a model subtype of MM, then T works with MM e
What are properties of an effective meta-model? We verify that an effective meta-model is super-type of the large meta-model using model typing. This implies all transformations written for the effective meta-model are also valid for the large meta-model All instances (models) of the effective meta-model are also instances of the large meta-model. The instances are compatible with the large meta-model because we preserve concept names. The effective meta-model can live its own life much like a DSML! 32
Outline Where do large meta-models come from? Why extract subsets of large meta-models ? How to prune a meta-model to obtain subsets called effective meta-models ? What are the type properties of an effective meta-model ? Illustrative Case Study : French Space Agency Transformation Input Meta-model Conclusion 33
French Space Agency Transformation Case Study Transformation for generation embedded system code from a subset of UML Activity Diagrams Transformation analysis : Gives a set of required classes and properties in the UML Meta-model pruning : Gives an output effective meta-model which is a super type and subset of UML. 34
Set of Required Classes in UML (Total = 10) ActivityEdge ActivityNode ControlFlow OpaqueExpression DecisionNode InitialNode ReadStructuralFeatureAction AcceptEventAction ActivityFinalNode CallOperationAction 35
Effective UML for Case Study Operation operation 1..1 CallOperationAction Using Conserve Property Multiplicity Rule 36
Effective UML for Case Study Using Conserve All Super Classes of Required Class 37
Recommend
More recommend