Post on 24-Jan-2016
description
transcript
NSF/ITR: Foundations of Hybrid and Embedded Software Systems
Model-Integrated Computing:Foundations
DSML Composition Model Synthesis and Model Transformation
Janos Sztipanovits March 11, 2003
2Sztipanovits
Middleware Services and OS
ComponentLibraries
MiddlewareOS
FrameworkLibraries
PlatformQoS ORBOS
SchedulingFault
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
DecisionSupport
ControlSensorSystem
Application-Specific Models
DS ModelLibraries/Patterns
DI ModelLibraries/Patterns
Domain-Specific
ModelingTechnology
ToolsApplication
3Sztipanovits
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
MDA View of Model-Based Design
Platform-Independent
Model
CORBA Model
CORBA Java/EJB XML/SOAP Other
Java/EJBModel
XML/SOAPModel
OtherModel
MDA Tool generates all or most of the implementation code for deployment technology selected by the developer.
Richard Mark Soley, Model Driven Architecture: An Introduction
A Detailed Model, stating Pre- and Post-Conditions in OCL, and Semantics in Action Language
Map a PIM to Specific Middleware Technologies via OMG Standard Mappings
Map a PIM to Many Middleware Technologies via OMG Standard Mappings
Map PSM to application interfaces, code, GUI descriptors, SQL queries, etc.
5Sztipanovits
Model-Based Design for Embedded Systems
ImplementationSpace
Mapping
ApplicationSpace
Challenges: • Domain Specific Modeling Languages (DSML)
• Model Synthesis
• Model Transformation
Design
Gen./Synth.
DSML
ApplicationModels
DSML
Implement.Models
Model-BasedDesign
FM ARCH SYNL HY
CON IMP
ODEPi-1
Pi
Pi+1
Model-BasedDesign of Embedded Systems
FSM
6Sztipanovits
Specification of Domain Specific Modeling Languages (DSML)
ConcreteSyntax
C
AbstractSyntax
A
SemanticDomain
SSemantics
parses to
Concepts
Relations
Well formed-nessrules
Mathematical abstraction for specifying the meaning of models
Notation forrepresenting models
L = < C, A, S, MS, MC>
MC
MS
7Sztipanovits
Concrete Syntax and Abstract Syntax
Notation forrepresenting models:E.g.: Block Diagram
Concrete
Syntax
C
Abstract
Syntax
A
Semantic
DomainS
Semantics
parses to
MC
MS
Mathematical abstraction
for specifying the meaning of models
But What About S?
Signal Flow Language (SF)Concepts, Relations
Well formed-ness rules:
Self.InputPorts()forAll(ipip.src()forAll(x1,x2x1=x2))
UML-CD/OCL
8Sztipanovits
Semantics via Meta-Modeling
Concrete
Syntax
Abstract
Syntax
Semantic
DomainSemantics
parses to
Meta-modeling language withwell-defined semantics
Concrete
Syntax
Abstract
Syntax
Semantic
DomainSemantics
parses to
Represented by
Meta-modelSemantics
DSML
Meta-modelStructural
SemanticsDSML:StateFlow
DOMAIN-MODEL
META-MODEL
Meta-Model of StateFlow using uml/OCLas meta modeling language.
9Sztipanovits
Semantics via Translation
Concrete
Syntax
Abstract
Syntax
Semantic
DomainSemantics
parses to
Concrete
Syntax
Abstract
SyntaxSemantics
parses to
Semantic
Domain
translator
DSML
Semantics
Modeling language with
well-defined semanticsSynchronous Dataflow (SDF)
translatorBehavioral
Semantics
ASF
Hierarchical Signal Flow (HSF)
Lee, Sangiovanni-Vincentelli
10Sztipanovits
Consistency!
DSML Composition
Semantic domain impact!
Composed
Behavioral
Semantics:
HYBRIDSYSTEM
Concrete
Syntax
Abstract
Syntax
Semantic
DomainSemantics
parses to
AL1
L1||L2
Concrete
Syntax
Semantic
DomainSemantics
parses to
Structural
Semantics
Abstract
Syntaxtranslation
HSF+ SDF+Cont.Dyn
AL2
Concrete
Syntax
Abstract
Syntax
Semantic
DomainSemantics
parses to
Concrete
Syntax
Semantic
DomainSemantics
parses to
Abstract
Syntaxtranslation
FSM CSP
11Sztipanovits
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 semantics Symbol Operator
Composition Operators
Metamodel composition with GME
12Sztipanovits
Model Synthesis and Transformations
• Model Synthesis
• Model Transformation
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 as getting 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 Tool
Code
FM ARCH SYNL HY
CON IMP
ODEPi-1
Pi
Pi+1
Model-BasedDesign of Embedded Systems
FSM
NSF
Meta-ProgrammableModel Builder
(GME) Instance of
ASDF
Meta-model-2
lSFLSF
HSF Domain model
lSDF LSDF
SDF Executable modelSDF Platform
ASF
Meta-model-1
instance of
GENGEN
GeneratorSpecification
G: ASF →ASDF
Transformer
Ongoing Work: Meta-generators
14Sztipanovits
Ongoing Work: Constraint-Based Model Synthesis
15Sztipanovits www.omg.org/mda
Ongoing Work: Combining MIC & Component Middleware
QoS Policies
QoS PropertyAdaptor
Real-time POA
ORB QoS Interfaces
Container
CORBAComponent
Client/Peer
Server/PeerApplication
CodeComponentHome
CORBAComponent
CORBAComponent
CORBAComponent
CCM Component Library
Model-BasedGenerator
SelectComponent
Synthesize & Assemble
CORBAComponent
CORBAComponent
CORBAComponent
CCM Model Library
16Sztipanovits
Tools for Model-Integrated Computing Technology
Services
Platform Specific Models(SDF, FSM, CSP, …)
Auto-Generated Code
SecurityModels
FaultModels
Middleware Services and OS
ORBOS
SchedulingFault
Tolerance
CORBAIDL
QoSAPI
VehicleControllers
SensorSystemModels
Application Specific Models
LibraryComponents
LibraryComponents
LibraryComponents
LibraryComponents
POSIXAPI
REPLICATIONAPI
DS ModelLibraries/Patterns
Component & Platform
Models
Model-basedGenerators
Middleware Component
Libraries
Application Component
Libraries
Domain-SpecificModeling &AnalysisEnvironment
GeneratorTechnology
MiddlewareTechnology
MetaModel
Libraries
ToolMetadata
MetaGenererator
ComponentLibraries
ECLIPSE
OTIFLibraries
MetaModelingEnvironment
Meta-Generator
Technology
Open ToolIntegrationFramework
Integrated Tools
Embedded Computing Applications
Domain Specific Tools
Domain Independent Tools
Domain Independent Tools
OTIFToolIntegration
Platform
MetamodelRepository
Summary
17Sztipanovits
18Sztipanovits
Research Agenda on DomainSpecific Modeling Languages
Precise, 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
19Sztipanovits
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
20Sztipanovits
Generative modeling: Extensions to Meta-Modeling Languages
Iterative (“for”) and conditional (“if”)constructs in models can greatly enhance expressiveness while reducing complexity.
Input design: with “for” loopWhat it means:
Transformer
Replicate the middle of pipeline “Order” times!
Order = 3
21Sztipanovits
Other Uses of Transforms on Models: Design Patterns
Design 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
22Sztipanovits
Research Agenda on ModelTransformations
Languages 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
23Sztipanovits
Conclusion
The hard problems of building large embedded systems are Semantics and Compositionality
Model-based integration technology has the power to solve the problem
Model-Integrated Computing evolves to be a mature technology for the development of complex applications