dsml composition model synthesis and model transformation - chess … · 2018. 4. 3. · uc...
TRANSCRIPT
-
1
Foundations of Hybrid and Embedded Software Systems
UC Berkeley: ChessVanderbilt University: ISISUniversity of Memphis: MSI
NSF
Model-Based Design
DSML CompositionModel Synthesis andModel Transformation
Janos Sztipanovits and Gabor KarsaiNovember 14,2002
2Sztipanovits/Karsai
NSF
Middleware Services and OS
ComponentLibraries
MiddlewareOS
FrameworkLibraries
PlatformQoS ORB OSSchedulingFault
Tolerance
CORBAIDL
QoSAPI
POSIXAPI
ReplicationAPI
LibraryComponents
LibraryComponents
LibraryComponents
LibraryComponents
Model-Based Design andComposition
Auto-Generated Code Model-basedGenerators
GeneratorTechnology
Domain-Independent Models(models of computations: SDF, FSM, CSP, …)
User Interface
DecisionSupportControl
SensorSystem
Domain-Specific ModelsDS ModelLibraries/Patterns
DI ModelLibraries/Patterns
Domain-SpecificModeling
Technology
ToolsApplication
-
2
3Sztipanovits/Karsai
NSF Platforms(There are many…)
Hardware CPU, MEM, I/O
Operating System
QoS Middleware
Application
Hardware CPU, MEM, I/O
Operating System
QoS Middleware
Application
ControlAlgorithm
QoS parameters
Measuredvars.
Controlvars.
Application
OS
Strong isolationbetween SW andHW by Active Control
TTP Bus
ServoController
ServoController
CNI
ControlData Processor
BG BG
TTPController
CNI
ControlData Processor
BG BG
TTPController
ServoController
ServoController
CNI
ControlData Processor
BG BG
TTPController
CNI
ControlData Processor
BG BG
TTPController
Time-Triggered Architecture (distributed, hard real-time, safe)
QoS Middleware (such as CORBA)
Integration framework, composition mechanisms, components
4Sztipanovits/Karsai
NSFChallenges in Model-Based Design
ImplementationSpace
Mapping
ApplicationSpace
Gen./Synth.
DSML
ApplicationModels
DSML
Implement.Models
Pi-1
Pi
Pi+1
Composition of
• Domain Specific Modeling Languages (DSML)
• Model Synthesis
• Model Transformation
Design Model-BasedDesign
Model-BasedDesign of Embedded Systems
-
3
5Sztipanovits/Karsai
NSFSpecification of Domain Specific Modeling Languages (DSML)
ConcreteSyntax
C
AbstractSyntax
A
SemanticDomain
SSemantics
parses to
ConceptsRelationsWell formed-nessrules
Mathematical abstraction for specifying the meaning of models
Notation forrepresenting models
L = < C, A, S, MS, MC>
MC
MS
6Sztipanovits/Karsai
NSF Concrete Syntax and Abstract Syntax
Notation forrepresenting models:E.g.: Block Diagram
ConcreteSyntax
C
AbstractSyntax
A
SemanticDomain
SSemantics
parses to
MC
MS
Mathematical abstractionfor specifying the meaning of models
But What About S?
Signal Flow Language (SF)Concepts, RelationsWell formed-ness rules:
Self.InputPorts()→forAll(ip ip.src()→forAll(x1,x2 x1=x2))
UML-CD/OCL
-
4
7Sztipanovits/Karsai
NSFSemantics via Meta-Modeling
ConcreteSyntax
AbstractSyntax
SemanticDomain
Semantics
parses to
Meta-modeling language withwell-defined semantics
ConcreteSyntax
AbstractSyntax
SemanticDomain
Semantics
parses to
Represented byMeta-model
Semantics
DSML
Meta-modelStructuralSemanticsDSML:
StateFlowDOMAIN-MODEL
META-MODEL
Meta-Model of StateFlow using uml/OCLas meta modeling language.
8Sztipanovits/Karsai
NSF Semantics via Translation
ConcreteSyntax
AbstractSyntax
SemanticDomain
Semantics
parses to
ConcreteSyntax
AbstractSyntax
Semantics
parses to
SemanticDomain
translator
DSML
Semantics
Modeling language withwell-defined semantics
Synchronous Dataflow (SDF)
translatorBehavioralSemantics
ASF
Hierarchical Signal Flow (HSF)
Lee, Sangiovanni-Vincentelli
-
5
9Sztipanovits/Karsai
NSF
Consistency!
DSML Composition
Semantic domain impact!
ComposedBehavioralSemantics:HYBRIDSYSTEM
ConcreteSyntax
AbstractSyntax
SemanticDomain
Semantics
parses to
AL1
L1||L2ConcreteSyntax
SemanticDomain
Semantics
parses to
StructuralSemantics
AbstractSyntax
translation
HSF+ SDF+Cont.Dyn
AL2
ConcreteSyntax
AbstractSyntax
SemanticDomain
Semantics
parses to
ConcreteSyntax
SemanticDomain
Semantics
parses to
AbstractSyntax
translation
FSM CSP
10Sztipanovits/Karsai
NSF Simple Support for Compositional Meta-Modeling
`
Child inherits all associations except containment associations where parent functions as container.
Interface Inheritance
Child inherits all of the parent’s attributes and those containment associations where parent functions as container.
Implementation Inheritance
Complete equivalence of two classes Equivalence
Informal semanticsSymbol Operator
Composition Operators
Metamodel composition with GME
-
6
11Sztipanovits/Karsai
NSFResearch Agenda on DomainSpecific Modeling LanguagesPrecise, compositional meta-modeling
Multiple aspect modeling in the compositional meta-modeling framework
Practical issues:– Examples, meta-model libraries– Meta-programmable tools– Link to UML-2
12Sztipanovits/Karsai
NSF Model Synthesis and Transformations
• Model Synthesis
• Model Transformation
Model-BasedDesign of Embedded Systems
MatlabCode-Gen.
if (inactiveInterval != -1) {int thisInterval =
(int)(System.currentTimeMillis() -lastAccessed) / 1000;
if (thisInterval > inactiveInterval) {invalidate();
ServerSessionManager ssm =
ServerSessionManager.getManager();
ssm.removeSession(this);}
}
}
private long lastAccessedTime = creationTime;
/*** Return the last time the client sent a request
associated with this
* session, as the number of milliseconds since midnight,January 1, 1970
* GMT. Actions that your application takes, such asgetting or setting
* a value associated with the session, do not affect the
access time.*/
public long getLastAccessedTime() {
return (this.lastAccessedTime);
}
this.lastAccessedTime = time;
/*** Update the accessed time information for this session.
This method* should be called by the context when a request comes
in for a particular* session, even if the application does not reference
it.*/
public void access() {
this.lastAccessedTime = this.thisAccessedTime;
this.thisAccessedTime = System.currentTimeMillis();this.isNew=false;
}
lastAccessedTime = 0L;
lastAccessedTime = ((Long) stream.readObject()).longValue();maxInactiveInterval = ((Integer)
stream.readObject()).intValue();
isNew = ((Boolean)stream.readObject()).booleanValue();
MatlabCode-Gen.
Domain-Specific Modeling Languages
GeneratorModel-Based GeneratorTechnology
- Modeling of generators- Generating generators- Provably correct generators - Embeddable generators
ConfigurationSpecification
Analysis ToolCode
Pi-1
Pi
Pi+1
-
7
13Sztipanovits/Karsai
NSF Meta-generators: Model Transformations in Tool Integration
Approach (Karsai): Meta-models for source and target models plus transformations, then generating the transformer
Transformer
Domain-specific model
Target model
Meta- model for source
Meta- model for target
Meta- model for transform
GENGEN
Roles transformations play in model-based design:
•Refining a design into an implementation
•Code generation
•PIM -> PSM mapping
•Support for model interchange for tool integration
NSF
Meta-ProgrammableModel Builder
(GME)GENGEN
GeneratorSpecification
G: ASF →ASDF
Instance of
ASDFMeta-model-2
lSF∈ LSFHSF Domain model
lSDF ∈ LSDFSDF Executable modelSDF Platform
ASFMeta-model-1
instance of
Transformer
Meta-generators: Model Transformations in Component Integration
-
8
15Sztipanovits/Karsai
NSF Constraint-Based Model Synthesis
16Sztipanovits/Karsai
NSF Generative modeling: Extensions to Meta-Modeling LanguagesIterative (“for”) and conditional (“if”)constructs
in models can greatly enhance expressiveness while reducing complexity.
Input design: with “for” loopWhat it means:
Transformer
Replicate the middleof pipeline “Order”times!
Order = 3
-
9
17Sztipanovits/Karsai
NSFOther Uses of Transforms on Models: Design PatternsDesign patterns capture prototypical solutions
to a design problem. As such, they are parametric and reusable.
+operation()+add(in c : Component)+remove(in c : Component)+getChild(in index : int)
Component
+operation()
Leaf
-children
1
*
+operation()+add(in c : Component)+remove(in c : Component)+getChild(in index : int)
Composite
forall g in children g.Operation()
COMPOSITE PATTERN
+run()
Primitive
Compound
+run()+add(in c : PC_Component)+remove(in c : PC_Component)+getChild(in index : int)
PC_Component
+run()
Primitive
-children
1
*
+run()+add(in c : PC_Component)+remove(in c : PC_Component)+getChild(in index : int)
Compound
forall g in children g.run()
COMPOSITE PATTERNapplied to Compound and Primitive
Design pattern (as a transform)
Input designDesign with pattern applied
Transformer
18Sztipanovits/Karsai
NSFResearch Agenda on ModelTransformationsLanguages and tools for meta generators
Model synthesis using explicit design patterns
Model synthesis using constraint-based design-space exploration
Generative modeling extensions to languages
Embeddable generators