SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
A category-theoretic view of model-driven
Meinte Boersma
DSL Consultancy
April 10th, 2014
A CT view of MD DSL Consultancy
About me
Owner/founder of DSL Consultancy
Creator of
Experienced in Xtend; Xtext, guerilla warfare...
...still learning category theory!
A CT view of MD DSL Consultancy
Agenda
What is Category Theory?
General introduction to CT
Why category theory for MD*?
Finding the category of models
Discussion and conclusion
A CT view of MD DSL Consultancy
What is category theory
Category theory is an abstraction of mathematics itself
that allows many intricate and subtle mathematical
results [...] to be stated, and proved, in a much simpler
way than without the use of categories.
(Wikipedia)
=⇒ Raising the level of abstraction!
A CT view of MD DSL Consultancy
Characteristics of category theory
1. capture essential complexity and separate it from the
incidental one
2. leave out unnecessary/technical details until you need them
3. lots of diagrams and ”chasing” those
A CT view of MD DSL Consultancy
General introduction
Definition A category C consists of:
objects, usually denoted with capitals
arrows, each having a source and a target object: S
f
−→ T
a composition operation ◦ on arrows such that for arrows f , g:
1. (identity) for every object X, an identity arrow idX exists
such that for every arrow S
f
−→ T: idT ◦ f = f ◦ idS
2. (associativity) if A
f
−→ B, B
g
−→ C and C
h
−→ D, then
h ◦ (g ◦ f ) = (h ◦ g) ◦ f
A CT view of MD DSL Consultancy
A prototypical diagram
A CT view of MD DSL Consultancy
Another diagram
Commutativity:
f
g
g ° f
A CT view of MD DSL Consultancy
Examples of categories - from mathematics: Set
Description of Set:
objects: sets
arrows: S
f
−→ T are functions: f : S → T
composition: composition of functions
identity arrows: idX (x) = x ∀x ∈ X
A CT view of MD DSL Consultancy
Examples of categories - from mathematics: Rel
Description of Rel:
objects: sets
arrows: S
f
−→ T are binary relations: f ⊆ S × T
composition of A
f
−→ B and B
g
−→ C:
(a, c) ∈ g ◦ f ⇐⇒ (a, b) ∈ f and (b, c) ∈ g for some b ∈ B
identity arrows: idX = {(x, x) | x ∈ X}
Pub exercise: verify category laws
A CT view of MD DSL Consultancy
Examples of categories - from mathematics: Graph
A graph consists of
a set of nodes
a set of edges
functions (σ, τ) mapping edges to its source resp. its target
node
An arrow in Graph is a mapping of nodes and edges that respects
source and target nodes of edges.
Note: this sounds oddly familiar...
A CT view of MD DSL Consultancy
Examples of categories - from programming: Html
Description of Html:
objects: instances of HTMLElements
arrows: invocations of JavaScript functions that take and
return HTMLElements
composition: function composition
identity:
A CT view of MD DSL Consultancy
Examples of categories - from programming: Jqry
Description of Jqry:
objects: values of $(...)
arrows: invocations of members of $.fn
composition: function composition
identity:
Note: Html and Jqry look rather alike...
A CT view of MD DSL Consultancy
Examples of categories - summary
objects arrows composition
Set sets functions from source to target sets composition of functions
Rel sets binary relations between two sets ”connecting transitively”
Graph graphs mappings from source to target graph, re-
specting source and target nodes of edges
”following the mapping”
Html HTMLElements invocations of appropriate JS functions functional composition
Jqry $(..) invocations of members of $.fn invocation chaining
Hask Haskell types Haskell functions the . operator
A CT view of MD DSL Consultancy
Observations
arrows
functions
composition
functional
comp.
“free”
associativity
A CT view of MD DSL Consultancy
Relations between categories
”Compare” categories with each other using . . .
Definition A functor
F : C −→ D
maps {objects | arrows} of C to {objects | arrows} of D such that
(identity) F(idS ) = idF(S) with S an object of C
(composition) F(f ◦ g) = F(f ) ◦ F(g) for arrows f , g of C
A CT view of MD DSL Consultancy
Examples of functors
the power set functor P : Set −→ Set
the ”graphing” functor Cat −→ Graph
monads are special kinds of functors on Hask
the ”wrapping” functor Html −→ Jqry:
A CT view of MD DSL Consultancy
Types of functors
functor type property
endo- C = D
covariant F(S)
F(f )
−→ F(T)
contravariant F(S)
F(f )
←− F(T)
for every arrow S
f
−→ T
A CT view of MD DSL Consultancy
Why category theory for MD*?
Bad reason: because the hipsters are doing it!
”Don’t you see: a monad simply is an endofunctor
arising as the composition of two adjoint functors with
two natural transformations, really!”
A CT view of MD DSL Consultancy
Why category theory for MD*?
To try and give answers to the following:
1. What is a model?
2. What is a meta model?
3. Model transformations
4. Discussion: semantics, meta model evolution, etc.
A CT view of MD DSL Consultancy
The category of models
Goal: a suitable category of models which answers our questions.
Challenge: CT assumes little ⇒ CT gives little off-the-shelf. . .
Idea: start with
Mod = (directed) graphs with (general) mappings; then: retrofit.
Note: Mod = Graph.
A CT view of MD DSL Consultancy
An example model
(Xcore=Ecore model)
A CT view of MD DSL Consultancy
An example model - ”categorized”
nodes
edges
payloads
⇒ nodes and edges require a payload (names, . . .) ⇐ retrofit!
Arrows induce mapping of payloads through their base point.
A CT view of MD DSL Consultancy
Types of model arrows
What types of arrows can we think of?
model transformations
type systems
queries
is-a’s: ”going meta”
A CT view of MD DSL Consultancy
Arrows between models - caveats
Note:
not all {source | target} {nodes | edges} need to be mapped
each arrow is a transformation between a particular source
and target model
a model transformation that works on a class of models is a
(covariant) functor ⇐= requires some formalization
A CT view of MD DSL Consultancy
”Going meta” - visualized
model pre-meta model
mappings
Note: mapping can carry extra information
A CT view of MD DSL Consultancy
”Going meta” - formalized
Definition In Mod, a model M2 is pre-meta for M1 if an ”is-a”
arrow f exists that maps all source nodes and edges.
model
pre-meta model
is-a
A CT view of MD DSL Consultancy
Multiple meta models
model
pre-meta model
is-a
A CT view of MD DSL Consultancy
Multiple meta models
model
pre-meta model
is-a
also pre-meta
also is-a
A CT view of MD DSL Consultancy
The ultimate meta model
A CT view of MD DSL Consultancy
Constraints
Many constraints are not expressible by pre-meta notion.
Just retrofit them to Mod where required!
Definition A constraint in M2 is a predicate function on models
M1 for which M2 is pre-meta.
A CT view of MD DSL Consultancy
”Going meta” - with constraints
Simply ”store” the constraints in M2 as part of it!
Definition In Mod, a model M2 is meta for M1 if it is pre-meta
and it satisfies all constraints in M2.
A CT view of MD DSL Consultancy
Model transformations
Now define the sub-category
ModM2 := {M1 in Mod such that M2 is meta for M1}
Definition A model transformation is a functor
T : ModM2 −→ ModM2
that respects the constraints of M2.
Post-conference exercise: what about F(f )?
A CT view of MD DSL Consultancy
Uncharted territory
CT concepts untouched (by me):
duality
natural transformations
adjointness
A CT view of MD DSL Consultancy
Discussion
Possible topics:
semantics
meta model evolution
model merging
. . .?
A CT view of MD DSL Consultancy
Conclusion
CT provides a nice, tech-independent language for MD
Comes with its own semantics and ”API”
It still makes us work (”answers”)
CT-approach can be taken much further - see article
references
A CT view of MD DSL Consultancy
More information
Books:
1. Lawvere and Schanuel, Conceptual Mathematics
2. Simmons, An Introduction to Category Theory
3. Mac Lane, Categories for the Working Mathematician
Articles:
1. Diskin and Maibaum, Category Theory and Model-Driven
Engineering: From Formal Semantics to Design Patterns and
Beyond
2. Diskin and Wolter, A Diagrammatic Logic for Object-Oriented
Visual Modeling
Blogs and video lectures by John Bender
A CT view of MD DSL Consultancy
End credits
Meinte Boersma
meinte.boersma@gmail.com
Software value creator @ DSL Consultancy
A CT view of MD DSL Consultancy

