Generic Model-based Approaches for Software Reverse Engineering and Comprehen...
On the Semantics of Real-Time Domain Specific Modeling Languages
1. On the Semantics of Real-Time Domain Specific Modeling Languages Jose E. Rivera Advisors: Francisco Durán, Antonio Vallecillo PhDDefense Málaga, October 2010
2. Agenda Origins of Model-DrivenEngineering (MDE) MDE and itsmaintechnologies Definition of a DomainSpecificModelingLanguage (DSML) Ourapproach Specifying time-dependentbehavior of DSMLs Extension of in-place modeltransformation ProvidingDSMLswithsemantics (usingMaude) Modelmanagenent Simulation and analysis Contributions Futurework 2/44
3. Origins of modeldrivenengineering Software researchershavebeencreatingabstractionsto help them develop software systems: 3/44 X-orientedprogramming ??? … Component-orientedprogramming Object-orientedprogramming Structuredprogramming Assembler
4. Origins of modeldrivenengineering Whyabstractions? Lowlevel, littleexpresiveness Problem: programming! Computing-oriented focus: abstractions of the solution space Solution: abstractionsof the problem space 4/44
5. Modeldrivenengineering Create a model of thesystem Models are nottobeused as meredocumentation Simulation and analysis Drive final implementation 5/44
6. Model driven engineering Precise and formal semanticsneededto Facilitate unambiguous communication among model developers Enable the development of formal analysis and simulation tools Avoid semantic mismatches between design models and modeling languages of analysis tools 6/44
7. Model Driven Engineering (MDE) Models as first class entities. Twomaintechnologies: Domain Specific Modeling Languages (DSMLs) Notation close to the problem domain and intuitive for domain experts Model transformations Automatically synthesize alternative model representations, source code… 7/44 DSML DSML’ Model Transformation written in written in System’ Model Model’ represents represents System
8. Definition of a DSML 8/44 Behavior?? Semantics?? METAMODEL Conformsto CONCRETE SYNTAX MODEL
9. Definition of a DSML Behavior coded in the target (semantic) domain itself 9/44 Java AbstractState Machines First-OrderLogic …
10. Definition of a DSML (revisited) 10/44 TWO VIEWS Structure:Structuralmodel, concrete syntax, structuralsemantics Behavior:Behavioralmodel, concrete syntax, behavioralsemantics
11. Definition of a DSML (revisited) Behavior as an intuitive model Precise semantics A set of (equivalent) notations A set of analysis tools Underlying logic 11/44 StructuralModel BehavioralModel + DSML’S STRUCTURE AND BEHAVIOR SEMANTIC MAPPINGS (MODEL TRANSFORMATIONS) SEMANTIC DOMAINS MT3 MT1 MT2 Rewritinglogic (Reachabilityanalysis, modelchecking…) Petrinets (Termination, confluence…) …
12. Our approach 12/44 Ecore (MOF) (metamodel) (ext. of in-place MT) Structural Model Behavioral Model DSVL’S VIEWS Definedbytheuser + (Structural and behavioral) SEMANTIC MAPPINGS Transparenttotheuser SEMANTIC DOMAIN Transparenttotheuser RewritingLogic Maude Simulation, reachabilityanalysis, modelchecking
13. In-place modeltransformation Models, metamodels and model transformation are the key artifacts of MDE Intuitive and close to the problem domain Source and target models are the same 13/44
14. Extending in-place modeltransformation Why an extension? To cope with real-time systems Assist users to avoid driving the system to inconsistent time-states To refer to and reason about action executions To avoid modifying the metamodel (structure) to include (time and action) behavioral information Wewanttheuserjusttofocusonthecomplexity of his/hersystem Intrinsiccomplexity vs. accidental complexity 14/44
15. Extension of in-place modeltransformation*: A model of timedbehavior Twokind of timed rules: atomic and ongoing Periodicity Rule executions: normal and soft; scheduledactions. Global time elapse (clock) A mechanism to state action properties Actionexecutions OCL expressions, operations and variables (mOdCL) A graphical framework in Eclipse 15/44 * “A graphical approach for modeling time-dependent behavior of DSLs”. VL/HCC'09
19. Ongoingactions Actions that progress continuously with time while the rule preconditions (LHS and not NACs) hold TheBatteryConsumption rule 19/44
20. Actionexecutions An action execution element refers to one action: Type; status; participants; starting, ending and execution time They can limit concurrency, refer to past actions, interrupt actions… TheCall rule 20/44
23. Our approach 23/44 Ecore (MOF) Structural Model Behavioral Model DSVL’S VIEWS Definedbytheuser + (Structural and behavioral) SEMANTIC MAPPINGS Transparenttotheuser SEMANTIC DOMAIN Transparenttotheuser RewritingLogic Maude* Simulation, reachabilityanalysis, modelchecking * “Formal specification and analysis of domain specific languages using Maude”. SIMULATION, 2009
24. Maude Wide-spectrum programing language based on rewriting logic Membership equational logic as its underlying equational theory Why Maude? Deals with complex structural and behavioral specifications Succesfully used in a wide range of projects Efficient High level of abstraction Powerful toolkit: simulation, reachability analysis, model checking,… Integrated in Eclipse (MOMENT) Model of time (Real-time Maude) 24/44
30. Representing timed behavior with Maude Real-time Maude’smodel of time Delta Tick rule Time Elapse Mte crl [tick] : {MODEL} => {delta(MODEL , T)} in time T if T<= mte(MODEL) [nonexec] . Instantaneous rules Dynamicbehavior 30/44
31. Representing timed behavior with Maude* 31/44 Preconditionsatisfied -> CreatesanActionExecobjectwithtwotimers and informationabouttheoccurrence Triggeringinstantaneous rule Atomic rule After [t1,t2] Realization Instantaneous rule Participantsstillthere -> Performtheaction Preconditionsatisfied -> CreatesanActionExecobjectwithjustinformationabouttheoccurrence Initial Instantaneous rule Ongoing rule In next time elapse, whenmteiscomputed applyOngoingRulesequation (in delta) Preconditionsatisfied -> Performtheaction Decreasestimers of ActionExec, updatestheclockinstance, appliesongoing rules Delta Tick rule Time elapse Computedwiththeinformation of ActionExecobjects Mte * “On the behavioral semantics of real-time domain specific visual languages”. WRLA’10
34. Time elapse 34/44 delta crl [tick] : {MODEL} in time T => {delta(MODEL , TE)} in time (T plus TE) if TE := mte(MODEL) /TE =/= zero . mte
35. Toolsupport: modelmanagement* Eclipse plugin Mauderemainstransparenttotheuser 35/44 MAUDELING * “Formal and toolsupportformodel driven engineering with Maude.” JOT, 2007
36. Modelmanagement Modeldifference* (Structuraloridentifier) matching + differencing Properties: Model as a result Independent of the metamodel of the source models Self-contained. Do, undo, compose. Compact Non tree-based: Can detect moved elementsthroughdifferentlevels Failingtoidentify a match doesnotconditionother potencial matches 36/44 * “Representing and operating with model differences”. TOOLS’08
37. Modelmanagement Modelsubtyping* Modeltype: essentiallyits metamodel Modeloperationsreuse Type safety; polymorfism in MDE 4 kinds of subtyping: relaxation yes/no on name relations and packagestructure Modelmetrics No. of classes, maximum DIT, average No. of attributes… 37/44 * “Subtipado de modelos: una definición basada en la sustitución entre tipos y ...”. IDEAS’08
40. Time-bounded analysis Reachability Analysis Deadlock, invariants, etc. LTL Model checking Liveness properties 40/44 searchinit(mpnsModel) =>* { @MPN@ { < O : AtomicActionExec | action : “BatteryOffCaller” # status : realized # SFS > OBJSET} } in time T suchthat (T le 100) .
41. Contributions Formal specification of real-Time DSMLs Twoviews: structure and behavior A language and a graphical tool to define time-dependent behavior of DSMLs Extension of in-place model transformation Model of timed behavior Mechanism to state action properties Formalization of real-Time DSMLs with Maude Automatic generation of the Maude specifications Model management Simulation and (reachability and model checking) analysis 41/44
42. Contributions Tool support: Metamodel, parser and serializer for (a subset of) Maude Model Management Model transformation from EMF metamodels to Maude Model transformations from EMF models to Maude and viceversa Analysis of DSMLs for AToM3* Simulation and analysis of Real-Time DSMLs Model transformation from e-Motions to Maude Integration with Maude’s simulation facilities Integration with mOdCL 42/44 MAUDELING * ”Analyzing rule-basedbehavioral semantics of visual modeling languages with Maude”. SLE’08
43. FutureWork Model management Consider OCL constraints in model subtyping Formal proof of difference-related operations relationships Model simulation and analysis with Complete integration of Maude analysis tools Reachability analysis and model checking Querying the result of a simulation Encoding refinement Non-usedfeatures Untimedanalysis … OCL completion and validation Debugging and traceability 43/44
45. On the Semantics of Real-Time Domain Specific Modeling Languages Jose E. Rivera Advisors: Francisco Durán, Antonio Vallecillo PhDDefense Málaga, October 2010