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

Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewMarkus Schneider
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Andrey Breslav
 
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 InterfacesGanesh Samarthyam
 
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 JavascriptKamil Toman
 
Pragmatic functional refactoring with java 8
Pragmatic functional refactoring with java 8Pragmatic functional refactoring with java 8
Pragmatic functional refactoring with java 8RichardWarburton
 
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 notSergey Bandysik
 
OpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
 
Functional programming ii
Functional programming iiFunctional programming ii
Functional programming iiPrashant Kalkar
 
13 Strings and Text Processing
13 Strings and Text Processing13 Strings and Text Processing
13 Strings and Text ProcessingIntro C# Book
 

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

Model Transformation Reuse
Model Transformation ReuseModel Transformation Reuse
Model Transformation Reusemiso_uam
 
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 PhoenixDataWorks Summit
 
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.ProtoJoel Falcou
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and JavaSasha Goldshtein
 
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++Manzoor ALam
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented TechnologiesUmesh Nikam
 
0-Slot11-12-Pointers.pdf
0-Slot11-12-Pointers.pdf0-Slot11-12-Pointers.pdf
0-Slot11-12-Pointers.pdfssusere19c741
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMax Kleiner
 
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?Kevin Pilch
 
Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2IIUM
 
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++”Platonov Sergey
 
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 ProcessingMeghaj Mallick
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17ecomputernotes
 
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.pptxMarco Parenzan
 

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
 
19c
19c19c
19c
 
19csharp
19csharp19csharp
19csharp
 
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

Model-driven engineering for AR
Model-driven engineering for ARModel-driven engineering for AR
Model-driven engineering for ARmiso_uam
 
Capone.pdf
Capone.pdfCapone.pdf
Capone.pdfmiso_uam
 
MLE_keynote.pdf
MLE_keynote.pdfMLE_keynote.pdf
MLE_keynote.pdfmiso_uam
 
Scientific writing
Scientific writingScientific writing
Scientific writingmiso_uam
 
Facets_UCM
Facets_UCMFacets_UCM
Facets_UCMmiso_uam
 
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áticamiso_uam
 
Analysing-MMPLs
Analysing-MMPLsAnalysing-MMPLs
Analysing-MMPLsmiso_uam
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGillmiso_uam
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experimentsmiso_uam
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017miso_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

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

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