SlideShare a Scribd company logo
1 of 35
Download to read offline
MODEL TRANSFORMATION
PRODUCT LINES
MODELS’2018, Copenhagen
J. de Lara1, E. Guerra1, M. Chechik2, R. Salay2
1Universidad AutĂłnoma de Madrid (Spain)
2University of Toronto (Canada)
LET’S WRITE A SIMULATOR
FOR PETRI NETS…
2
ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
operation Transition fire() {
for (p in self.ins) p.tokens-=1;
for (p in self.outs) p.tokens+=1;
}
…
DOES THIS LOOK FAMILIAR?
3
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
Token
tokens *
operation Transition fire() {
for (p in self.ins)
p.tokens.remove(p.tokens.random());
for (p in self.outs)
p.tokens.add(new Token);
}
…
ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
operation Transition fire() {
for (p in self.ins) p.tokens-=1;
for (p in self.outs) p.tokens+=1;
}
…
NOT ONLY REALIZATIONS,
BUT VARIANTS…
4
ins
Place
tokens: int
bound: int
PetriNet
Transition
outs
places * trans*
*
*
Bounded places
ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
Transition priorities
priority: double
ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
Read arcs
read
* ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
Inhibitor arcs
inh
*
…WHICH WE MAY NEED TO
COMBINE
5
ins
Place
tokens: int
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities (int)
Transition
priority: double
ins
Place
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities
(class)
Transition
priority: double
Token
tokens *
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
tokens: int
bound: int
Bound + read arcs (int)
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
bound: int
Bound + read arcs
(class)Token
tokens *
ins
Place
tokens: int
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities (int)
Transition
priority: double
ins
Place
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities
(class)
Transition
priority: double
Token
tokens *
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
tokens: int
bound: int
Bound + read arcs (int)
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
bound: int
Bound + read arcs
(class)Token
tokens *
…WHICH WE MAY NEED TO
COMBINE
6
32 combinations
ins
Place
tokens: int
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities (int)
Transition
priority: double
ins
Place
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities
(class)
Transition
priority: double
Token
tokens *
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
tokens: int
bound: int
Bound + read arcs (int)
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
bound: int
Bound + read arcs
(class)Token
tokens *
…AND WRITE
TRANSFORMATIONS FOR
7
Now go and write
32 transformations
ins
Place
tokens: int
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities (int)
Transition
priority: double
ins
Place
bound: int
PetriNet
outs
places * trans*
*
*
Bound + priorities
(class)
Transition
priority: double
Token
tokens *
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
tokens: int
bound: int
Bound + read arcs (int)
ins
Place
PetriNet
Transition
outs
places * trans*
*
*
read
*
bound: int
Bound + read arcs
(class)Token
tokens *
…AND MAINTAIN
8
Do we add weights
to the arcs?
9
WHAT WE NEED
A succinct mechanism to express meta-model variants
Methods to write transformations for all these variants
• Compact: without writing many similar-but-not-quite-the-
same transformations
• Usable: abstract away from details of other variants
• Extensible: easy to add new variants
• Correct: express and check expectations on different parts of
the transformation
10
OUR CONTRIBUTION
11
A notion of transformation product line (TPL), which is:
• Compact: transformation fragments, annotated with their activation
(presence) conditions
• Usable: abstraction mechanism that hides details (concepts)
• Extensible: by composition operators
• Correct: by profiting from (OCL) contracts and analysis methods
based on model finding
Building on a notion of meta-model product line (MMPL) [GLCS18]
Tool support: Merlin
Experiments that show the benefits of analysis at the TPL level
[GLCS18] Guerra, de Lara, Chechik, Salay. 2018.
Analysing Meta-Model Product Lines. Proc. SLE, pp.: 171-184.
META-MODEL PRODUCT LINES:
FEATURE MODEL
Feature model to express the variability space
Features and their allowed combinations
Feature diagram
Configurations
12
mandatory optional
alternative or
PetriNets
Tokens
Simple Object
Priority
FM = {PetriNets, Tokens, Simple, Object, Arcs, Inhibitor, Read, Priority, Bounded},
PetriNets  Tokens  Arcs  ((Simple  ¬Object)  (¬Simple  Object))
Arcs
Inhibitor Read
Bounded
Legend
P = {⟨Simple⟩, ⟨Simple, Inhibitor, Bounded⟩, ⟨Object, Read, Priority⟩, . . . }
(32 are possible, only leaf features shown)
META-MODEL PRODUCT LINES:
150% META-MODEL
13
ins
Place
itokens: int
bound: int
PetriNet
Transition
outs
places
Simple
1
* trans*
1
Token
ctokens
*
1
Object
Object
*
* priority: double
read*
Read
Priority
*
inh Inhibitor
Bounded
boundedTokens1 inv:
itokens<=bound
Bounded  Simple
boundedTokens2 inv:
ctokens→size()<=bound
Bounded  Object
“meta-model” with presence conditions
Upon selecting a configuration, a meta-model is derived:
• Having only those elements (classes, attributes, referemces,
constraints) whose presence condition is true
META-MODEL PRODUCT LINES:
150% META-MODEL
14
ins
Place
itokens: int
bound: int
PetriNet
Transition
outs
places
Simple
1
* trans*
1
Token
ctokens
*
1
Object
Object
*
* priority: double
read*
Read
Priority
*
inh Inhibitor
Bounded
boundedTokens1 inv:
itokens<=bound
Bounded  Simple
boundedTokens2 inv:
ctokens→size()<=bound
Bounded  Object
“meta-model” with presence conditions
ins
Place
itokens: int
bound: int
PetriNet
outs
places * trans*
*
*
Transition
priority: double
⟨Simple, Bounded, Priority⟩
boundedTokens1 inv:
itokens<=bound
Bounded  Simple
NEED FOR
ABSTRACTION
15
ins
Place
itokens: int
bound: int
PetriNet
Transition
outs
places
Simple
1
* trans*
1
Token
ctokens
*
1
Object
Object
*
* priority: double
read*
Read
Priority
*
inh Inhibitor
Bounded
boundedTokens1 inv:
itokens<=bound
Bounded  Simple
boundedTokens2 inv:
ctokens→size()<=bound
Bounded  Object
We are stating
the same
constraint for
two different
variants
Find a way to abstract away the differences of different realizations
Simplify writing constraints and transformations
• Ensuring scaling with variant combinations
CONCEPTUAL MMPLs
Make uniform the 150% meta-model
Concept on top of the 150% meta-model
• A canonical representation of common elements
• Binding to different variants
Express expectations on the different variants (constraints)
16
ins
Place
tokens: int
PetriNet
Transition
outs
places * trans*
*
*
posTokens inv:
self.tokens >= 0
PetriNet
+places(): Place[*]
+trans(): Transition[*]
Place
+tokens(): int
Transition
+ins(): Place[*]
+outs(): Place[*]
posTokens inv:
self.tokens() >= 0

