ModelBased Design Edited and presented by Janos Sztipanovits

Model-Based Design Edited and presented by Janos Sztipanovits Vanderbilt University Chess Review October 4, 2006 Alexandria, VA

Model-Based Design Model-based design focuses on the formal representation, composition, and manipulation of models during the design process. "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 2

System Composition Approaches Component Behavior Interaction Scheduling/ Resource Mapping "Model Based Design", J. Sztipanovits Modeled on different levels of abstraction: • Generalized transition systems (FSM, Time Automata, Cont. Dynamics, Hybrid), fundamental role of time models • Precise relationship among abstraction levels • Research: dynamic/adaptive behavior Expressed as a system topology : • Module Interconnection (Nodes, Ports, Connections) • Hierarchy • Research: dynamic topology Describes interaction patterns among components: • Set of well-defined Models of Computations (Mo. C) (SR, SDF, DE, …) • Heterogeneous, precisely defined interactions • Research: interface theory (time, resources, . . ) Mapping/deploying components on platforms: • Dynamic Priority • Behavior guarantees • Research: composition of schedulers ITR Review, Oct. 4, 2006 3

Tool Composition Approaches Domain-Specific Tools; Design Environments Metaprogrammable Tools, Integration Frameworks Semantic Foundation "Model Based Design", J. Sztipanovits Domain-Specific Design Flows and Tool Chains: • ECSL - Automotive • ESML - Avionics • SPML - Signal Processing • CAPE/e. LMS MIC Metaprogrammable Tool Suite: (mature or in maturation program) • Metamodeling languages • Modeling Tools • Model Transformations • Model Management • Design Space Construction and Exploration • Tool Integration Framework Semantic Foundations (work in progress): • Semantic Anchoring Environment (SAE) • Verification • Semantic Integration ITR Review, Oct. 4, 2006 4

Intersection of System and Tool Composition Dimensions Component Behavior Semantic Units and Semantic Anchoring Interaction Compositional Semantics Metamodels, Metamodel Composition & Metaprogrammable Tool Chain Composition Model Composition in Domain-Specific Design Flows Resource Modeling (Schedule) Semantic Foundation; "Model Based Design", J. Sztipanovits Metaprogrammable Tools, Environments Domain-Specific Tools, Tool Chains ITR Review, Oct. 4, 2006 5

Domain Specific Design Flows and Tool Chains • Integration of tools into tool chains – – – ECSL – Control ESML - Avionics SPP - Signal Processing FCS – Networked Embedded Systems SCA – Software Defined Radio • Integration among tool frameworks: Metropolis, Ptolemy II, MIC, Simulink/Stateflow, ARIES, Check. Mate, … • www. escherinstitute. org "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 6

Intersection of System and Tool Composition Dimensions Component Behavior Semantic Units and Semantic Anchoring Interaction Compositional Semantics Metamodels, Metamodel Composition & Metaprogrammable Tool Chain Composition Model Composition in Domain-Specific Design Flows Resource Modeling (Schedule) Semantic Foundation; "Model Based Design", J. Sztipanovits Metaprogrammable Tools, Environments Domain-Specific Tools, Tool Chains ITR Review, Oct. 4, 2006 7

Syntactic Layer Domain models Interchange Formats MC Abstract Syntax Meta-models MS Structural Semantics interface Event structure Model. Event implements Event case Model. Event 1 Semantic Domain: Set-Valued "Model Based Design", J. Sztipanovits • • • Modeling & Metamodeling Model Data Management Model Transformation Tool Integration Design-Space Exploration ITR Review, Oct. 4, 2006 8

Metamodeling View of a Tool Chain Common Semantic Domain: Hybrid Automata Abstract Syntax and Transformations: Meta-Models Domain Models and Tool Interchange Formats: Tool Chains AIRES Meta-Model AIRES EC SLAI DP F Vehicle Control Platform (VCP) ECSL-DP AIF Simulink SL/SF Meta-Model Stateflow SL/SF ECSL-DP DESERT Meta-Model "Model Based Design", J. Sztipanovits ECSL-DP MOML CANOE MOML EDP C SL/SF DSE SL/SF DESERT ECSL-DP Meta-Model GME ECSL-DP SFC OSEK/ Code SFC Meta-Model ITR Review, Oct. 4, 2006 9