Contenu connexe

Tendances

Category Theory 101
Category Theory 101Category Theory 101
Category Theory 101Knoldus Inc.
 
Chapter3 hundred page machine learning
Chapter3 hundred page machine learningChapter3 hundred page machine learning
Chapter3 hundred page machine learningmustafa sarac
 
Ch6 pointers (latest)
Ch6 pointers (latest)Ch6 pointers (latest)
Ch6 pointers (latest)Hattori Sidek
 
Concept_of_NAN_IND_INF_DEN_Using_C++
Concept_of_NAN_IND_INF_DEN_Using_C++Concept_of_NAN_IND_INF_DEN_Using_C++
Concept_of_NAN_IND_INF_DEN_Using_C++Mohammed Nisamudheen
 
Oop lec 3(structures)
Oop lec 3(structures)Oop lec 3(structures)
Oop lec 3(structures)Asfand Hassan
 

Tendances (6)

Category Theory 101
Category Theory 101Category Theory 101
Category Theory 101
 
Chapter3 hundred page machine learning
Chapter3 hundred page machine learningChapter3 hundred page machine learning
Chapter3 hundred page machine learning
 
Lec10 matching
Lec10 matchingLec10 matching
Lec10 matching
 
Ch6 pointers (latest)
Ch6 pointers (latest)Ch6 pointers (latest)
Ch6 pointers (latest)
 