context PetriNet
def: places() : Place[∗] = self.places
def: trans() : Transition[∗] = self.trans
context Transition
def: ins() : Place[∗] = self.ins
def: outs() : Place[∗] = self.outs
context Place
[Simple] def: tokens() : Integer = self.itokens
[Object] def: tokens() : Integer = self.ctokens→size()
PL OF BINDINGS
17
Constraints and transformations are written against the concept
Now we can write one constraint, instead of two (with simpler PC):
context Place
[Bounded] inv boundedTokens: self.tokens()<=bound
PetriNet
+places(): Place[*]
+trans(): Transition[*]
Place
+tokens(): int
Transition
+ins(): Place[*]
+outs(): Place[*]
posTokens inv:
self.tokens() >= 0
TRANSFORMATION
PRODUCT LINES (TPLs)
18
Tranformation Definition
• Meta-model
• Rule signatures and contracts (specification)
• Rule bodies
Transformation Product Line (TPL)
• Transformation Definition with variability (bodies with PCs)
BOUNDED TPLs
19
Tranformation Definition
• Meta-model
• Rule signatures and contracts (specification)
• Rule bodies
Transformation Product Line (TPL)
• Transformation Definition with variability (bodies with PCs)
Bounded TPL
• TPL coupled with a CMMPL
TRANSFORMATION
SPECIFICATION
20
Place
Transition
+modify(t : int):
post: self@pre.tokens()+t = self.tokens()
+enabled(): boolean {query}
post: enabled() implies ins()→forAll(p | p.tokens()>0) and
not enabled() implies ins()→exists(p | p.tokens()=0)
+fire():
post: ins()→excludingAll(outs())→forAll(p|p@pre.tokens()<p.tokens()) and
outs()→excludingAll(ins())→forAll(p|p@pre.tokens()>p.tokens())
PetriNet
+simulate(): boolean
post: trans()→select(t|t.enabled())→isEmpty()
+step(): boolean
post: step() implies self@pre.trans()→exists(t|t.enabled())
+pick(s : Set(Transition)): Transition {query}
pre: s→size()>0 and s→forAll(t|t.enabled())
post: s→includes(result)
TPL EXAMPLE
21
operation PetriNet step() : Boolean {
var enabledTrans = self.trans()->select(enabled());
if (enabledTrans->isEmpty()) return false;
else return self.pick(enabledTrans).fire() ;
}
[Simple] operation Place modify(t : Integer) {
self.itokens += t;
}
[Object] operation Place modify(t : Integer) {
if (t>0)
for (i in Sequence{1..t})
self.ctokens.add(new Token);
else if (t<0)
for (i in Sequence{1..-t})
self.ctokens.remove(self.ctokens.random());
}
EXTENDING TPLs
22
context PetriNet
[not Priority] def: pick(s: Set(Transition)): Transition= s→any(true)
[Priority] def: pick(s: Set(Transition)): Transition=
s→any(t | not s→exists(t1| t1.priority>t.priority))
context Transition
[not (Inhibitor or Read or Bounded)]
def: enabled() : Boolean = self.ins()→forAll(tokens()>0)
[Inhibitor and not (Read or Bounded)]
def: enabled() : Boolean = self.ins()→forAll(tokens()>0) and
self.inh→forAll(tokens()=0)
[Inhibitor and Read and not Bounded]
def: enabled() : Boolean = self.ins()→forAll(tokens()>0) and
self.inh→forAll(tokens()=0) and
self.read→forAll(p.tokens()>0)
… (5 more combinations ommited)
Still difficult to extend!
COMPOSING RULE BODIES
OVERRIDING
Override: declares precedence among rule bodies
• Default (super): more specific body overrides more general body
• Other semantics: subs, all
23
context PetriNet
def: pick(s: Set(Transition)): Transition =
s→any(true)
context PetriNet
[Priority]
−− @Override super
def: pick(s: Set(Transition)): Transition=
s→any(t | not s→exists(t1| t1.priority>t.priority))
Merge operators depending on rule signature
• and/or for boolean queries, union/intersection for collections
• Arithmetical operations for queries returning numbers
• Sequential composition of actions for operations changing state
24
context Transition
def: enabled(): Boolean = ins()→forAll(tokens()>0)
COMPOSING RULE BODIES
MERGE
context Transition
−− @Merge and
[Inhibitor] def: enabled(): Boolean = inh→forAll(tokens()=0)
context Transition
−− @Merge and
[Read] def: enabled(): Boolean = read→forAll(tokens()>0)
context Transition
−− @Merge and
[Bounded] def: enabled(): Boolean=outs()→forAll(tokens()<bound)
4combinations
insteadof8
ANALYSIS
Syntactic
• CMMPL and TPL well-formedness:
• No binding/rule body collisions
• No missing bindings/bodies
• Analysing each derivable meta-model/transformation is prohibitive!
• Technique: SAT solving
Semantic
• CMMPL Consistency
• Does some derivable meta-model violate the concept invariants?
• TPL contracts
• Analysing each derivable meta-model/transformation is prohibitive!
• Technique: Lift model finding to TPL
25
LIFTING MODEL
FINDING TO PLS
Model finders
• Input: meta-model +
OCL invariants +
search bound
• Output: valid instance
model (or none)
• USE Validator
Feature explicit meta-model
• Embed the feature model in the meta-model
• Emulate the PCs with OCL invariants
• The result is a valid model, which includes an object representing a
configuration
26
ANALYSING
CONSISTENCY
27
:PetriNet
:Place
:Transition
:FMC
PetriNets=true
Tokens=true
Simple=true
Object=false
Arcs=true
Inhibitor=true
Read=true
Priority=false
Bounded=false
feature-explicit model
itokens = -6
:ins
:trans
:places
model configuration
+
:PetriNet
:Place
:Transition
itokens = -6
:ins
:trans
:places
extract
Does some derivable meta-model violate
the concept invariants?
Model finder
TOOL SUPPORT
Merlin: http://miso.es/tools/merlin/
• Eclipse plugin
Meta-model product lines + transformation product lines
Analysis based on model finding (USE Validator)
• Other analyses: Sat4J
• OCL syntactical correctness
Independent on the transformation
language
• OCL (queries, analysis), can be
mixed with any other language
• EOL
• ETL, EGL (experimental)
28
TOOL SUPPORT
29
MERLIN
http://miso.es/tools/merlin
VALIDATION
RQ1: How much specification effort do TPLs save?
Most derivable transformations are different
TPL size (in LOC) considerable smaller than the total size of
every transformation
30
VALIDATION
RQ2: How much analysis effort do TPLs save?
31
• Extension of the
example (256 configs)
• CMMPL Consistency
analysis
• 20 versions, with
increasing #MMs
violating the invariant
• Comparison with
enumerative approach
10x to 120x faster if <3% MMs violate the invariant
Faster than enumerative (avg) if <42% MMs violate the invariant
Faster than enumerative (worst) if <90% MMs violate the invariant
Only marginally slower (ms) when all MMs violate the invariant
CONCLUSIONS
New notion of transformation product lines (TPLs)
• On top of meta-model product lines (MMPLs)
• Coupled via concepts (abstraction mechanism)
• Transformation specification (contracts)
• Extensibility: composition operators
• Analysis and Verification support (model finding)
Tool support (Merlin)
• Independent on the transformation language
Experiments showing good results
• TPLs are succinct, analysis is efficient
TPLs as (closed) reuse mechanism
32
FUTURE WORK
Apply this notion to other MDE artefacts:
• Model-to-model transformations and code generators (already)
• Editors (graphical, textual)
Better support for contract analysis
Lift other verification techniques, e.g., based on static analysis
Testing!
Refactoring for TPLs
• Factor out common code to concept
33
Juan.deLara@uam.es
@miso_uam http://miso.es/tools/merlin
THANKS!
Juan.deLara@uam.es
@miso_uam http://miso.es/tools/merlin