Need for Metamodel Composition: Simulink/State. Flow (DSMLSL/SF) Component Model SW Architecture Model (DSMLSL/SF, CM) Objective: Optimize the SW architecture by selecting a component model and by allocating functions to components. Platform: Heterogeneous Dataflow Component Model Tools: GME, GRe. AT, C Compiler, WCET Analyzer SL/SF CM Functional blocks – SW Component Mapping "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 10

Solutions for Compositional Metamodeling • Goal: Composing modeling languages (not models) • Metamodel composition methods in the Generic Modeling Environment (GME): – – – Class Merge Metamodel Interfacing Class Refinement Template Instantiation Metamodel Transformations "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 11

Metamodel Composition Methods Metamodel Interfacing Class Refinement Class Merge "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 12

Summary of Progress in Model Transformations Complex model transformations can be formally specified in the form of executable graph transformation rules G/T semantics is very powerful but the implementation needs to be tailored for efficiency GRe. AT is an open source, metamodel-based model transformation language supported by tools: modeling tool, rewriting engine, code generator and debugger. It is based on attributed/typed graph matching, multidomain rewriting rules, and explicitly sequenced rewriting operators. Highlights of GRe. AT extensions: shared spaces, sorting of match results, crossproducts of matches, higher-order operators (groups) Applications of GRe. AT: • Simulink/Stateflow verifying code generator • Several model transformation tools in embedded system toolchains • Semantic anchoring of domainspecific modeling languages "Model Based Design", J. Sztipanovits Concept: Metamodel-based Transformations Language: Graph Transforms Toolsuite: GRe. AT (Karsai et al, 2005 -2006) ITR Review, Oct. 4, 2006 13

Major Applications of Model Transformations for Schedule Generation: Explicit Platform Modeling Language: Implicit Platform Modeling for Analysis: (Karsai et al, 2005 -2006) "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 14

Structural Semantics of Models and Metamodels We followed a formal logic approach to structural semantics. A metamodel is mapped to a set of n-ary function symbols and constraints over an associated Herbrand Universe. These are the function symbols and some constraints for the example metamodel We use an inference procedure to prove well-formedness or malformedness. This inference mechanism is well-defined an tool independent. We have constructed an automatic theorem prover that answers questions about structural semantics (see poster). (Jackson, Sztipanovits 2006) "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 15

Intersection of System and Tool Composition Dimensions Component Behavior Semantic Units and Semantic Anchoring Interaction Compositional Semantics Metamodels, Metamodel Composition & Metaprogrammable Tool Chain Composition Model Composition in Domain-Specific Design Flows Resource Modeling (Schedule) Semantic Foundation; "Model Based Design", J. Sztipanovits Metaprogrammable Tools, Environments Domain-Specific Tools, Tool Chains ITR Review, Oct. 4, 2006 16

Semantic Anchoring of DSML-s DSML S C DSML Transformation T Ci Si SUi MC MS Semantic Unit i MS= MSi ○ MA MSi A MA Ai MOFADSMLi MTLTDSML, SUi MOFASUi MOF UMT MOF MSi: Ai Si Mi: MOFADSML MOFASUi • Step 1 – Specify the DSML <A, C, Mc> by using MOF-based metamodels. • Step 2 – Select appropriate semantic units L = < Ai, Ci, MCi, Si, MSi> for the behavioral aspects of the DSML. • Step 3 – Specify the semantic anchoring MA = A -> Ai by using UMT. "Model Basedand Design", J. Sztipanovits (Chen Sztipanovits, 2005 -2006) ITR Review, Oct. 4, 2006 17

