SlideShare a Scribd company logo
1 of 32
A-POSTERIORI TYPING
FOR MODEL-DRIVEN
ENGINEERING
J. de Lara, E. Guerra, J. Sánchez Cuadrado
Modelling&Software Engineering Research Group
http://miso.es
Universidad Autónoma de Madrid (Spain)
MODELS’2015, Ottawa (Canada)
Constructive typing
• Creation of objects and classification
are inseparable
Lacks flexibility
• Objects cannot change their type at
run-time (and retain its identity)
Hinders reuse
• An operation defined for a meta-model
cannot be used for another one
MOTIVATION
2
Task
start: Date
duration: int
review: Task
start= 8/5/15
duration=30
creation «instance of»
Tasks meta-model
model
Constructive typing
• Creation of objects and classification
are inseparable
Lacks flexibility
• Objects cannot change their type at
run-time (and retain its identity)
Hinders reuse
• An operation defined for a meta-model
cannot be used for another one
MOTIVATION
3
review: Task
start= 8/5/15
duration=10
model
Task
start: Date
duration: int
review: Task
start= 8/5/15
duration=30
creation «instance of»
Tasks meta-model
model
Constructive typing
• Creation of objects and classification
are inseparable
Lacks flexibility
• Objects cannot change their type at
run-time (and retain its identity)
Hinders reuse
• An operation defined for a meta-model
cannot be used for another one
MOTIVATION
4
Task
start: Date
duration: int
review: Task
start= 8/5/15
duration=30
creation «instance of»
Tasks meta-model
model
review: Task
start= 8/5/15
duration=0
model
Constructive typing
• Creation of objects and classification
are inseparable
Lacks flexibility
• Objects cannot change their type at
run-time (and retain its identity)
Hinders reuse
• An operation defined for a meta-model
cannot be used for another one
MOTIVATION
5
Task
start: Date
duration: int
review: Task
start= 8/5/15
duration=30
creation «instance of»
Tasks meta-model
model
review: Milestone
start= 8/5/15
duration=0
model
Constructive typing
• Creation of objects and classification
are inseparable
Lacks flexibility
• Objects cannot change their type at
run-time (and retain its identity)
Hinders reuse
• An operation defined for a meta-model
cannot be used for another one
MOTIVATION
6
Task
start: Date
duration: int
review: Task
start= 8/5/15
duration=30
creation «instance of»
Tasks meta-model
model
Measurable
quantity: int
Measuring MM
review: Milestone
start= 8/5/15
duration=0
model
A more flexible typing mechanism for MDE
Decouple instantiation from classification
• Interfaces in object-oriented programming
• Roles in role-based programming languages
Allow dynamic typing and multiple classifiers for objects
Type and instance-level reclassification specifications
• Transformation by reclassification
• Flexible reuse of model management operations
Prototype implementation in our MetaDepth tool
GOALS AND
CONTRIBUTIO
NS
7
design space of possible MDE typings
a-posteriori (AP) typing
• specification: type-level vs instance-level
• analysis
tool support & applications
conclusions and future work
AGENDA
8
DESIGN SPACE FOR
TYPINGS (1/2)
9
Typing in MDE
dynamicity
static dynamic
classification
time
creation
a-posteriori
#classifiers
single multiple
bounded
optional mandatory alternative
…
Can we add classifiers
for an object after it is
created?
Can an object change
its type at run-time?
How many classifiers
can an object have?
Defined a-priori?
DESIGN SPACE FOR
TYPINGS (2/2)
10
Typing in MDE
totality
total partial
#model
types
single multiple
levels
two multiple
optional mandatory alternative
Can a model be
typed by multiple
meta-models?
Can an object
lack type w.r.t.
a type meta-
model?
Is type equivalence
checked by name
or by structure?
type
equivalence
structural
nominal
How many
meta-levels at
the same time
can be used?
DESIGN SPACE FOR
TYPINGS (2/2)
11
Typing in MDE
totality
total partial
#model
types
single multiple
levels
two multiple
optional mandatory alternative
Can a model be
typed by multiple
meta-models?
Can an object
lack type w.r.t.
a type meta-
model?
Is type equivalence
checked by name
or by structure?
type
equivalence
structural
nominal
How many
meta-levels at
the same time
can be used?
Mainstream MDE
approaches have
made the less
flexible choices
in the typing space
AP TYPING MOTIVATION:
REUSE
12
Measurable
quantity: int
Schedulable
date: Date
review: Task
Scheduling MM Measuring MM
model
«instance of» «instance of»
start= 8/5/15
duration= 30
name= “rev”
«Schedulable,Measurable»
*
*
res
Task
start: Date
duration: int
name: String
Resource
Person
owner
assigned
1..*
creation meta-model
role meta-models
creation
«instance of»
a-posteriori typingcreation typing
operation
typing of operation
applicable to
13
AP TYPING MOTIVATION:
FLEXIBLE REUSE
*topics
*
*
res
Task
start: Date
duration: int
name: String
Tasks meta-model (constructive types)
Resource
Person
owner
assigned
1..* 1..*
0..3
reviewsArticle
title: String
Conference meta-model (dynamic types)
Reviewer
Authorauthors
Topic
desc: String
«Author»
p2: Person
«Reviewer»
p1: Person
«Article»
r: Resource
:owner
t1:Task
start: 8/5/15
duration: 30
name: “rev”
:res
:assigned
«Author,Reviewer»
p2: Person
«Reviewer»
p1: Person
«Article»
r: Resource
:owner
t1:Task
start: 8/5/15
duration: 30
name: “rev”
:res
:assigned
«Author»
p3: Person
«Article»
s: Resource
:owner
t2:Task
start: 9/5/15
duration: 30
name: “rev”
:res
:assigned
the model
changes
and gets
retyped
creation «instance of»
model
• A Person (constructive type) is only a Reviewer (a posteriori type)
when some condition is met.
SPECIFYING AP TYPINGS
AT THE TYPE-LEVEL
14
Schedulable
date: Date
span: double
review: Task
Tasks meta-model ( MMC )
start= 8/5/15
/months= 1
duration= 30
name= “rev”
Scheduling MM ( MMR )
Task
start: Date
duration: int
name: String
Typing Specification
Task  Schedulable
self.start  date
/months: double=self.duration/30  span
«Schedulable»
«date»
«span»
creation «instance of»
(constructive)
«instance of»
(a-posteriori)
• Derived attributes (months) defined in the typing
specification.
• Typing rules: ensure correctness, see paper
TYPE-LEVEL AP TYPING
15
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
“Scheduling glasses”
Operations
review:
Schedulable
date= 8/5/15
span= 1
{review, writing}
{1, 3}
Schedulable.allInstances()
writing:
Schedulable
date= 15/3/15
span= 3
Schedulable.allInstances()->
collect(span)
16
TYPE-LEVEL TYPING IN THE
TYPING SPACE
type-level AP typing
totality
total partial
#model
types
single multiple
dynamicity
static dynamic
classification
time
creation
a-posteriori #classifiers
single multiple
bounded
• Objects with different creation type can have same AP type
• Objects with same creation type cannot have different AP
type
SPECIFYING AP TYPINGS
AT THE INSTANCE LEVEL
17
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
/months= 1
duration= 30
name= “rev”
«Schedulable»
«date»
«instance of»
(a-posteriori)
Schedulable
Scheduling MM (MMR)
Typing Specification
Task.allInstances()->select(duration<80)
 Schedulable
