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
 
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

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

Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 

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