More Related Content

What's hot

Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011
Andrey Breslav
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and Javascript
Kamil Toman
 

What's hot (20)

Computer Programming- Lecture 4
Computer Programming- Lecture 4Computer Programming- Lecture 4
Computer Programming- Lecture 4
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011
 
C++ Chapter III
C++ Chapter IIIC++ Chapter III
C++ Chapter III
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 
C++ Chapter I
C++ Chapter IC++ Chapter I
C++ Chapter I
 
Fantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and JavascriptFantom - Programming Language for JVM, CLR, and Javascript
Fantom - Programming Language for JVM, CLR, and Javascript
 
Pragmatic functional refactoring with java 8
Pragmatic functional refactoring with java 8Pragmatic functional refactoring with java 8
Pragmatic functional refactoring with java 8
 
3 kotlin vs. java- what kotlin has that java does not
3  kotlin vs. java- what kotlin has that java does not3  kotlin vs. java- what kotlin has that java does not
3 kotlin vs. java- what kotlin has that java does not
 
C++ Chapter IV
C++ Chapter IVC++ Chapter IV
C++ Chapter IV
 
C++ Presentation
C++ PresentationC++ Presentation
C++ Presentation
 
C++ theory
C++ theoryC++ theory
C++ theory
 
C++ references
C++ referencesC++ references
C++ references
 
OpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ Programming
 
06.Loops
06.Loops06.Loops
06.Loops
 
Functional programming
Functional programmingFunctional programming
Functional programming
 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming ii
 
Chapter 2 Java Methods
Chapter 2 Java MethodsChapter 2 Java Methods
Chapter 2 Java Methods
 
Idiomatic C++
Idiomatic C++Idiomatic C++
Idiomatic C++
 
13 Strings and Text Processing
13 Strings and Text Processing13 Strings and Text Processing
13 Strings and Text Processing
 

Similar to MTPLs

Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
IIUM
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
ecomputernotes
 

Similar to MTPLs (20)

Model Transformation Reuse
Model Transformation ReuseModel Transformation Reuse
Model Transformation Reuse
 
Omid: scalable and highly available transaction processing for Apache Phoenix
Omid: scalable and highly available transaction processing for Apache PhoenixOmid: scalable and highly available transaction processing for Apache Phoenix
Omid: scalable and highly available transaction processing for Apache Phoenix
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and Java
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
0-Slot11-12-Pointers.pdf
0-Slot11-12-Pointers.pdf0-Slot11-12-Pointers.pdf
0-Slot11-12-Pointers.pdf
 
The STL
The STLThe STL
The STL
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.ppt
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
 
Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
 
Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”Bartosz Milewski, “Re-discovering Monads in C++”
Bartosz Milewski, “Re-discovering Monads in C++”
 