Concept_of_NAN_IND_INF_DEN_Using_C++
Concept_of_NAN_IND_INF_DEN_Using_C++Concept_of_NAN_IND_INF_DEN_Using_C++
Concept_of_NAN_IND_INF_DEN_Using_C++
 
Oop lec 3(structures)
Oop lec 3(structures)Oop lec 3(structures)
Oop lec 3(structures)
 

En vedette

Camps gaëlle et lilou
Camps   gaëlle et lilouCamps   gaëlle et lilou
Camps gaëlle et liloumdrouet44
 
Combining efficiency, fidelity, and flexibility in resource information services
Combining efficiency, fidelity, and flexibility in resource information servicesCombining efficiency, fidelity, and flexibility in resource information services
Combining efficiency, fidelity, and flexibility in resource information servicesLeMeniz Infotech
 
Secure spatial top k query processing via untrusted location-based service pr...
Secure spatial top k query processing via untrusted location-based service pr...Secure spatial top k query processing via untrusted location-based service pr...
Secure spatial top k query processing via untrusted location-based service pr...LeMeniz Infotech
 
Cpim election manifesto Telugu Version - 2014
Cpim election manifesto Telugu Version - 2014Cpim election manifesto Telugu Version - 2014
Cpim election manifesto Telugu Version - 2014cpimap
 
Securing broker less publish subscribe systems using identity-based encryption
Securing broker less publish subscribe systems using identity-based encryptionSecuring broker less publish subscribe systems using identity-based encryption
Securing broker less publish subscribe systems using identity-based encryptionLeMeniz Infotech
 
Collaboration Assignment - Part One
Collaboration Assignment - Part One Collaboration Assignment - Part One
Collaboration Assignment - Part One sherlenedeleon
 
