1
Institute for Software Integrated Systems
Vanderbilt University
Semantics in Model-Based Design Janos Sztipanovits ISIS, - - PDF document
Institute for Software Integrated Systems Vanderbilt University Semantics in Model-Based Design Janos Sztipanovits ISIS, Vanderbilt University Content Application Drivers Composition on the Abstract Syntax Layer Composition on the
Vanderbilt University
Requirement Specification Functional Design HW Config. Design System Config. Component Design Software Architecture SW Deployment
RA FD CD HwA SY DPL Functional Mod/ Sim Arch Mod/ Sim Alloc./ Sched. Analysis HW Pwr/ Perf Est Latency/ RT Analysis SwA
Requirement Specification Control Design Component Design Software Architecture HW Arch. Design System Arch. Design
Code Gen. Verif.
SW Deployment
Functional Code OS/ Firmware Glue Files OI L File DBC File (CAN-Bus)
Semantic Foundation Libraries Domain-Specific Environments Metaprogrammable Tools, Environments
Modeling Domain Specific Design Flows: Examples in MI C:
Metamodeling and Metaprogrammable Tools: (mature or in maturation program)
Modeling Semantics (work in progress):
∈ = Υ
Υ r
R r C D | { ) , (
Semantic Domain: Set-Valued Domain models Interchange Formats Abstract Syntax Meta-models
MC MS
i nt er f ace i nt er f ace Event st r uct ur e st r uct ur e M
i m pl em ent s i m pl em ent s Event case case M
Structural Semantics
C S A
MC MS DSML
DSML DSML i
Si Ci Ai
MCi MSi DSMLi
MOFADSMLi
MOF
MOFADSMLi
MOF
Industrial standard metamodeling language: MOF (or some others)
Transformation T
MTLTDSML,DSMLi
UMT MA
Formal metamodel transformation language:
Unified Model Transformation Language.
Abstract Syntax and Transformations: Meta-Models Common Semantic Domain: Hybrid Automata Domain Models and Tool Interchange Formats: Tool Chains
DESERT AIRES OSEK/ Code ECSL-DP GME Simulink Stateflow
SL/SF ECSL-DP ECSL-DP CANOE ECSL-DP AIF SL/SF DSE EDP C
Vehicle Control Platform (VCP)
Behavior Model Component Structure Component Interaction Schedulability Analysis Behavior Simulation
(Experimental tool chain)
Common Semantic Domain: Hybrid Automata Domain Models and Tool Interchange Formats: Tool Chains
DESERT AIRES OSEK/ Code ECSL-DP GME Simulink Stateflow
SL/SF ECSL-DP ECSL-DP MOML ECSL-DP AIF SL/SF DSE EDP C
Vehicle Control Platform (VCP)
Abstract Syntax and Transformations: Meta-Models
SL/SF Meta-Model ECSL-DP Meta-Model AIRES Meta-Model CANOE DESERT Meta-Model SFC Meta-Model ECSL-DP SFC SL/SF ECSL-DP ECSL-DP MOML ECSL-DP AIF SL/SF DESERT
Simulink/StateFlow (DSMLSL/SF) Component Model SW Architecture Model (DSMLSL/SF,CM)
SL/SF Functional blocks – SW Component Mapping Objective: Optimize the SW architecture by selecting a component model and by allocating functions to components. Platform: Heterogeneous Dataflow Component Model Tools: GME, GReAT, C Compiler, WCET Analyzer CM
doTr ansi t i on ( f sm as as FSM , s as as St at e, t as as Tr ansi t i on) =
Semantic Domain Meta-models Domain models Interchange Formats Abstract Syntax Meta-models
MC MS
Behavioral Semantics
syntax metamodels (“static semantics”)
– involve major effort due to overly complex modeling languages, – use a wide range of formalisms and
– tool chains are closed and built around loosely defined “conventions” and proprietary interpretations of semantics instead of standards – potential semantic mismatches create unacceptable risk for safety critical applications
Major roadblock that slows down acceptance of model-based design technology.
Transformation T
Well-defined DSML i
C S A
MC MS DSML
DSML
MS= MSi ○ MA
MOFADSMLi MTLTDSML,DSMLi
MOF UMT
Si Ci Ai
MCi MSi DSMLi MSi: Ai→Si
MOFADSMLi
MOF Mi: MOFADSML→MOFADSMLi
Industrial standard metamodeling language: MOF Formal metamodel transformation language:
Unified Model Transformation Language.
MA
Si Ci Ai
MCi MSi DSMLi MSi: Ai→Si
MOFADSMLi
MOF
Where are these coming from?
Component Behavior Structure I nteraction Scheduling / Resource Allocation Modeled on different levels of abstraction:
Dynamics, Hybrid), fundamental role of time models
Expressed as a system topology :
Describes interaction patterns among components:
(SR, SDF, DE,…)
Mapping/ deploying components on platforms:
Capture the semantics of a finite set of basic dynamic behavioral
categories, such as FSM, DES, TA.
Capture the semantics of basic interaction categories (Model of
Computation, MoCs), such as SDF, PN, …
Specified in a formal semantics framework. Develop a set of simple modeling languages for the semantic
units.
MA
Si Ci Ai
MCi MSi SUi
C S A
MC MS DSML
MOFADSMLi MOFASUi MTLTDSML,SUi
MOF UMT MOF Mi: MOFADSML→MOFASUi Transformation T MSi: Ai→Si
MS= MSi ○ MA
Semantic Unit i DSML
st st r uc r uct u t ur e r e Val ue ca case se I nt Val ue v as as I nt eger ca case se Doubl eVal ue v as as Doubl e ca case se Bool Val ue v as as Bool ean / / Dat a Token, i t m ay cont ai n a val ue or a nul l dat a st st r uc r uct u t ur e r e Token val ue as as Val ue? / / Dat a Por t , when exi st i s t r ue, t he por t has an ef f ect i ve dat a t oken cl cl ass ass Por t i d as as St r i ng va var t oken as as Token = Token ( nul nul l ) va var exi st as as Bool ean = f a f al s l se / / Dat a Channel connect i ng t wo dat a por t s cl cl ass ass Channel i d as as St r i ng sr cPor t as as Por t dst Por t as as Por t / / A Node i s a basi c uni t i s t he Dat a Fl ow. I t m ay be an act i on or a G uar d ab abst r st r ac act cl cl ass ass Node i d as as St r i ng ab abst st r a r act pr op pr oper er t y t y i nput Por t s as as Seq of
ge get ab abst st r a r act pr op pr oper er t y t y out put Por t s as as Seq of
ge get / / The Run m et hod t akes t okens f r om i t s i nput por t s, do act i ons and set out put / / t okens i n t he out put por t s ab abst st r a r act Fi r e ( ) / / Dynam i c Dat a Fl ow Sem ant i c Uni t ab abst r st r ac act cl cl ass ass SDF i d as as St r i ng ab abst st r a r act pr op pr oper er t y t y nodes as as Set of
ge get ab abst st r a r act pr op pr oper er t y t y channel s as as Set of
ge get ab abst st r a r act pr op pr oper er t y t y i nput Por t s as as Seq of
ge get ab abst st r a r act pr op pr oper er t y t y out put Por t s as as Seq of
ge get Run ( n as as Node) r e r equ qui r e n i n i n m e m
st st ep ep
st st ep ep i f i f ex exi s i st s p i n i n n. i nput Por t s wher her e p. exi st t hen t hen er r or ( " Af t er t he f i r i ng of a node, al l i nput t okens shoul d be consum ed by t he node. " ) st st ep ep i f i f ex exi s i st s p i n i n n. out put Por t s whe wher e no not p. exi st t h t hen en er r or ( " Af t er t he f i r i ng of a node, each of i t s out put por t shoul d have
st st ep ep f or a
i n m e m
wher e c. sr cPor t . exi st i f i f c. dst Por t . exi st t h t hen er r or ( " A i nput por t r ecei ves m
el el se W r i t eLi ne ( " Channel " + c. i d + " i s sendi ng dat a t okens. " )
t r ue
f al se / / Ret ur n al l nodes i n t he SDF t hat have al l i t s r equi r ed dat a t okens t o f i r e. Enabl edNodes ( ) as as Set of
r e r et u t ur n { n | n i n i n m e m
wher e f or a f or al l l l p i n i n n. i nput Por t s wh wher e p. exi st } I ni t i al i ze ( ) f o f or a r al l p i n i n m e m
wher e p. exi st f or a
i n m e m
wher e p. i d = c. sr cPor t . i d
f al se
t r ue Cl ear Por t s ( ) f o f or a r al l c i n i n m e m
i f i f c. sr cPor t . exi st t hen t hen
f al se i f i f c. dst Por t . exi st t hen t hen
f al se
Abstract Data Model Model I nterpreter
aspects of the DSML.
MA
Si Ci Ai
MCi MSi SUi
C S A
MC MS DSML
MOFADSMLi MOFASUi MTLTDSML,SUi
MOF UMT MOF Mi: MOFADSML→MOFASUi Transformation T MSi: Ai→Si
MS= MSi ○ MA
Semantic Unit i DSML
Operational Semantics Spec. Model
(MA) DSML Metamdoel (A)
GME Toolset GReAT Tool
Mc Instance Generate Domain Model (C) Semantic Unit Metamodel (Ai) Model Checker Model Simulator Test Case Generator
AsmL Tools Semantic Unit Spec.
Data Model Instance
XSLT ASM Semantic ASM Semantic Framework Framework Metamodeling and Model Transformation Metamodeling and Model Transformation Tools Tools Formal Framework for Semantic Units Formal Framework for Semantic Units Specification Specification
Domain Model (Ci) Abstract Data Model
GME: Provide a MOF-based
metamodeling and modeling environment.
GReAT: Build on GME for
metamodel to metamodel transformation.
ASM: A particular kind of
mathematical machine, like the Turing machine. (Yuri Gurevich)
AsmL: A formal specification
language based on ASM. (Microsoft Research)
Transformation Engine
Operational Semantics Spec. Model
(MA) Transformation Engine HFSML Metamodel (A)
GME Toolset GReAT Tool
Mc Instance Generate Domain Model (C) FSM Metamodel (Ai)
FSM-SU Specification
Data Model Instance
XSLT ASM Semantic ASM Semantic Framework Framework
FSM Model (Ci) Abstract Data Model
Operational Semantics Spec. Model
(MA) Transformation Engine HFSML Metamodel (A)
GME Toolset GReAT Tool
Mc Instance Generate Domain Model (C) FSM Metamodel (Ai)
FSM-SU Specification
Data Model Instance
XSLT ASM Semantic ASM Semantic Framework Framework
FSM Model (Ci) Abstract Data Model
st r u st r uct ur ct ur e Event event Type as as St r i ng cl as cl ass St at e i d as as St r i ng i ni t i al as as Bool ean va var act i ve as as Bool ean = f al se l se cl as cl ass Tr ansi t i on i d as as St r i ng abst abst r act r act cl cl as ass FSM i d as as St r i ng abst r a st r act ct pr pr op
er t y st at es as as Set of
ge get abst r a st r act ct pr pr op
er t y t r ansi t i ons as as Set of
ge get abst r a st r act ct pr pr op
er t y out Tr ansi t i ons as as M ap of
ge get abst r a st r act ct pr pr op
er t y dst St at e as as M ap of
ge get abst r a st r act ct pr pr op
er t y t r i gger Event Type as as M ap of
ge get abst r a st r act ct pr pr op
er t y out put Event Type as as M ap of
React ( e as as Event ) as as Event ? st st ep ep l et l et CS as as St at e = G et Cur r ent St at e ( ) st st ep ep l et l et enabl edTs as as Set of
i n out Tr ansi t i ons ( CS) whe wher e r e
st st ep ep i f i f Si ze ( enabl edTs) = 1 t hen hen choo hoose se t i n i n enabl edTs st e st ep / / W r i t eLi ne ( " Execut e t r ansi t i on: " + t . i d)
f al s l se st e st ep dst St at e( t ) . act i ve : = t r u t r ue st e st ep i f i f t i n i n m e m
t hen r et r et ur n ur n Event ( out put Event Type( t ) ) el el se se r et r et ur n ur n nul nul l el s el se i f i f Si ze( enabl edTs) > 1 t h t hen en er r or ( " NO N- DETERM I NI SM ERRO R! " ) el se l se r et ur n t ur n nul l nul l
Operational Semantics Spec. Model
(MA) Transformation Engine HFSML Metamodel (A)
GME Toolset GReAT Tool
Mc Instance Generate Domain Model (C) FSM Metamodel (Ai)
FSM-SU Specification
Data Model Instance
XSLT ASM Semantic ASM Semantic Framework Framework
FSM Model (Ci) Abstract Data Model
where g1, g2 are the partial maps between concepts in AC, ASU1, and ASU2 .
with RSU1 and RSU2 form the R rule set for the composed semantics.
RC SC m ∈ MC = I(AC) RSU1 SSU1 mSU1 ∈ MSU1 = = I(ASU1) RSU2 SSU1 mSU2 ∈ MSU2 = = I(ASU2) g1 : AC → ASU1 g2 : AC → ASU2 Get_() Run_() Get_() Run_() SU1 SU2 CS = <A, R> A = <AC ,ASU1, ASU2, g1, g2> R = <RC,RSU1,RSU2>
> =<
2 1 2 1
, , , , g g A A A A
SU SU C
Remark: The behavioral
composition specifies a controller, which restricts the executions of actions. Since the behavior of the component semantic units can be described as partial orders on the sets of actions they can perform, the behavioral composition can be modeled mathematically as a composition of the partial
software.
components communicating through event channels and data channels.
stateless computational functions that consume input data and produce
activations.
A SEFSM Component Model A SEFSM System Model
communicate with each other through event channels and data channels.
A SEFSM Conceptual Structure A Compositional Structure
GME UDM GReAT Best of Breed
Meta Models
Modeling Open Tool Integration Framework Model Transformation Model Data Management ESCHER Quality Controlled Repository: http://escher.isis.vanderbilt.edu OTIF
B A CK P L A NE R EG IST R A TIO N /N OT IF IC A T IO N /T RA N S FE R SE R V IC E S S E M A N T IC T R A N SL A T O R SE M AN T IC T RA N S LA T O R TO O L T O O L A D A PT O R T O O L T O O L A D A PT O R T OO L T O O L A D A P TO R M A N A GE R Stan dard interface/ P rotocol M ET ADATADESERT
Component Abstraction (TA) Design Space Modeling (MD) Design Space Encoding (TE) Design Space Pruning Design Decoding Component ReconstructionDesign Space Exploration
For example, the metamodel specification does not reveal the
complex interdependency between the event flow and the data flow structure of the components.
Metamodel defining the SEFSM component structure Metamodel defining the SEFSM system structure
behavioral aspects: the FSM-based behavior expressing reactions to events and the SDF-based behavior controlling the execution of computational functions (actions and guards).
A SEFSM Component Model A Compositional Structure