Advance python
Advance pythonAdvance python
Advance python
 
19csharp
19csharp19csharp
19csharp
 
19c
19c19c
19c
 
Dynamic Objects,Pointer to function,Array & Pointer,Character String Processing
Dynamic Objects,Pointer to function,Array & Pointer,Character String ProcessingDynamic Objects,Pointer to function,Array & Pointer,Character String Processing
Dynamic Objects,Pointer to function,Array & Pointer,Character String Processing
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
 

More from miso_uam

More from miso_uam (20)

Model-driven engineering for AR
Model-driven engineering for ARModel-driven engineering for AR
Model-driven engineering for AR
 
Capone.pdf
Capone.pdfCapone.pdf
Capone.pdf
 
MLE_keynote.pdf
MLE_keynote.pdfMLE_keynote.pdf
MLE_keynote.pdf
 
Multi21
Multi21Multi21
Multi21
 
MLMPLs
MLMPLsMLMPLs
MLMPLs
 
Scientific writing
Scientific writingScientific writing
Scientific writing
 
Facets_UCM
Facets_UCMFacets_UCM
Facets_UCM
 
SLE_MIP08
SLE_MIP08SLE_MIP08
SLE_MIP08
 
mtATL
mtATLmtATL
mtATL
 
MĂĄster en MĂŠtodos Formales en IngenierĂ­a InformĂĄtica
MĂĄster en MĂŠtodos Formales en IngenierĂ­a InformĂĄticaMĂĄster en MĂŠtodos Formales en IngenierĂ­a InformĂĄtica
MĂĄster en MĂŠtodos Formales en IngenierĂ­a InformĂĄtica
 
Analysing-MMPLs
Analysing-MMPLsAnalysing-MMPLs
Analysing-MMPLs
 
Facets
FacetsFacets
Facets
 
kite
kitekite
kite
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGill
 
Miso
MisoMiso
Miso
 
DSLcomet
DSLcometDSLcomet
DSLcomet
 
SICOMORO
SICOMOROSICOMORO
SICOMORO
 
ReusingMT
ReusingMTReusingMT
ReusingMT
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experiments
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

