SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Computer Programming- Lecture 4
Computer Programming- Lecture 4Computer Programming- Lecture 4
Computer Programming- Lecture 4Dr. Md. Shohel Sayeed
 
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
 
C++ Presentation
C++ PresentationC++ Presentation
C++ PresentationCarson Wilber
 
C++ theory
C++ theoryC++ theory
C++ theoryShyam Khant
 
C++ references
C++ referencesC++ references
C++ referencescorehard_by
 
OpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpenGurukul : Language : C++ Programming
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
 
Functional programming
Functional programmingFunctional programming
Functional programmingPrashant Kalkar
 
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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 
The STL
The STLThe STL
The STLadil raja
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.pptWaheedAnwar20
 
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
 
19csharp
19csharp19csharp
19csharpSireesh K
 
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
 

Ähnlich wie 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
 

Mehr von 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
 
Multi21
Multi21Multi21
Multi21miso_uam
 
MLMPLs
MLMPLsMLMPLs
MLMPLsmiso_uam
 
Scientific writing
Scientific writingScientific writing
Scientific writingmiso_uam
 
Facets_UCM
Facets_UCMFacets_UCM
Facets_UCMmiso_uam
 
SLE_MIP08
SLE_MIP08SLE_MIP08
SLE_MIP08miso_uam
 
mtATL
mtATLmtATL
mtATLmiso_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
 
Facets
FacetsFacets
Facetsmiso_uam
 
kite
kitekite
kitemiso_uam
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGillmiso_uam
 
Miso
MisoMiso
Misomiso_uam
 
DSLcomet
DSLcometDSLcomet
DSLcometmiso_uam
 
SICOMORO
SICOMOROSICOMORO
SICOMOROmiso_uam
 
ReusingMT
ReusingMTReusingMT
ReusingMTmiso_uam
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experimentsmiso_uam
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017miso_uam
 

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

KĂźrzlich hochgeladen

[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)Dimitrios Platis
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfSrushith Repakula
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Maxim Salnikov
 
微信号购买
微信号购买微信号购买
微信号购买westwaterchamplin107
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmuxevmux96
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphNeo4j
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIInflectra
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Flutter Agency
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNeo4j
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaNeo4j
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024SimonedeGijt
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Eraconfluent
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfryanfarris8
 

KĂźrzlich hochgeladen (20)

[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)[GRCPP] Introduction to concepts (C++20)
[GRCPP] Introduction to concepts (C++20)
 
Abortion Pill Prices Aliwal North ](+27832195400*)[ 🏥 Women's Abortion Clinic...
Abortion Pill Prices Aliwal North ](+27832195400*)[ 🏥 Women's Abortion Clinic...Abortion Pill Prices Aliwal North ](+27832195400*)[ 🏥 Women's Abortion Clinic...
Abortion Pill Prices Aliwal North ](+27832195400*)[ 🏥 Women's Abortion Clinic...
 
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
Abortion Clinic in Midrand [(+27832195400*)]🏥Safe Abortion Pills In Midrand |...
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
微信号购买
微信号购买微信号购买
微信号购买
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
Abortion Clinic in Bloemfontein [(+27832195400*)]🏥Safe Abortion Pills In Bloe...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 

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