From MDE (model driven engineering) to CT and back

Download Report

Transcript From MDE (model driven engineering) to CT and back

From MDE (model driven
engineering) to CT and back
Zinovy Diskin
1/25
My experience
• ….. Algebraic logic
• 1993-97 --- Database design for a private
company in Latvia
• 98-2004 –- Business analyst in US
• 05-present --- Several academia/industry
projects on MDE in Canada (funded 50/50)
7/17/2015
Vancouver, CT'2011
2/25
CT for SE, why?
• CT’s applications for Physics, Comp. Science,
Linguistics… are well known, so what?
• Size
• Quality
7/17/2015
Vancouver, CT'2011
3/25
Modeling of modeling
modeling
Model
World

reasonin
interpretation
7/17/2015
Vancouver, CT'2011
4/25
Modeling of modeling: Comp.Sci
deep
reasoning
deep
abstraction
Model
World

interpretation
7/17/2015
Vancouver, CT'2011
5/25
Modeling of modeling: Engineering
shallow
abstraction
World
shallow
reasoning
Model

interpretation
7/17/2015
Vancouver, CT'2011
6/25
7/25
Modeling in Science vs. in Engineering
Ordinary math structures:
few sorts, few relations, few operations
simple carrier structures but complex formulas
Difficult theorems from simple axioms
SE structures:
hundreds of sorts, rels, operations
complex carrier structures but simple formulas
Simple theorems from difficult axioms
7/17/2015
Vancouver, CT'2011
8/25
Modeling of modeling: Engineering
1001
shallow
shallow
abstractions
abstraction
1001 shallow
reasoning
Model
World

interpretation
7/17/2015
Vancouver, CT'2011
9/25
Content
•
•
•
•
What MDE is
Models as generalized sketches
Towers of models: metamodeling vs. logic
Three dimensions of the model universe:
– typing, model matching, updates
• Observations and speculations
7/17/2015
Vancouver, CT'2011
10/25
Building software with MDE
Requirements --> Analysis --> Design --> Codin
World
7/17/2015
Models Code
Vancouver, CT'2011
11/25
UML offers 13 types of diagrams
7/17/2015
Vancouver, CT'2011
12/25
Structural problems of MDE
Code
World

7/17/2015
Vancouver, CT'2011
13/25
MDE in Canada: the NECSIS project
• Total budget is CAD….. for 5 years
• 7 Universities across Canada (McMaster,
Waterloo, UofT, UBC, McGill…)
• 20 professors,
• Funded by GM, IBM, NSERC
7/17/2015
Vancouver, CT'2011
14/25
A UML class diagram and its instance
Model M
Person
name: string [1]
tel: integer [1..3]
driver
1..2
drives
Car
num: string [1]
Instance I of M
P1: Person
1:driver
2:drives
C1:Car
num=100
name = John
tel = {11,22}
4:drives
P2: Person
name = Mary
tel = {11,33}
3:driver
15/25
Models as generalized sketches
Model M
Person
name: Str [1]
tel: Int [1..3]
driver
drives
1..2
Persons with names A*
drive 2 cars
drives
A*-Person
Person
tel [1..3]
name [1]
num: Str [1]
2
Car
num [1]
[Str]
[Int]
7/17/2015
[inverse]
driver [1..2]
Car
[A*-Str]
16/25
Semantics of constraints
A gen. sketch is given by the following data:
• A signature of diagram predicates
ar: Pred --> Graph (= cat. of graphs)
Given P in Pred, its semantics is
[[P]] \subset Graph(_,ar(P))
• An ar-sketch is S=(GS, CS) with GS the carrier graph
and CS a set of constraints
{(P,d): P in Pred, d: ar(P)--> GS }
• Given an “instance” I, tI: GI --> GS, and a constraint
c=(P,d) in CS, we define
I|= c iff PBd(tI) in [[P]]
7/17/2015
Vancouver, CT'2011
17/25
Metamodeling sketches
Metamod Mske
P in Pred
….
P-diagrams
2
12
1
23
2
3
12
23
13
ar(P)
1
13
Mske
Mgra
7/17/2015
Arrows
Nodes
3
tS
GS+
sketch S
GI+
|= ?
GS
GI
tI
18/25
Logics as a model tower
Logic
Grammar
MetaMetamodel
modeling
Metamod
Object ref
attribute
Value
7/17/2015
Theory
Model
Model
Instance
Person:Obj
drives:ref
name
:attr
Car:Obj
num:
Str:Val attr
Int: Val
Vancouver, CT'2011
Inst.
P1:Obj 2:ref
1:attr
C1:Obj
John:Val
3:num
001:Val
19/25
Inter-model relationships
(O=E)
R
(Object)
MM
(Person)
(Ana)
I
M
(P=E)
MN
NR
MR
IMN
I
(Entity)
NN
(A=A)
IJ
JMN
//
(EmploN yee)
(Ann)
J
J
20/25
Typing
Everything changes
Src-Trg
//
MM
NN
Updates
M
I
//
//
M’
I’
N
J
N’
//
//
J’
21/25
Observations/Speculations
• “shallow modeling” needs special structuring
mechanisms (SSMs): classification, nesting,
AND-OR operations
• Inter-model relationships are complex
structures that needs SSMs too: comma cats,
profunctors, …
• It is easier to talk to a software engineer than
to a computer scientist
7/17/2015
Vancouver, CT'2011
22/25
Typing
Src-Trg
r
A
u
tA
tB
Updates
S
r: r
r
A
v
B
B
a
A
B
b
r':r
B
23/25
7/17/2015
Vancouver, CT'2011
24/25
UML state machine diagrams
7/17/2015
Vancouver, CT'2011
25/25
UML sequence diagrams
7/17/2015
Vancouver, CT'2011
26/25
UML class diagram
7/17/2015
Vancouver, CT'2011
27/25