Sanatana Resources Corporate Presentation
Sanatana Resources Corporate PresentationSanatana Resources Corporate Presentation
Sanatana Resources Corporate Presentationmhallaran
 
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓กิตติพงษ์ กุมภาพงษ์
 
2.4.1 blank ignite slides (power point)
2.4.1 blank ignite slides (power point)2.4.1 blank ignite slides (power point)
2.4.1 blank ignite slides (power point)Brent Baltzer
 
April 13 2014 slideshow
April 13 2014 slideshowApril 13 2014 slideshow
April 13 2014 slideshowEarl Oswalt
 
Nobel financieel advies wijzigingen belasting 2014
Nobel financieel advies wijzigingen belasting 2014Nobel financieel advies wijzigingen belasting 2014
Nobel financieel advies wijzigingen belasting 2014Nobel Financieel Advies
 
Analyzing ad library updates in android apps
Analyzing ad library updates in android appsAnalyzing ad library updates in android apps
Analyzing ad library updates in android appsLeMeniz Infotech
 

En vedette (19)

Camps gaëlle et lilou
Camps   gaëlle et lilouCamps   gaëlle et lilou
Camps gaëlle et lilou
 
Combining efficiency, fidelity, and flexibility in resource information services
Combining efficiency, fidelity, and flexibility in resource information servicesCombining efficiency, fidelity, and flexibility in resource information services
Combining efficiency, fidelity, and flexibility in resource information services
 
Secure spatial top k query processing via untrusted location-based service pr...
Secure spatial top k query processing via untrusted location-based service pr...Secure spatial top k query processing via untrusted location-based service pr...
Secure spatial top k query processing via untrusted location-based service pr...
 
Cpim election manifesto Telugu Version - 2014
Cpim election manifesto Telugu Version - 2014Cpim election manifesto Telugu Version - 2014
Cpim election manifesto Telugu Version - 2014
 
90801 seac0001
90801 seac000190801 seac0001
90801 seac0001
 
Securing broker less publish subscribe systems using identity-based encryption
Securing broker less publish subscribe systems using identity-based encryptionSecuring broker less publish subscribe systems using identity-based encryption
Securing broker less publish subscribe systems using identity-based encryption
 
Images
ImagesImages
Images
 
Collaboration Assignment - Part One
Collaboration Assignment - Part One Collaboration Assignment - Part One
Collaboration Assignment - Part One
 
AS Media Evaluation G321
AS Media Evaluation G321AS Media Evaluation G321
AS Media Evaluation G321
 
Sanatana Resources Corporate Presentation
Sanatana Resources Corporate PresentationSanatana Resources Corporate Presentation
Sanatana Resources Corporate Presentation
 
HAB-Brochure
HAB-BrochureHAB-Brochure
HAB-Brochure
 
Presentación curso ABP
Presentación curso ABPPresentación curso ABP
Presentación curso ABP
 
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓
การประชุมวิชาการทางสัตวศาสตร์แห่งชาติครั้งที่ ๓
 
2.4.1 blank ignite slides (power point)
2.4.1 blank ignite slides (power point)2.4.1 blank ignite slides (power point)
2.4.1 blank ignite slides (power point)
 
Ywam ships
Ywam shipsYwam ships
Ywam ships
 
Wishclub Compensation Plan (EN)
Wishclub Compensation Plan (EN)Wishclub Compensation Plan (EN)
Wishclub Compensation Plan (EN)
 
April 13 2014 slideshow
April 13 2014 slideshowApril 13 2014 slideshow
April 13 2014 slideshow
 
Nobel financieel advies wijzigingen belasting 2014
Nobel financieel advies wijzigingen belasting 2014Nobel financieel advies wijzigingen belasting 2014
Nobel financieel advies wijzigingen belasting 2014
 
Analyzing ad library updates in android apps
Analyzing ad library updates in android appsAnalyzing ad library updates in android apps
Analyzing ad library updates in android apps
 