self.start  date
/months: double=self.duration/30  span
Instance model of Tasks ( MMC )
«span»
• Typing defined by queries.
• Derived attributes defined by queries as well.
INSTANCE-LEVEL AP TYPING
18
Operations
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
review: Schedulable
date= 8/5/15
span= 1
Schedulable.allInstances()->
collect(span)
{review}
{1}
Schedulable.allInstances()
“Scheduling glasses”
INSTANCE-LEVEL AP TYPING
19
Operations
date: Date
span: double
writing: Task
start= 15/3/15
duration= 60
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
review:
Schedulable
date= 8/5/15
span= 1
Schedulable.allInstances()->
collect(span)
{review, writing}
{1, 2}
Schedulable.allInstances()
“Scheduling glasses”
writing:
Schedulable
date= 15/3/15
span= 2
20
instance-level AP typing
totality
total partial
#model
types
single multiple
dynamicity
static dynamic
classification
time
creation
a-posteriori #classifiers
single multiple
bounded
INSTANCE-LEVEL TYPING IN
THE TYPING SPACE
• Objects with same creation type can have different AP type
ANALYSIS
TYPE-LEVEL AP TYPING
21
Schedulable
date: Date
span: double
Tasks meta-model ( MMC ) Scheduling MM ( MMR )
Task
start: Date
duration: int
name: String
Typing Specification
Task  Schedulable
self.start  date
/months: double=self.duration/30  span
• Creation and role meta-models may have OCL constraints.
• Executability: Can some “Tasks” models become valid
Scheduling models?.
• Totality: Can all Tasks models become valid Scheduling
model?.
• Surjectivity: Can every Scheduling instance be obtained via
retyping some Tasks instance?
• Analysed “merging” both meta-models and using SAT solving
(details in paper)
ANALYSIS
INSTANCE-LEVEL AP TYPING
22
• Dynamic type safety: can an AP spec lead to unsafe typings?
• Can be statically analysed via query rewriting:
Can “reviews” contain objects not typed as “Article”? 
Can “res” (of appropriate Tasks) contain something not a “Resource”?
• Details in paper
Typing Specification
Resource.allInstances()  Article
self.owner  authors
Resource.allInstances()->collect(owner)  Author
Task.allInstances()->select(name=“rev”)
->collect(assigned)  Reviewer
Task.allInstances()->select(name=“rev” and
assigned->includes(self))->collect(res)  reviews
Conference meta-model (MMR)
Article
1..*
0..3reviews
ReviewerAuthor
authors
model
*
*
res
Task
start: Date
duration: int
name: String
Tasks meta-model (MMC)
Resource
Person
owner
assigned
1..*
creation
// Model
Tasks someTasks {
Task t0 {
start = "30/04/2015";
duration = 30;
name = "coding";
}
}
TOOL SUPPORT
23
MetaDepth
• Multi-level textual modelling
• Integrated with the Epsilon languages
Type and instance level specifications
• EOL for queries in instance-level specs
Dump of models with different typings
Analysis of type-level specs
• Integration with the USE validator
• Bidirectional reclassification
• Reclassification totality and surjectivity
// Meta-model
Model Tasks {
Node Task {
start : Date;
duration : int;
name : String;
}
}
APPLICATIONS:
BX MODEL TRANSFORMATIONS
Simple bidirectional model transformations by reclassification
24
APPLICATIONS:
BX MODEL TRANSFORMATIONS
Simple bidirectional model transformations by reclassification
25
type Factory PetriNet {
Conveyor::parts > Place::tokens,
Generator::outps > Transition::outs, Terminator::inps > Transition::ins,
Assembler::inps > Transition::ins, Assembler::outps > Transition::outs,
}
APPLICATIONS:
BX MODEL TRANSFORMATIONS
Simple bidirectional model transformations by reclassification
26
Forward reclassification
Factory example { // 1st typing
Conveyor p {}
Terminator t { inps= [p]; }
}
Factory example { // 2nd typing
Conveyor p {}
Assembler t { inps= [p]; }
}
APPLICATIONS:
BX MODEL TRANSFORMATIONS
27
PetriNet example {
Place p {}
Transition t { ins = [p]; }
}
MetaDepth console
> dump example as Factory
The typing specification can also be used backwards!
Might yield multiple AP typings for a model
// Model witness with no Petri net equivalent
Factory noRefinementWitness {
Assembler assembler2 { outps= [conveyor2, conveyor1]; }
Conveyor conveyor1 { name= "string1"; }
Conveyor conveyor2 { name= "string1"; }
Generator generator2 { outps= [conveyor1]; }
Part part2 {
qa = true;
} // This part would become a token outside any Place
}
APPLICATIONS:
BX MODEL TRANSFORMATIONS
28
The reclassification is not total
• Equivalently, the backwards reclassification is not surjective
The solver produces a witness
• A Factory model that cannot be reclassified into a Petri net
APPLICATIONS:
REUSE OF OPERATIONS
Simulator for Petri nets can be reused “as is” for Factory
• Provide an AP typing from Factory to Petri nets
• Factory models become typed as Petri nets
29
// EOL excerpt of the simulator
operation Transition enabled() : Boolean {
return self.ins.forAll(p| p.tokens.size()>0);
}
operation step() : Boolean {
var enabled : Set(Transition) := Transition.all.select( t | t.enabled());
... // fire one random Transition from enabled
}
APPLICATIONS:
FLEXIBLE REUSE
30
// Type parts as tokens only if QA is passed
type Factory PetriNet inst {
$Conveyor.all$ > Place with {
/sp : Token[*] = $self.parts.select(p|p.qa=true)$ > tokens
}
$Part.all.select( p | p.qa = true )$ > Token
}
CONCLUSIONS AND
FUTURE WORK
AP typing is a more flexible approach to typing in MDE
• Decoupled from creation type
• Dynamic
Flexible reuse, transformation by reclassification, analysis
Improve tool support
Exploit structural typing
Annotations to restrict features of AP typing specs:
• Non-overlapping role classes
31
THANKS!
Questions?
Juan.deLara@uam.es
32
http://www.miso.es
modelling &
software engineering
research group