Experimental Tool Suite for Semantic Anchoring Metamodeling and Model Transformation Tools GME Toolset DSML Metamdoel (A) Mc Domain Model (C) Formal Framework for Semantic Units Specification GRe. AT Tool Model Trans. Rules (MA) Generate Transformation Engine Semantic Unit Spec. Semantic Unit Metamodel (Ai) Instance Domain Model (Ci) • Metamodeling and Model Transformation Tools – GME: Provide a MOF-based metamodeling and modeling environment. – GRe. AT: Build on GME for metamodel to metamodel transformation. "Model Based Design", J. Sztipanovits Abstract Data Model Operational Semantics Spec. Data Model Checker Test Case Generator Instance XSLT Asm. L Tools ASM Semantic Framework Model Simulator • Tools for Semantic Unit Specification – ASM: A particular kind of mathematical machine, like the Turing machine. (Yuri Gurevich) – Asm. L: A formal specification language based on ASM. ITRResearch) Review, Oct. 4, 2006 18 (Microsoft

Example: HFSML -> FSM-SU; 1/3 GME Toolset HFSML Metamodel (A) Mc Domain Model (C) GRe. AT Tool Model Trans. Rules (MA) Generate Transformation Engine "Model Based Design", J. Sztipanovits FSM-SU Specification FSM Metamodel (Ai) Instance FSM Model (Ci) Operational Semantics Spec. Abstract Data Model Instance XSLT Data Model ASM Semantic Framework ITR Review, Oct. 4, 2006 19

Example: HFSML -> FSM-SU; 2/3 GME Toolset HFSML Metamodel (A) Mc Domain Model (C) GRe. AT Tool Model Trans. Rules (MA) Generate Transformation Engine "Model Based Design", J. Sztipanovits FSM-SU Specification FSM Metamodel (Ai) Instance FSM Model (Ci) Operational Semantics Spec. Abstract Data Model Instance XSLT Data Model ASM Semantic Framework ITR Review, Oct. 4, 2006 20

Example: HFSML -> FSM-SU; 3/3 GME Toolset HFSML Metamodel (A) Mc Domain Model (C) GRe. AT Tool Model Trans. Rules (MA) Generate Transformation Engine "Model Based Design", J. Sztipanovits FSM-SU Specification FSM Metamodel (Ai) Instance FSM Model (Ci) Operational Semantics Spec. Abstract Data Model Instance XSLT Data Model ASM Semantic Framework ITR Review, Oct. 4, 2006 21

Intersection of System and Tool Composition Dimensions Component Behavior Semantic Units and Semantic Anchoring Interaction Compositional Semantics Metamodels, Metamodel Composition & Metaprogrammable Tool Chain Composition Model Composition in Domain-Specific Design Flows Resource Modeling (Schedule) Semantic Foundation; "Model Based Design", J. Sztipanovits Metaprogrammable Tools, Environments Domain-Specific Tools, Tool Chains ITR Review, Oct. 4, 2006 22

Component-based Analysis • Incremental design – Associative composition ? = (F 1 k F 3)k F 2 F 1 k ( F 2 k F 3) • Independent implementability – No global checks º (F 1 k F 3)k F 2 (Matic and Henzinger, 2006) "Model Based Design", J. Sztipanovits (F 1 k F 3’)k (F 2 k F 2’) ITR Review, Oct. 4, 2006 23

Real-time Interface Assumption requests bounded by a Guarantee output latency bounded by d capacity larger than c Output rate function id id(t) = i(t+d) Interface predicate input output (Matic and Henzinger, 2006) "Model Based Design", J. Sztipanovits ITR Review, Oct. 4, 2006 24

Interface Algebra • Composition operation || = k F 1 • Connection operation + F • Refinement relation F 2 + c 1+c 2 · 1 F 1 k F 2 i 1+i 12 · a 1 i 2+id 112 · a 2 { 1 2} S F+S · F’ refines F if – SF µ SF‘ – for each port valuation of F there exists a valuation of F’ : (Matic. Based and Henzinger, 2006) "Model Design", J. Sztipanovits ITR Review, Oct. 4, 2006 25

Algebra Properties Ø Incremental design – (Fk. G)k. H is defined ) Fk(Gk. H) is def. Æ (Fk. G)k. H = Fk(Gk. H) – (Fk. G)©S is defined ) (F©S)k. G is def. Ø Independent refinement – Fk. G is defined Æ F’ ¹ – ) F ’ k G is def. F©S is defined Æ F’ ¹ ) F ’ © S is def. for all j=1, …, n: F’j ¹ E(F’ 1, …, F’n) ¹ (Matic. Based and Henzinger, 2006) "Model Design", J. Sztipanovits Æ (Fk. G)©S = (F©S)k. G F Æ F ’ k G¹ F k. G F Æ F’©S ¹ F©S Fj E(F 1, …, Fn) ITR Review, Oct. 4, 2006 26
- Slides: 26