SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
Made available under EPL 2.0
An OCL Map Type
Edward Willink
Willink Transformations Ltd
Eclipse Foundation
MMT Component co-Lead
OCL Project Lead
QVTd Project Lead
QVTo Committer
OMG (Model Driven Solutions)
OCL 2.3, 2.4, 2.5 RTF Chair
QVT 1.2, 1.3, 1.4 RTF Chair
OCL 2019 @ MODELS 2019
16th September 2019
16-September-2019 OCL Visualization - A Reality Check 2Made available under EPL 2.0
OCL Aggregate Types
Collections (Bag, OrderedSet, Sequence, Set)
Tuples
Nested Collections
Type Constructors (shadow types)
?? Map ??
use Set(Tuple(key, value))
No
Set(Tuple(key, value)) has unique key+value pairs
Map(key, value) has unique keys with associated 'co-value'
16-September-2019 OCL Visualization - A Reality Check 3Made available under EPL 2.0
Map philosophy
Java Map very familiar - mutable
put(k, v) modifies the map
get(k) / contains(k) interrogates the map
get() returning null is ambiguous: null-value-hit/key-miss
OCL Map - immutable
'mutation' => new Map with changed contents
including(k,v) rather than put(k,v)
at(k) rather than get(k)
returns invalid for a miss
returns null for a null value
semantically identical to OrderedCollection.at(Integer)
includes(k) rather than contains(k)
16-September-2019 OCL Map Type 4Made available under EPL 2.0
Map in Eclipse OCL (2015-06)
Map(K,V) type declaration
Map{k1<-v1, k2<-v2} literal expression
Operations
isEmpty(), notEmpty(), size(), =, <>
at(k), keys(), values()
excludes(k), excludes(k,v), excludesAll(ks), excludesMap(m),
excludesValue(v)
includes(k), includes(k,v), includesAll(ks), includesMap(m),
includesValue(v)
excluding(k), excluding(k,v), excludingAll(k), excludingMap(m)
including(k, v), includingMap(m)
16-September-2019 OCL Visualization - A Reality Check 5Made available under EPL 2.0
Map implementation Phase 1
Supports simple Map construction and use
Any non-trivial Map construction is >= quadratic
new Map is constructed for each addition
Map implementation Phase 2
Support iterated Map construction
potentially linear cost
Support Map iterators over key and co-value
16-September-2019 OCL Map Type 6Made available under EPL 2.0
Map in Eclipse OCL (2019-03)
Collection(T)
collectBy(k | f(k)) returns Map(k<-f(k))
inverseCollectBy(k | f(k)) returns Map(f(k)<-k)
Map(K,V) like-a Set(K) with co-values of type V
any(), collect(), collectNested(), exists(), forAll(), isUnique(),
iterate(), one(), reject(), select()
collectBy(k | f(k)) returns Map(k<-f(k))
co-iterators: iterator-decl <- co-iterator-decl
aMap->collect(k1<-v1 | f(k1,v1))
aMap->forAll(k1<-v1, k2<-v2 | f(k1,v1,k2,v2))
16-September-2019 OCL Map Type 7Made available under EPL 2.0
Future Work
Collection(T)
collectBy(k | kf(k) <- vf(k)) returns Map(kf(k)<-vf(k))
makes inverseCollectBy redundant
Entry(K,V)
collectBy(k | let f = f(k) in kf(f) <- vf(f))
needs an Entry(K,V) type for "f"
Multi-map
OCL is lossless
collectBy collisions => multimap rather than loss

Mais conteúdo relacionado

Semelhante a An OCL Map Type

4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
GISRUK conference
 

Semelhante a An OCL Map Type (10)

Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
Local Optimizations in Eclipse QVTc and QVTr using the Micro-Mapping Model of...
 
OCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and ProspectiveOCL 2019 Keynote Retrospective and Prospective
OCL 2019 Keynote Retrospective and Prospective
 
Elliptic curve scalar multiplier using karatsuba
Elliptic curve scalar multiplier using karatsubaElliptic curve scalar multiplier using karatsuba
Elliptic curve scalar multiplier using karatsuba
 
Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)Optimizing with persistent data structures (LLVM Cauldron 2016)
Optimizing with persistent data structures (LLVM Cauldron 2016)
 
Nips2016 mlgkernel
Nips2016 mlgkernelNips2016 mlgkernel
Nips2016 mlgkernel
 
Learn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentLearn basics of Clojure/script and Reagent
Learn basics of Clojure/script and Reagent
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method Names
 
論文紹介"DynamicFusion: Reconstruction and Tracking of Non-­‐rigid Scenes in Real...
論文紹介"DynamicFusion: Reconstruction and Tracking of Non-­‐rigid Scenes in Real...論文紹介"DynamicFusion: Reconstruction and Tracking of Non-­‐rigid Scenes in Real...
論文紹介"DynamicFusion: Reconstruction and Tracking of Non-­‐rigid Scenes in Real...
 
4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
4A_ 3_Parallel k-means clustering using gp_us for the geocomputation of real-...
 
The Micromapping Model of Computation
The Micromapping Model of ComputationThe Micromapping Model of Computation
The Micromapping Model of Computation
 

Mais de Edward Willink

Mais de Edward Willink (20)

A text model - Use your favourite M2M for M2T
A text model - Use your favourite M2M for M2TA text model - Use your favourite M2M for M2T
A text model - Use your favourite M2M for M2T
 
Shadow Objects
Shadow ObjectsShadow Objects
Shadow Objects
 
Commutative Short Circuit Operators
Commutative Short Circuit OperatorsCommutative Short Circuit Operators
Commutative Short Circuit Operators
 
Deterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL CollectionsDeterministic Lazy Mutable OCL Collections
Deterministic Lazy Mutable OCL Collections
 
Optimized declarative transformation First Eclipse QVTc results
Optimized declarative transformation First Eclipse QVTc resultsOptimized declarative transformation First Eclipse QVTc results
Optimized declarative transformation First Eclipse QVTc results
 
The Importance of Opposites
The Importance of OppositesThe Importance of Opposites
The Importance of Opposites
 
OCL Specification Status
OCL Specification StatusOCL Specification Status
OCL Specification Status
 
The OCLforUML Profile
The OCLforUML ProfileThe OCLforUML Profile
The OCLforUML Profile
 
At Last an OCL Debugger
At Last an OCL DebuggerAt Last an OCL Debugger
At Last an OCL Debugger
 
QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)OCL 2.4. (... 2.5)
OCL 2.4. (... 2.5)
 
Embedded OCL Integration and Debugging
Embedded OCL Integration and DebuggingEmbedded OCL Integration and Debugging
Embedded OCL Integration and Debugging
 
OCL Integration and Code Generation
OCL Integration and Code GenerationOCL Integration and Code Generation
OCL Integration and Code Generation
 
Yet Another Three QVT Languages
Yet Another Three QVT LanguagesYet Another Three QVT Languages
Yet Another Three QVT Languages
 
OCL - The Bigger Picture
OCL - The Bigger PictureOCL - The Bigger Picture
OCL - The Bigger Picture
 
UMLX and QVT and ATL
UMLX and QVT and ATLUMLX and QVT and ATL
UMLX and QVT and ATL
 
Model Transformation A Personal Perspective
Model Transformation A Personal PerspectiveModel Transformation A Personal Perspective
Model Transformation A Personal Perspective
 
Fast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast QueriesFast, Faster and Super-Fast Queries
Fast, Faster and Super-Fast Queries
 
Eclipse OCL Summary
Eclipse OCL SummaryEclipse OCL Summary
Eclipse OCL Summary
 

Último

JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 

Último (20)

AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdfMicrosoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
Microsoft 365 Copilot; An AI tool changing the world of work _PDF.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 

An OCL Map Type

  • 1. Made available under EPL 2.0 An OCL Map Type Edward Willink Willink Transformations Ltd Eclipse Foundation MMT Component co-Lead OCL Project Lead QVTd Project Lead QVTo Committer OMG (Model Driven Solutions) OCL 2.3, 2.4, 2.5 RTF Chair QVT 1.2, 1.3, 1.4 RTF Chair OCL 2019 @ MODELS 2019 16th September 2019
  • 2. 16-September-2019 OCL Visualization - A Reality Check 2Made available under EPL 2.0 OCL Aggregate Types Collections (Bag, OrderedSet, Sequence, Set) Tuples Nested Collections Type Constructors (shadow types) ?? Map ?? use Set(Tuple(key, value)) No Set(Tuple(key, value)) has unique key+value pairs Map(key, value) has unique keys with associated 'co-value'
  • 3. 16-September-2019 OCL Visualization - A Reality Check 3Made available under EPL 2.0 Map philosophy Java Map very familiar - mutable put(k, v) modifies the map get(k) / contains(k) interrogates the map get() returning null is ambiguous: null-value-hit/key-miss OCL Map - immutable 'mutation' => new Map with changed contents including(k,v) rather than put(k,v) at(k) rather than get(k) returns invalid for a miss returns null for a null value semantically identical to OrderedCollection.at(Integer) includes(k) rather than contains(k)
  • 4. 16-September-2019 OCL Map Type 4Made available under EPL 2.0 Map in Eclipse OCL (2015-06) Map(K,V) type declaration Map{k1<-v1, k2<-v2} literal expression Operations isEmpty(), notEmpty(), size(), =, <> at(k), keys(), values() excludes(k), excludes(k,v), excludesAll(ks), excludesMap(m), excludesValue(v) includes(k), includes(k,v), includesAll(ks), includesMap(m), includesValue(v) excluding(k), excluding(k,v), excludingAll(k), excludingMap(m) including(k, v), includingMap(m)
  • 5. 16-September-2019 OCL Visualization - A Reality Check 5Made available under EPL 2.0 Map implementation Phase 1 Supports simple Map construction and use Any non-trivial Map construction is >= quadratic new Map is constructed for each addition Map implementation Phase 2 Support iterated Map construction potentially linear cost Support Map iterators over key and co-value
  • 6. 16-September-2019 OCL Map Type 6Made available under EPL 2.0 Map in Eclipse OCL (2019-03) Collection(T) collectBy(k | f(k)) returns Map(k<-f(k)) inverseCollectBy(k | f(k)) returns Map(f(k)<-k) Map(K,V) like-a Set(K) with co-values of type V any(), collect(), collectNested(), exists(), forAll(), isUnique(), iterate(), one(), reject(), select() collectBy(k | f(k)) returns Map(k<-f(k)) co-iterators: iterator-decl <- co-iterator-decl aMap->collect(k1<-v1 | f(k1,v1)) aMap->forAll(k1<-v1, k2<-v2 | f(k1,v1,k2,v2))
  • 7. 16-September-2019 OCL Map Type 7Made available under EPL 2.0 Future Work Collection(T) collectBy(k | kf(k) <- vf(k)) returns Map(kf(k)<-vf(k)) makes inverseCollectBy redundant Entry(K,V) collectBy(k | let f = f(k) in kf(f) <- vf(f)) needs an Entry(K,V) type for "f" Multi-map OCL is lossless collectBy collisions => multimap rather than loss