MTPLs

  • 1. MODEL TRANSFORMATION PRODUCT LINES MODELS’2018, Copenhagen J. de Lara1, E. Guerra1, M. Chechik2, R. Salay2 1Universidad AutĂłnoma de Madrid (Spain) 2University of Toronto (Canada)
  • 2. LET’S WRITE A SIMULATOR FOR PETRI NETS… 2 ins Place tokens: int PetriNet Transition outs places * trans* * * operation Transition fire() { for (p in self.ins) p.tokens-=1; for (p in self.outs) p.tokens+=1; } …
  • 3. DOES THIS LOOK FAMILIAR? 3 ins Place PetriNet Transition outs places * trans* * * Token tokens * operation Transition fire() { for (p in self.ins) p.tokens.remove(p.tokens.random()); for (p in self.outs) p.tokens.add(new Token); } … ins Place tokens: int PetriNet Transition outs places * trans* * * operation Transition fire() { for (p in self.ins) p.tokens-=1; for (p in self.outs) p.tokens+=1; } …
  • 4. NOT ONLY REALIZATIONS, BUT VARIANTS… 4 ins Place tokens: int bound: int PetriNet Transition outs places * trans* * * Bounded places ins Place tokens: int PetriNet Transition outs places * trans* * * Transition priorities priority: double ins Place tokens: int PetriNet Transition outs places * trans* * * Read arcs read * ins Place tokens: int PetriNet Transition outs places * trans* * * Inhibitor arcs inh *
  • 5. …WHICH WE MAY NEED TO COMBINE 5 ins Place tokens: int bound: int PetriNet outs places * trans* * * Bound + priorities (int) Transition priority: double ins Place bound: int PetriNet outs places * trans* * * Bound + priorities (class) Transition priority: double Token tokens * ins Place PetriNet Transition outs places * trans* * * read * tokens: int bound: int Bound + read arcs (int) ins Place PetriNet Transition outs places * trans* * * read * bound: int Bound + read arcs (class)Token tokens *
  • 6. ins Place tokens: int bound: int PetriNet outs places * trans* * * Bound + priorities (int) Transition priority: double ins Place bound: int PetriNet outs places * trans* * * Bound + priorities (class) Transition priority: double Token tokens * ins Place PetriNet Transition outs places * trans* * * read * tokens: int bound: int Bound + read arcs (int) ins Place PetriNet Transition outs places * trans* * * read * bound: int Bound + read arcs (class)Token tokens * …WHICH WE MAY NEED TO COMBINE 6 32 combinations
  • 7. ins Place tokens: int bound: int PetriNet outs places * trans* * * Bound + priorities (int) Transition priority: double ins Place bound: int PetriNet outs places * trans* * * Bound + priorities (class) Transition priority: double Token tokens * ins Place PetriNet Transition outs places * trans* * * read * tokens: int bound: int Bound + read arcs (int) ins Place PetriNet Transition outs places * trans* * * read * bound: int Bound + read arcs (class)Token tokens * …AND WRITE TRANSFORMATIONS FOR 7 Now go and write 32 transformations
  • 8. ins Place tokens: int bound: int PetriNet outs places * trans* * * Bound + priorities (int) Transition priority: double ins Place bound: int PetriNet outs places * trans* * * Bound + priorities (class) Transition priority: double Token tokens * ins Place PetriNet Transition outs places * trans* * * read * tokens: int bound: int Bound + read arcs (int) ins Place PetriNet Transition outs places * trans* * * read * bound: int Bound + read arcs (class)Token tokens * …AND MAINTAIN 8 Do we add weights to the arcs?
  • 9. 9
  • 10. WHAT WE NEED A succinct mechanism to express meta-model variants Methods to write transformations for all these variants • Compact: without writing many similar-but-not-quite-the- same transformations • Usable: abstract away from details of other variants • Extensible: easy to add new variants • Correct: express and check expectations on different parts of the transformation 10
  • 11. OUR CONTRIBUTION 11 A notion of transformation product line (TPL), which is: • Compact: transformation fragments, annotated with their activation (presence) conditions • Usable: abstraction mechanism that hides details (concepts) • Extensible: by composition operators • Correct: by profiting from (OCL) contracts and analysis methods based on model finding Building on a notion of meta-model product line (MMPL) [GLCS18] Tool support: Merlin Experiments that show the benefits of analysis at the TPL level [GLCS18] Guerra, de Lara, Chechik, Salay. 2018. Analysing Meta-Model Product Lines. Proc. SLE, pp.: 171-184.
  • 12. META-MODEL PRODUCT LINES: FEATURE MODEL Feature model to express the variability space Features and their allowed combinations Feature diagram Configurations 12 mandatory optional alternative or PetriNets Tokens Simple Object Priority FM = {PetriNets, Tokens, Simple, Object, Arcs, Inhibitor, Read, Priority, Bounded}, PetriNets  Tokens  Arcs  ((Simple  ÂŹObject)  (ÂŹSimple  Object)) Arcs Inhibitor Read Bounded Legend P = {⟨Simple⟩, ⟨Simple, Inhibitor, Bounded⟩, ⟨Object, Read, Priority⟩, . . . } (32 are possible, only leaf features shown)
  • 13. META-MODEL PRODUCT LINES: 150% META-MODEL 13 ins Place itokens: int bound: int PetriNet Transition outs places Simple 1 * trans* 1 Token ctokens * 1 Object Object * * priority: double read* Read Priority * inh Inhibitor Bounded boundedTokens1 inv: itokens<=bound Bounded  Simple boundedTokens2 inv: ctokens→size()<=bound Bounded  Object “meta-model” with presence conditions Upon selecting a configuration, a meta-model is derived: • Having only those elements (classes, attributes, referemces, constraints) whose presence condition is true
  • 14. META-MODEL PRODUCT LINES: 150% META-MODEL 14 ins Place itokens: int bound: int PetriNet Transition outs places Simple 1 * trans* 1 Token ctokens * 1 Object Object * * priority: double read* Read Priority * inh Inhibitor Bounded boundedTokens1 inv: itokens<=bound Bounded  Simple boundedTokens2 inv: ctokens→size()<=bound Bounded  Object “meta-model” with presence conditions ins Place itokens: int bound: int PetriNet outs places * trans* * * Transition priority: double ⟨Simple, Bounded, Priority⟩ boundedTokens1 inv: itokens<=bound Bounded  Simple
  • 15. NEED FOR ABSTRACTION 15 ins Place itokens: int bound: int PetriNet Transition outs places Simple 1 * trans* 1 Token ctokens * 1 Object Object * * priority: double read* Read Priority * inh Inhibitor Bounded boundedTokens1 inv: itokens<=bound Bounded  Simple boundedTokens2 inv: ctokens→size()<=bound Bounded  Object We are stating the same constraint for two different variants Find a way to abstract away the differences of different realizations Simplify writing constraints and transformations • Ensuring scaling with variant combinations
  • 16. CONCEPTUAL MMPLs Make uniform the 150% meta-model Concept on top of the 150% meta-model • A canonical representation of common elements • Binding to different variants Express expectations on the different variants (constraints) 16 ins Place tokens: int PetriNet Transition outs places * trans* * * posTokens inv: self.tokens >= 0 PetriNet +places(): Place[*] +trans(): Transition[*] Place +tokens(): int Transition +ins(): Place[*] +outs(): Place[*] posTokens inv: self.tokens() >= 0 
  • 17. context PetriNet def: places() : Place[∗] = self.places def: trans() : Transition[∗] = self.trans context Transition def: ins() : Place[∗] = self.ins def: outs() : Place[∗] = self.outs context Place [Simple] def: tokens() : Integer = self.itokens [Object] def: tokens() : Integer = self.ctokens→size() PL OF BINDINGS 17 Constraints and transformations are written against the concept Now we can write one constraint, instead of two (with simpler PC): context Place [Bounded] inv boundedTokens: self.tokens()<=bound PetriNet +places(): Place[*] +trans(): Transition[*] Place +tokens(): int Transition +ins(): Place[*] +outs(): Place[*] posTokens inv: self.tokens() >= 0
  • 18. TRANSFORMATION PRODUCT LINES (TPLs) 18 Tranformation Definition • Meta-model • Rule signatures and contracts (specification) • Rule bodies Transformation Product Line (TPL) • Transformation Definition with variability (bodies with PCs)
  • 19. BOUNDED TPLs 19 Tranformation Definition • Meta-model • Rule signatures and contracts (specification) • Rule bodies Transformation Product Line (TPL) • Transformation Definition with variability (bodies with PCs) Bounded TPL • TPL coupled with a CMMPL
  • 20. TRANSFORMATION SPECIFICATION 20 Place Transition +modify(t : int): post: self@pre.tokens()+t = self.tokens() +enabled(): boolean {query} post: enabled() implies ins()→forAll(p | p.tokens()>0) and not enabled() implies ins()→exists(p | p.tokens()=0) +fire(): post: ins()→excludingAll(outs())→forAll(p|p@pre.tokens()<p.tokens()) and outs()→excludingAll(ins())→forAll(p|p@pre.tokens()>p.tokens()) PetriNet +simulate(): boolean post: trans()→select(t|t.enabled())→isEmpty() +step(): boolean post: step() implies self@pre.trans()→exists(t|t.enabled()) +pick(s : Set(Transition)): Transition {query} pre: s→size()>0 and s→forAll(t|t.enabled()) post: s→includes(result)
  • 21. TPL EXAMPLE 21 operation PetriNet step() : Boolean { var enabledTrans = self.trans()->select(enabled()); if (enabledTrans->isEmpty()) return false; else return self.pick(enabledTrans).fire() ; } [Simple] operation Place modify(t : Integer) { self.itokens += t; } [Object] operation Place modify(t : Integer) { if (t>0) for (i in Sequence{1..t}) self.ctokens.add(new Token); else if (t<0) for (i in Sequence{1..-t}) self.ctokens.remove(self.ctokens.random()); }
  • 22. EXTENDING TPLs 22 context PetriNet [not Priority] def: pick(s: Set(Transition)): Transition= s→any(true) [Priority] def: pick(s: Set(Transition)): Transition= s→any(t | not s→exists(t1| t1.priority>t.priority)) context Transition [not (Inhibitor or Read or Bounded)] def: enabled() : Boolean = self.ins()→forAll(tokens()>0) [Inhibitor and not (Read or Bounded)] def: enabled() : Boolean = self.ins()→forAll(tokens()>0) and self.inh→forAll(tokens()=0) [Inhibitor and Read and not Bounded] def: enabled() : Boolean = self.ins()→forAll(tokens()>0) and self.inh→forAll(tokens()=0) and self.read→forAll(p.tokens()>0) … (5 more combinations ommited) Still difficult to extend!
  • 23. COMPOSING RULE BODIES OVERRIDING Override: declares precedence among rule bodies • Default (super): more specific body overrides more general body • Other semantics: subs, all 23 context PetriNet def: pick(s: Set(Transition)): Transition = s→any(true) context PetriNet [Priority] −− @Override super def: pick(s: Set(Transition)): Transition= s→any(t | not s→exists(t1| t1.priority>t.priority))
  • 24. Merge operators depending on rule signature • and/or for boolean queries, union/intersection for collections • Arithmetical operations for queries returning numbers • Sequential composition of actions for operations changing state 24 context Transition def: enabled(): Boolean = ins()→forAll(tokens()>0) COMPOSING RULE BODIES MERGE context Transition −− @Merge and [Inhibitor] def: enabled(): Boolean = inh→forAll(tokens()=0) context Transition −− @Merge and [Read] def: enabled(): Boolean = read→forAll(tokens()>0) context Transition −− @Merge and [Bounded] def: enabled(): Boolean=outs()→forAll(tokens()<bound) 4combinations insteadof8
  • 25. ANALYSIS Syntactic • CMMPL and TPL well-formedness: • No binding/rule body collisions • No missing bindings/bodies • Analysing each derivable meta-model/transformation is prohibitive! • Technique: SAT solving Semantic • CMMPL Consistency • Does some derivable meta-model violate the concept invariants? • TPL contracts • Analysing each derivable meta-model/transformation is prohibitive! • Technique: Lift model finding to TPL 25
  • 26. LIFTING MODEL FINDING TO PLS Model finders • Input: meta-model + OCL invariants + search bound • Output: valid instance model (or none) • USE Validator Feature explicit meta-model • Embed the feature model in the meta-model • Emulate the PCs with OCL invariants • The result is a valid model, which includes an object representing a configuration 26
  • 27. ANALYSING CONSISTENCY 27 :PetriNet :Place :Transition :FMC PetriNets=true Tokens=true Simple=true Object=false Arcs=true Inhibitor=true Read=true Priority=false Bounded=false feature-explicit model itokens = -6 :ins :trans :places model configuration + :PetriNet :Place :Transition itokens = -6 :ins :trans :places extract Does some derivable meta-model violate the concept invariants? Model finder
  • 28. TOOL SUPPORT Merlin: http://miso.es/tools/merlin/ • Eclipse plugin Meta-model product lines + transformation product lines Analysis based on model finding (USE Validator) • Other analyses: Sat4J • OCL syntactical correctness Independent on the transformation language • OCL (queries, analysis), can be mixed with any other language • EOL • ETL, EGL (experimental) 28
  • 30. VALIDATION RQ1: How much specification effort do TPLs save? Most derivable transformations are different TPL size (in LOC) considerable smaller than the total size of every transformation 30
  • 31. VALIDATION RQ2: How much analysis effort do TPLs save? 31 • Extension of the example (256 configs) • CMMPL Consistency analysis • 20 versions, with increasing #MMs violating the invariant • Comparison with enumerative approach 10x to 120x faster if <3% MMs violate the invariant Faster than enumerative (avg) if <42% MMs violate the invariant Faster than enumerative (worst) if <90% MMs violate the invariant Only marginally slower (ms) when all MMs violate the invariant
  • 32. CONCLUSIONS New notion of transformation product lines (TPLs) • On top of meta-model product lines (MMPLs) • Coupled via concepts (abstraction mechanism) • Transformation specification (contracts) • Extensibility: composition operators • Analysis and Verification support (model finding) Tool support (Merlin) • Independent on the transformation language Experiments showing good results • TPLs are succinct, analysis is efficient TPLs as (closed) reuse mechanism 32
  • 33. FUTURE WORK Apply this notion to other MDE artefacts: • Model-to-model transformations and code generators (already) • Editors (graphical, textual) Better support for contract analysis Lift other verification techniques, e.g., based on static analysis Testing! Refactoring for TPLs • Factor out common code to concept 33