Model-versioning-in-the-large: Algebraic foundations and the tile - - PowerPoint PPT Presentation
Model-versioning-in-the-large: Algebraic foundations and the tile - - PowerPoint PPT Presentation
Model-versioning-in-the-large: Algebraic foundations and the tile notation Work in progress Zinovy Diskin, Krzysztof Czarnecki and Michal Antkiewicz Generative Software Development Lab University of Waterloo, Canada A very large
9/4/11 CVSM-2009, Vancouver 2
A “very large” picture:
!! Pictures/diagrams are good but informal (no
formal semantics)
!! Formulas are bad (mind boggling) but precise !! The best of the two worlds: precise diagrams
with formal semantics
9/4/11 CVSM-2009, Vancouver 3
Versioning: small vs. large
Model M1
!
Model M2
Typical setting: 1D and Small
Replicas and matches A A"
"
B"
" B
t Ann Bob t"
"
Carol …
C
Time and updates !R !T A"" B"
"" "
t!! B"
"
C"
"" "
… … … Our setting: 2D and Large
!
Plan of the talk: 1.! Inside a tile 2.! Tile composition 3.! Reconciliation 4.! Sample “large” scenario 5.! Summary/discussion
9/4/11 CVSM-2009, Vancouver 4
Example: Relational tile
# P:Person
name: Jo
pho: 111 age: 30
Ann’s model, A
= Q:Person
nickname: Jo
pho: 222
Bob’s model, B
=
Frame denotes elements’ IDs
= # P":Person
name: Jo
hPho: 111
model A!
= Q":Person
name: Jon
mPho: 222
model B!
= # # # # # # = #
Green refers to heuristic activity;
# #
9/4/11 CVSM-2009, Vancouver 5
Versioning-in-the-small: Deltas are tiles
Time Replicas A A"
"
B"
" B
u v t Ann Bob t"
"
m m"
"
A A" m A tile as a revision
- f match
m" B u v B"
"
/m*
Blue elements are derived (computed)
A A" m m" B u v B"
"
/v* A tile as a revision
- f update
9/4/11 CVSM-2009, Vancouver 6
Special cases: Idle/identity tiles
A A"
"
A"
"
A u u 1A 1A’ (b1) Horizontal identity A A B B m (a1) Vertical identity m
1m 1u
1B 1A (ab) 11A =11A A A A A 1A 1A 1A 1A
9/4/11 CVSM-2009, Vancouver 7
Metamodel of tiles
Node (Model) Horizontal Arrow (Match spec) Vertical Arrow (Update spec) Square (Tile) $0 (src model) $1 (trg model) h$0 (src match)
"h (identical match)
h$1 (trg match) v$0 (src update) v$1 (trg update) $0 (src model) $1 (trg model)
" (identical 2-match) "v (idle
update)
" (idle
2-update)
9/4/11 CVSM-2009, Vancouver 8
Model versioning-in-the-large. Tile composition & interchange law
Time Replica s A A"
"
B"
" B
m u v t Ann Bob A"
"" "
B"
"" "
u"
"
w t"
"" "
n"
" C
v" Carol C"
"
w"
"
C"
"" "
# % % $ $ ! ! $! !
n m"
"
m"
"" "
n"
"" "
#! ! % %$! ! # ! ! #! !
AC""1 = (# ! ! #! !) % % ($ ! ! $! !) AC""2 = (# % % $ ) ! ! ( &" % % $!)
Interchange law: AC""1 = AC""2
9/4/11 CVSM-2009, Vancouver 9
Model versioning-in-the-large. Definition of tile system (double category)
!! Collection of nodes, vertical and horizontal
arrows, and squares (tiles)
!! V-arrows can be composed (assoc. and
units) and h-arrows can be composed (assoc. and units).
!! Tiles can be composed vertically (assoc. and
units) and horizontally (assoc. and units), and work together under the interchange law.
9/4/11 CVSM-2009, Vancouver 10
Model versioning-in-the-large. Pasting lemma: Any tile system has the following property:
{(& &11%
%&12)['1% % (&22 &32)]}% %('3&33) =
(& &11'1)%
%{[(&12&22)% %'3](&32% %&33)}
(& &11'1) %
% (&12&22&32) % % ('3&33) =
9/4/11 CVSM-2009, Vancouver 11
Optimistic versioning and reconciliation
Standard view Tile view Input Output
A B O A B O O u v m A! B! !!AB A! B! A B m
Algebraic laws: (1) (& % ')! = &! % '! (2) (& " &")! = &"! (optional)
m! u! v! rec
12
Use case: “large” versioning scenario via tiles
time authors Ann Bob Carol Tue
- R
- 1v!
- R
- v
v! m! m v!
O O
1O R Mon Wed Wed+ Tue+ Thu Thu+ u u!
9/4/11 CVSM-2009, Vancouver 13
Summary
!! The elementary unit (molecule) of model versioning
is a 2D-structure -- tile. Complex scenarios are composed from tiles.
!! Tile composition is regulated by algebraic laws of
double categories (associativity, interchange law, pasting lemma).
!! Complex scenarios are terms built from tiles in some
signature of tile operations. Hence,
!! Algebraic machineries of category theory become
applicable (diagram chasing/diagrammatic calculus).
9/4/11 CVSM-2009, Vancouver 14
Even bigger picture
!! Engineering (e.g., mechanical and electrical) !! Physics !! Mathematics !! Category theory (abstract nonsense)
- Higher-dimensional category theory
Software Engineering
9/4/11 CVSM-2009, Vancouver 15