More Related Content

Similar to A-posteriori typing for model-driven engineering

Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stack
Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stackNathaniel Cook - Forecasting Time Series Data at scale with the TICK stack
Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stackPyData
 
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typingApproaches to Model Transformation Reuse: from Concepts to A-posteriori typing
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typingmiso_uam
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12Terry Yoast
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLGeorge Simov
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksStoyan Nikolov
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#ANURAG SINGH
 
Design patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjsDesign patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjsRavi Bhadauria
 
MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle Databricks
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptManivannan837728
 
Bca2030 object oriented programming – c++
Bca2030   object oriented programming – c++Bca2030   object oriented programming – c++
Bca2030 object oriented programming – c++smumbahelp
 
9781285852744 ppt ch09
9781285852744 ppt ch099781285852744 ppt ch09
9781285852744 ppt ch09Terry Yoast
 
Typescript language extension of java script
Typescript language extension of java scriptTypescript language extension of java script
Typescript language extension of java scriptmichaelaaron25322
 
Graphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiDGraphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiDCODEiD PHP Community
 
Object Orientation.pdf
Object Orientation.pdfObject Orientation.pdf
Object Orientation.pdfJutt21
 

Similar to A-posteriori typing for model-driven engineering (20)

Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stack
Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stackNathaniel Cook - Forecasting Time Series Data at scale with the TICK stack
Nathaniel Cook - Forecasting Time Series Data at scale with the TICK stack
 
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typingApproaches to Model Transformation Reuse: from Concepts to A-posteriori typing
Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureML
 