Similaire à A Category-Theoretic View of Model-Driven Development

theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 018threspecter
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#ANURAG SINGH
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyMartin Odersky
 
Graph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXGraph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXBenjamin Bengfort
 
Object Orientation.pdf
Object Orientation.pdfObject Orientation.pdf
Object Orientation.pdfJutt21
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
 
Active shape appearance model-presentation 1st
Active shape appearance model-presentation 1stActive shape appearance model-presentation 1st
Active shape appearance model-presentation 1stChandrashekhar Padole
 
Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Jeff Trull
 
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)Avt Shubhash
 
RMM CD LECTURE NOTES UNIT-3 ALL.pdf
RMM CD LECTURE NOTES UNIT-3 ALL.pdfRMM CD LECTURE NOTES UNIT-3 ALL.pdf
RMM CD LECTURE NOTES UNIT-3 ALL.pdfRishikeshPathak10
 
AutoCAD COMMANDS.pptx
AutoCAD COMMANDS.pptxAutoCAD COMMANDS.pptx
AutoCAD COMMANDS.pptxRenzpaulCueto
 
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)Jordi Cabot
 
Strongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningStrongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningVaticle
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheoryMeetu Maltiar
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheoryKnoldus Inc.
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingMark Kilgard
 
D1 from interfaces to solid
D1 from interfaces to solidD1 from interfaces to solid
D1 from interfaces to solidArnaud Bouchez
 

Similaire à A Category-Theoretic View of Model-Driven Development (20)

theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 01
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Implementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in DottyImplementing Higher-Kinded Types in Dotty
Implementing Higher-Kinded Types in Dotty
 
Graph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkXGraph Analyses with Python and NetworkX
Graph Analyses with Python and NetworkX
 
Object Orientation.pdf
Object Orientation.pdfObject Orientation.pdf
Object Orientation.pdf
 
Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...Code is not text! How graph technologies can help us to understand our code b...
Code is not text! How graph technologies can help us to understand our code b...
 
Active shape appearance model-presentation 1st
Active shape appearance model-presentation 1stActive shape appearance model-presentation 1st
Active shape appearance model-presentation 1st
 
Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++Analyzing On-Chip Interconnect with Modern C++
Analyzing On-Chip Interconnect with Modern C++
 
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)
COMPUTER CONTROL IN PROCESS PLANNING Unit 2 (ME CAD/CAM)
 
Graph Analytics
Graph AnalyticsGraph Analytics
Graph Analytics
 
RMM CD LECTURE NOTES UNIT-3 ALL.pdf
RMM CD LECTURE NOTES UNIT-3 ALL.pdfRMM CD LECTURE NOTES UNIT-3 ALL.pdf
RMM CD LECTURE NOTES UNIT-3 ALL.pdf
 
AutoCAD COMMANDS.pptx
AutoCAD COMMANDS.pptxAutoCAD COMMANDS.pptx
AutoCAD COMMANDS.pptx
 
02.adt
02.adt02.adt
02.adt
 
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
 
Strongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningStrongly Typed Data for Machine Learning
Strongly Typed Data for Machine Learning
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheory
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheory
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and Culling
 
D1 from interfaces to solid
D1 from interfaces to solidD1 from interfaces to solid
D1 from interfaces to solid
 

Dernier

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 

Dernier (20)

Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 

A Category-Theoretic View of Model-Driven Development

  • 1. A category-theoretic view of model-driven Meinte Boersma DSL Consultancy April 10th, 2014 A CT view of MD DSL Consultancy
  • 2. About me Owner/founder of DSL Consultancy Creator of Experienced in Xtend; Xtext, guerilla warfare... ...still learning category theory! A CT view of MD DSL Consultancy
  • 3. Agenda What is Category Theory? General introduction to CT Why category theory for MD*? Finding the category of models Discussion and conclusion A CT view of MD DSL Consultancy
  • 4. What is category theory Category theory is an abstraction of mathematics itself that allows many intricate and subtle mathematical results [...] to be stated, and proved, in a much simpler way than without the use of categories. (Wikipedia) =⇒ Raising the level of abstraction! A CT view of MD DSL Consultancy
  • 5. Characteristics of category theory 1. capture essential complexity and separate it from the incidental one 2. leave out unnecessary/technical details until you need them 3. lots of diagrams and ”chasing” those A CT view of MD DSL Consultancy
  • 6. General introduction Definition A category C consists of: objects, usually denoted with capitals arrows, each having a source and a target object: S f −→ T a composition operation ◦ on arrows such that for arrows f , g: 1. (identity) for every object X, an identity arrow idX exists such that for every arrow S f −→ T: idT ◦ f = f ◦ idS 2. (associativity) if A f −→ B, B g −→ C and C h −→ D, then h ◦ (g ◦ f ) = (h ◦ g) ◦ f A CT view of MD DSL Consultancy
  • 7. A prototypical diagram A CT view of MD DSL Consultancy
  • 8. Another diagram Commutativity: f g g ° f A CT view of MD DSL Consultancy
  • 9. Examples of categories - from mathematics: Set Description of Set: objects: sets arrows: S f −→ T are functions: f : S → T composition: composition of functions identity arrows: idX (x) = x ∀x ∈ X A CT view of MD DSL Consultancy
  • 10. Examples of categories - from mathematics: Rel Description of Rel: objects: sets arrows: S f −→ T are binary relations: f ⊆ S × T composition of A f −→ B and B g −→ C: (a, c) ∈ g ◦ f ⇐⇒ (a, b) ∈ f and (b, c) ∈ g for some b ∈ B identity arrows: idX = {(x, x) | x ∈ X} Pub exercise: verify category laws A CT view of MD DSL Consultancy
  • 11. Examples of categories - from mathematics: Graph A graph consists of a set of nodes a set of edges functions (σ, τ) mapping edges to its source resp. its target node An arrow in Graph is a mapping of nodes and edges that respects source and target nodes of edges. Note: this sounds oddly familiar... A CT view of MD DSL Consultancy
  • 12. Examples of categories - from programming: Html Description of Html: objects: instances of HTMLElements arrows: invocations of JavaScript functions that take and return HTMLElements composition: function composition identity: A CT view of MD DSL Consultancy
  • 13. Examples of categories - from programming: Jqry Description of Jqry: objects: values of $(...) arrows: invocations of members of $.fn composition: function composition identity: Note: Html and Jqry look rather alike... A CT view of MD DSL Consultancy
  • 14. Examples of categories - summary objects arrows composition Set sets functions from source to target sets composition of functions Rel sets binary relations between two sets ”connecting transitively” Graph graphs mappings from source to target graph, re- specting source and target nodes of edges ”following the mapping” Html HTMLElements invocations of appropriate JS functions functional composition Jqry $(..) invocations of members of $.fn invocation chaining Hask Haskell types Haskell functions the . operator A CT view of MD DSL Consultancy
  • 16. Relations between categories ”Compare” categories with each other using . . . Definition A functor F : C −→ D maps {objects | arrows} of C to {objects | arrows} of D such that (identity) F(idS ) = idF(S) with S an object of C (composition) F(f ◦ g) = F(f ) ◦ F(g) for arrows f , g of C A CT view of MD DSL Consultancy
  • 17. Examples of functors the power set functor P : Set −→ Set the ”graphing” functor Cat −→ Graph monads are special kinds of functors on Hask the ”wrapping” functor Html −→ Jqry: A CT view of MD DSL Consultancy
  • 18. Types of functors functor type property endo- C = D covariant F(S) F(f ) −→ F(T) contravariant F(S) F(f ) ←− F(T) for every arrow S f −→ T A CT view of MD DSL Consultancy
  • 19. Why category theory for MD*? Bad reason: because the hipsters are doing it! ”Don’t you see: a monad simply is an endofunctor arising as the composition of two adjoint functors with two natural transformations, really!” A CT view of MD DSL Consultancy
  • 20. Why category theory for MD*? To try and give answers to the following: 1. What is a model? 2. What is a meta model? 3. Model transformations 4. Discussion: semantics, meta model evolution, etc. A CT view of MD DSL Consultancy
  • 21. The category of models Goal: a suitable category of models which answers our questions. Challenge: CT assumes little ⇒ CT gives little off-the-shelf. . . Idea: start with Mod = (directed) graphs with (general) mappings; then: retrofit. Note: Mod = Graph. A CT view of MD DSL Consultancy
  • 22. An example model (Xcore=Ecore model) A CT view of MD DSL Consultancy
  • 23. An example model - ”categorized” nodes edges payloads ⇒ nodes and edges require a payload (names, . . .) ⇐ retrofit! Arrows induce mapping of payloads through their base point. A CT view of MD DSL Consultancy
  • 24. Types of model arrows What types of arrows can we think of? model transformations type systems queries is-a’s: ”going meta” A CT view of MD DSL Consultancy
  • 25. Arrows between models - caveats Note: not all {source | target} {nodes | edges} need to be mapped each arrow is a transformation between a particular source and target model a model transformation that works on a class of models is a (covariant) functor ⇐= requires some formalization A CT view of MD DSL Consultancy
  • 26. ”Going meta” - visualized model pre-meta model mappings Note: mapping can carry extra information A CT view of MD DSL Consultancy
  • 27. ”Going meta” - formalized Definition In Mod, a model M2 is pre-meta for M1 if an ”is-a” arrow f exists that maps all source nodes and edges. model pre-meta model is-a A CT view of MD DSL Consultancy
  • 28. Multiple meta models model pre-meta model is-a A CT view of MD DSL Consultancy
  • 29. Multiple meta models model pre-meta model is-a also pre-meta also is-a A CT view of MD DSL Consultancy
  • 30. The ultimate meta model A CT view of MD DSL Consultancy
  • 31. Constraints Many constraints are not expressible by pre-meta notion. Just retrofit them to Mod where required! Definition A constraint in M2 is a predicate function on models M1 for which M2 is pre-meta. A CT view of MD DSL Consultancy
  • 32. ”Going meta” - with constraints Simply ”store” the constraints in M2 as part of it! Definition In Mod, a model M2 is meta for M1 if it is pre-meta and it satisfies all constraints in M2. A CT view of MD DSL Consultancy
  • 33. Model transformations Now define the sub-category ModM2 := {M1 in Mod such that M2 is meta for M1} Definition A model transformation is a functor T : ModM2 −→ ModM2 that respects the constraints of M2. Post-conference exercise: what about F(f )? A CT view of MD DSL Consultancy
  • 34. Uncharted territory CT concepts untouched (by me): duality natural transformations adjointness A CT view of MD DSL Consultancy
  • 35. Discussion Possible topics: semantics meta model evolution model merging . . .? A CT view of MD DSL Consultancy
  • 36. Conclusion CT provides a nice, tech-independent language for MD Comes with its own semantics and ”API” It still makes us work (”answers”) CT-approach can be taken much further - see article references A CT view of MD DSL Consultancy
  • 37. More information Books: 1. Lawvere and Schanuel, Conceptual Mathematics 2. Simmons, An Introduction to Category Theory 3. Mac Lane, Categories for the Working Mathematician Articles: 1. Diskin and Maibaum, Category Theory and Model-Driven Engineering: From Formal Semantics to Design Patterns and Beyond 2. Diskin and Wolter, A Diagrammatic Logic for Object-Oriented Visual Modeling Blogs and video lectures by John Bender A CT view of MD DSL Consultancy
  • 38. End credits Meinte Boersma meinte.boersma@gmail.com Software value creator @ DSL Consultancy A CT view of MD DSL Consultancy