Robust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time ChecksRobust C++ Task Systems Through Compile-time Checks
Robust C++ Task Systems Through Compile-time Checks
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
01 objective-c session 1
01  objective-c session 101  objective-c session 1
01 objective-c session 1
 
Classes1
Classes1Classes1
Classes1
 
Design patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjsDesign patterns in java script, jquery, angularjs
Design patterns in java script, jquery, angularjs
 
MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle MLFlow: Platform for Complete Machine Learning Lifecycle
MLFlow: Platform for Complete Machine Learning Lifecycle
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).ppt
 
Bca2030 object oriented programming – c++
Bca2030   object oriented programming – c++Bca2030   object oriented programming – c++
Bca2030 object oriented programming – c++
 
9781285852744 ppt ch09
9781285852744 ppt ch099781285852744 ppt ch09
9781285852744 ppt ch09
 
Data Product Architectures
Data Product ArchitecturesData Product Architectures
Data Product Architectures
 
Typescript language extension of java script
Typescript language extension of java scriptTypescript language extension of java script
Typescript language extension of java script
 
Symfony + GraphQL
Symfony + GraphQLSymfony + GraphQL
Symfony + GraphQL
 
Graphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiDGraphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiD
 
Object Orientation.pdf
Object Orientation.pdfObject Orientation.pdf
Object Orientation.pdf
 
Module IV_updated(old).pdf
Module IV_updated(old).pdfModule IV_updated(old).pdf
Module IV_updated(old).pdf
 

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
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experimentsmiso_uam
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017miso_uam
 
MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panelmiso_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
 
MTPLs
MTPLsMTPLs
MTPLs
 
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
 
MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panel
 

Recently uploaded

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 

Recently uploaded (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

A-posteriori typing for model-driven engineering

  • 1. A-POSTERIORI TYPING FOR MODEL-DRIVEN ENGINEERING J. de Lara, E. Guerra, J. Sánchez Cuadrado Modelling&Software Engineering Research Group http://miso.es Universidad Autónoma de Madrid (Spain) MODELS’2015, Ottawa (Canada)
  • 2. Constructive typing • Creation of objects and classification are inseparable Lacks flexibility • Objects cannot change their type at run-time (and retain its identity) Hinders reuse • An operation defined for a meta-model cannot be used for another one MOTIVATION 2 Task start: Date duration: int review: Task start= 8/5/15 duration=30 creation «instance of» Tasks meta-model model
  • 3. Constructive typing • Creation of objects and classification are inseparable Lacks flexibility • Objects cannot change their type at run-time (and retain its identity) Hinders reuse • An operation defined for a meta-model cannot be used for another one MOTIVATION 3 review: Task start= 8/5/15 duration=10 model Task start: Date duration: int review: Task start= 8/5/15 duration=30 creation «instance of» Tasks meta-model model
  • 4. Constructive typing • Creation of objects and classification are inseparable Lacks flexibility • Objects cannot change their type at run-time (and retain its identity) Hinders reuse • An operation defined for a meta-model cannot be used for another one MOTIVATION 4 Task start: Date duration: int review: Task start= 8/5/15 duration=30 creation «instance of» Tasks meta-model model review: Task start= 8/5/15 duration=0 model
  • 5. Constructive typing • Creation of objects and classification are inseparable Lacks flexibility • Objects cannot change their type at run-time (and retain its identity) Hinders reuse • An operation defined for a meta-model cannot be used for another one MOTIVATION 5 Task start: Date duration: int review: Task start= 8/5/15 duration=30 creation «instance of» Tasks meta-model model review: Milestone start= 8/5/15 duration=0 model
  • 6. Constructive typing • Creation of objects and classification are inseparable Lacks flexibility • Objects cannot change their type at run-time (and retain its identity) Hinders reuse • An operation defined for a meta-model cannot be used for another one MOTIVATION 6 Task start: Date duration: int review: Task start= 8/5/15 duration=30 creation «instance of» Tasks meta-model model Measurable quantity: int Measuring MM review: Milestone start= 8/5/15 duration=0 model
  • 7. A more flexible typing mechanism for MDE Decouple instantiation from classification • Interfaces in object-oriented programming • Roles in role-based programming languages Allow dynamic typing and multiple classifiers for objects Type and instance-level reclassification specifications • Transformation by reclassification • Flexible reuse of model management operations Prototype implementation in our MetaDepth tool GOALS AND CONTRIBUTIO NS 7
  • 8. design space of possible MDE typings a-posteriori (AP) typing • specification: type-level vs instance-level • analysis tool support & applications conclusions and future work AGENDA 8
  • 9. DESIGN SPACE FOR TYPINGS (1/2) 9 Typing in MDE dynamicity static dynamic classification time creation a-posteriori #classifiers single multiple bounded optional mandatory alternative … Can we add classifiers for an object after it is created? Can an object change its type at run-time? How many classifiers can an object have? Defined a-priori?
  • 10. DESIGN SPACE FOR TYPINGS (2/2) 10 Typing in MDE totality total partial #model types single multiple levels two multiple optional mandatory alternative Can a model be typed by multiple meta-models? Can an object lack type w.r.t. a type meta- model? Is type equivalence checked by name or by structure? type equivalence structural nominal How many meta-levels at the same time can be used?
  • 11. DESIGN SPACE FOR TYPINGS (2/2) 11 Typing in MDE totality total partial #model types single multiple levels two multiple optional mandatory alternative Can a model be typed by multiple meta-models? Can an object lack type w.r.t. a type meta- model? Is type equivalence checked by name or by structure? type equivalence structural nominal How many meta-levels at the same time can be used? Mainstream MDE approaches have made the less flexible choices in the typing space
  • 12. AP TYPING MOTIVATION: REUSE 12 Measurable quantity: int Schedulable date: Date review: Task Scheduling MM Measuring MM model «instance of» «instance of» start= 8/5/15 duration= 30 name= “rev” «Schedulable,Measurable» * * res Task start: Date duration: int name: String Resource Person owner assigned 1..* creation meta-model role meta-models creation «instance of» a-posteriori typingcreation typing operation typing of operation applicable to
  • 13. 13 AP TYPING MOTIVATION: FLEXIBLE REUSE *topics * * res Task start: Date duration: int name: String Tasks meta-model (constructive types) Resource Person owner assigned 1..* 1..* 0..3 reviewsArticle title: String Conference meta-model (dynamic types) Reviewer Authorauthors Topic desc: String «Author» p2: Person «Reviewer» p1: Person «Article» r: Resource :owner t1:Task start: 8/5/15 duration: 30 name: “rev” :res :assigned «Author,Reviewer» p2: Person «Reviewer» p1: Person «Article» r: Resource :owner t1:Task start: 8/5/15 duration: 30 name: “rev” :res :assigned «Author» p3: Person «Article» s: Resource :owner t2:Task start: 9/5/15 duration: 30 name: “rev” :res :assigned the model changes and gets retyped creation «instance of» model • A Person (constructive type) is only a Reviewer (a posteriori type) when some condition is met.
  • 14. SPECIFYING AP TYPINGS AT THE TYPE-LEVEL 14 Schedulable date: Date span: double review: Task Tasks meta-model ( MMC ) start= 8/5/15 /months= 1 duration= 30 name= “rev” Scheduling MM ( MMR ) Task start: Date duration: int name: String Typing Specification Task  Schedulable self.start  date /months: double=self.duration/30  span «Schedulable» «date» «span» creation «instance of» (constructive) «instance of» (a-posteriori) • Derived attributes (months) defined in the typing specification. • Typing rules: ensure correctness, see paper
  • 15. TYPE-LEVEL AP TYPING 15 date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) “Scheduling glasses” Operations review: Schedulable date= 8/5/15 span= 1 {review, writing} {1, 3} Schedulable.allInstances() writing: Schedulable date= 15/3/15 span= 3 Schedulable.allInstances()-> collect(span)
  • 16. 16 TYPE-LEVEL TYPING IN THE TYPING SPACE type-level AP typing totality total partial #model types single multiple dynamicity static dynamic classification time creation a-posteriori #classifiers single multiple bounded • Objects with different creation type can have same AP type • Objects with same creation type cannot have different AP type
  • 17. SPECIFYING AP TYPINGS AT THE INSTANCE LEVEL 17 date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 /months= 1 duration= 30 name= “rev” «Schedulable» «date» «instance of» (a-posteriori) Schedulable Scheduling MM (MMR) Typing Specification Task.allInstances()->select(duration<80)  Schedulable self.start  date /months: double=self.duration/30  span Instance model of Tasks ( MMC ) «span» • Typing defined by queries. • Derived attributes defined by queries as well.
  • 18. INSTANCE-LEVEL AP TYPING 18 Operations date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) review: Schedulable date= 8/5/15 span= 1 Schedulable.allInstances()-> collect(span) {review} {1} Schedulable.allInstances() “Scheduling glasses”
  • 19. INSTANCE-LEVEL AP TYPING 19 Operations date: Date span: double writing: Task start= 15/3/15 duration= 60 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) review: Schedulable date= 8/5/15 span= 1 Schedulable.allInstances()-> collect(span) {review, writing} {1, 2} Schedulable.allInstances() “Scheduling glasses” writing: Schedulable date= 15/3/15 span= 2
  • 20. 20 instance-level AP typing totality total partial #model types single multiple dynamicity static dynamic classification time creation a-posteriori #classifiers single multiple bounded INSTANCE-LEVEL TYPING IN THE TYPING SPACE • Objects with same creation type can have different AP type
  • 21. ANALYSIS TYPE-LEVEL AP TYPING 21 Schedulable date: Date span: double Tasks meta-model ( MMC ) Scheduling MM ( MMR ) Task start: Date duration: int name: String Typing Specification Task  Schedulable self.start  date /months: double=self.duration/30  span • Creation and role meta-models may have OCL constraints. • Executability: Can some “Tasks” models become valid Scheduling models?. • Totality: Can all Tasks models become valid Scheduling model?. • Surjectivity: Can every Scheduling instance be obtained via retyping some Tasks instance? • Analysed “merging” both meta-models and using SAT solving (details in paper)
  • 22. ANALYSIS INSTANCE-LEVEL AP TYPING 22 • Dynamic type safety: can an AP spec lead to unsafe typings? • Can be statically analysed via query rewriting: Can “reviews” contain objects not typed as “Article”?  Can “res” (of appropriate Tasks) contain something not a “Resource”? • Details in paper Typing Specification Resource.allInstances()  Article self.owner  authors Resource.allInstances()->collect(owner)  Author Task.allInstances()->select(name=“rev”) ->collect(assigned)  Reviewer Task.allInstances()->select(name=“rev” and assigned->includes(self))->collect(res)  reviews Conference meta-model (MMR) Article 1..* 0..3reviews ReviewerAuthor authors model * * res Task start: Date duration: int name: String Tasks meta-model (MMC) Resource Person owner assigned 1..* creation
  • 23. // Model Tasks someTasks { Task t0 { start = "30/04/2015"; duration = 30; name = "coding"; } } TOOL SUPPORT 23 MetaDepth • Multi-level textual modelling • Integrated with the Epsilon languages Type and instance level specifications • EOL for queries in instance-level specs Dump of models with different typings Analysis of type-level specs • Integration with the USE validator • Bidirectional reclassification • Reclassification totality and surjectivity // Meta-model Model Tasks { Node Task { start : Date; duration : int; name : String; } }
  • 24. APPLICATIONS: BX MODEL TRANSFORMATIONS Simple bidirectional model transformations by reclassification 24
  • 25. APPLICATIONS: BX MODEL TRANSFORMATIONS Simple bidirectional model transformations by reclassification 25 type Factory PetriNet { Conveyor::parts > Place::tokens, Generator::outps > Transition::outs, Terminator::inps > Transition::ins, Assembler::inps > Transition::ins, Assembler::outps > Transition::outs, }
  • 26. APPLICATIONS: BX MODEL TRANSFORMATIONS Simple bidirectional model transformations by reclassification 26 Forward reclassification
  • 27. Factory example { // 1st typing Conveyor p {} Terminator t { inps= [p]; } } Factory example { // 2nd typing Conveyor p {} Assembler t { inps= [p]; } } APPLICATIONS: BX MODEL TRANSFORMATIONS 27 PetriNet example { Place p {} Transition t { ins = [p]; } } MetaDepth console > dump example as Factory The typing specification can also be used backwards! Might yield multiple AP typings for a model
  • 28. // Model witness with no Petri net equivalent Factory noRefinementWitness { Assembler assembler2 { outps= [conveyor2, conveyor1]; } Conveyor conveyor1 { name= "string1"; } Conveyor conveyor2 { name= "string1"; } Generator generator2 { outps= [conveyor1]; } Part part2 { qa = true; } // This part would become a token outside any Place } APPLICATIONS: BX MODEL TRANSFORMATIONS 28 The reclassification is not total • Equivalently, the backwards reclassification is not surjective The solver produces a witness • A Factory model that cannot be reclassified into a Petri net
  • 29. APPLICATIONS: REUSE OF OPERATIONS Simulator for Petri nets can be reused “as is” for Factory • Provide an AP typing from Factory to Petri nets • Factory models become typed as Petri nets 29 // EOL excerpt of the simulator operation Transition enabled() : Boolean { return self.ins.forAll(p| p.tokens.size()>0); } operation step() : Boolean { var enabled : Set(Transition) := Transition.all.select( t | t.enabled()); ... // fire one random Transition from enabled }
  • 30. APPLICATIONS: FLEXIBLE REUSE 30 // Type parts as tokens only if QA is passed type Factory PetriNet inst { $Conveyor.all$ > Place with { /sp : Token[*] = $self.parts.select(p|p.qa=true)$ > tokens } $Part.all.select( p | p.qa = true )$ > Token }
  • 31. CONCLUSIONS AND FUTURE WORK AP typing is a more flexible approach to typing in MDE • Decoupled from creation type • Dynamic Flexible reuse, transformation by reclassification, analysis Improve tool support Exploit structural typing Annotations to restrict features of AP typing specs: • Non-overlapping role classes 31