SlideShare a Scribd company logo
1 of 17
Download to read offline
The Epsilon Pattern Language
Dimitris Kolovos, Richard Paige
May 22, 2017
Department of Computer Science
University of York
9th Workshop on Modelling in Software Engineering (MiSE)
ICSE 2017, Buneos Aires, Argentina
Pattern Matching
• In general: finding sub-structures of interest within more
complex structures
• e.g. character sequences that look like email addresses
• In modelling: finding sets of model elements that have certain
properties and/or are connected in interesting ways
1
Example: Attributes to Pull Up
• Find pairs of attributes that can be moved up to a common
supertype
2
Declarative Pattern Matching
• Describe patterns declaratively
• Let the pattern matching engine figure out the optimal
execution plan
1
1
from Arend et. al. – Henshin: Advanced Concepts and Tools for In-Place
EMF Model Transformations, ACM/IEEE MoDELS 2010
3
Declarative Pattern Matching Languages
Strengths
• Lots of room for behind-the-scene optimisation
• Can be executed incrementally (speed/memory trade-off)
Weaknesses
• Complex patterns can be challenging/verbose to express
graphically
• Falling back to complex expressions can reduce the scope for
optimisation/incrementality
• Current execution planners are not great
4
Practical Considerations
• Bound to a particular modelling technology / model
representation format
• Non-negligible conversion cost
• No support for patterns that involve elements from different
(heterogeneous) models
• e.g. UML activities and Simulink blocks
• No out-of-the-box support for “exporting” the results of
pattern matching to downstream activities (e.g. M2M, M2T)
5
Epsilon Pattern Language
• Hybrid OCL-based pattern matching language
• Modelling-technology independent
• Support for patterns that involve elements from multiple
heterogeneous models
• Support for “exporting” detected pattern instances to M2T,
M2M transformations etc.
6
Epsilon Organisation
eclipse.org/epsilon
7
Example: Attributes to Pull Up
• Find pairs of attributes that can be moved up to a common
supertype
8
Finding Attributes to Pull Up using EPL
pattern AttributesToPullUp
c : EClass ,
a1 , a2 : EAttribute {
match :
a1.name = a2.name
and a1.eType = a2.eType
and a1 <> a2
and a1. eContainingClass . eAllSuperTypes .includes(c)
and a2. eContainingClass . eAllSuperTypes .includes(c)
}
9
A More Performant Version
pre {
var attributes = EAttribute.all.mapBy(a|a.name );
}
pattern AttributesToPullUp
c : EClass ,
a1 : EAttribute ,
a2 : EAttribute
from : attributes.get(a1.name ). excluding(a1) {
match :
a1.eType = a2.eType
and a1. eContainingClass . eAllSuperTypes .includes(c)
and a2. eContainingClass . eAllSuperTypes .includes(c)
}
10
Adding a Second Model
• To specify attributes which should be ignored during pattern
detection
• The second model is an Excel spreadsheet with one worksheet
called “Ignore”
M
class attribute
. . . . . .
Employee name
. . . . . .
C
11
Pattern Matching on Two Models
pre { var attributes = M!EAttribute.all.mapBy(a|a.name ); }
pattern AttributesToPullUp
c : M!EClass ,
a1 : M!EAttribute ,
a2 : M!EAttribute
from : attributes.get(a1.name ). excluding(a1)
guard : not a1.isIgnored() and not a2.isIgnored() {
match :
a1.eType = a2.eType
and a1. eContainingClass . eAllSuperTypes .includes(c)
and a2. eContainingClass . eAllSuperTypes .includes(c)
}
operation M!EAttribute isIgnored() {
return C!Ignore.all.exists(i|i.attribute = self.name
and i.class = self. eContainingClass .name );
}
12
Consuming Pattern Instances
• Pattern instances are wrapped as an EMC-compatible
in-memory “model”
• Patterns become types (e.g. AttributesToPullUp)
• Roles become fields (e.g. c, a1, a2)
• Other Epsilon programs can query and navigate them
• To transform, validate them etc.
• . . . even to detect patterns of patterns
13
Pattern Matching in a Workflow
<project default="main"> <target name="main">
<epsilon.emf.loadModel name="M" modelfile="model.ecore"
metamodeluri="http://www.eclipse.org/emf/2002/Ecore"/>
<epsilon.loadModel name="C" type="ExcelModel">
<parameter name="SPREADSHEET FILE" file="config.xlsx"/>
</epsilon.loadModel>
<epsilon.epl src="patterns.epl" exportas="P">
<model ref="M"/> <model ref="C"/>
</epsilon.epl>
<epsilon.eol>
for (atp in P!AttributesToPullUp.all) { atp.c.name.println(); }
<model ref="M"/><model ref="C"/><model ref="P"/>
</epsilon.eol>
</target > </project >
14
Future Work
• Experimental evaluation against GrGen.NET, Henshin,
VIATRA/EMF-IncQuery, AGG etc.
• Static analysis
• Parallel and incremental pattern matching
15
Summary
• Hybrid OCL-based pattern matching language
• Modelling-technology independent
• Support for “exporting” detected patterns to downstream
model management programs
eclipse.org/epsilon
16

More Related Content

What's hot

What every Eclipse developer should know about EMF
What every Eclipse developer should know about EMFWhat every Eclipse developer should know about EMF
What every Eclipse developer should know about EMF
Philip Langer
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented Programming
Abhilash Nair
 
What every Eclipse developer should know about EMF - Tutorial at EclipseCon
What every Eclipse developer should know about EMF - Tutorial at EclipseConWhat every Eclipse developer should know about EMF - Tutorial at EclipseCon
What every Eclipse developer should know about EMF - Tutorial at EclipseCon
JonasHelming
 
Object Oriented Programming lecture 1
Object Oriented Programming lecture 1Object Oriented Programming lecture 1
Object Oriented Programming lecture 1
Anwar Ul Haq
 

What's hot (20)

What every Eclipse developer should know about EMF
What every Eclipse developer should know about EMFWhat every Eclipse developer should know about EMF
What every Eclipse developer should know about EMF
 
Eugenia
EugeniaEugenia
Eugenia
 
oop Lecture 3
oop Lecture 3oop Lecture 3
oop Lecture 3
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented Programming
 
Metamodeling - Advanced Software Engineering Course 2014/2015
Metamodeling - Advanced Software Engineering Course 2014/2015Metamodeling - Advanced Software Engineering Course 2014/2015
Metamodeling - Advanced Software Engineering Course 2014/2015
 
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
 
What every Eclipse developer should know about EMF - Tutorial at EclipseCon
What every Eclipse developer should know about EMF - Tutorial at EclipseConWhat every Eclipse developer should know about EMF - Tutorial at EclipseCon
What every Eclipse developer should know about EMF - Tutorial at EclipseCon
 
UML: Once More with Meaning
UML: Once More with MeaningUML: Once More with Meaning
UML: Once More with Meaning
 
Code Generation 2014 - ALF, the Standard Programming Language for UML
Code Generation 2014  - ALF, the Standard Programming Language for UMLCode Generation 2014  - ALF, the Standard Programming Language for UML
Code Generation 2014 - ALF, the Standard Programming Language for UML
 
How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...
How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...
How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...
 
Programming paradigms
Programming paradigmsProgramming paradigms
Programming paradigms
 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML Models
 
TextUML Toolkit
TextUML ToolkitTextUML Toolkit
TextUML Toolkit
 
Object Oriented Programming lecture 1
Object Oriented Programming lecture 1Object Oriented Programming lecture 1
Object Oriented Programming lecture 1
 
UML: This Time We Mean It!
UML: This Time We Mean It!UML: This Time We Mean It!
UML: This Time We Mean It!
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
 
Representing Design Patterns In Uml Andy Bulka Oct2006
Representing Design Patterns In Uml Andy Bulka Oct2006Representing Design Patterns In Uml Andy Bulka Oct2006
Representing Design Patterns In Uml Andy Bulka Oct2006
 
Re-implementing Thrift using MDE
Re-implementing Thrift using MDERe-implementing Thrift using MDE
Re-implementing Thrift using MDE
 
Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 

Similar to The Epsilon Pattern Language

SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdf
B.T.L.I.T
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docx
randymartin91030
 
Design patterns in_c_sharp
Design patterns in_c_sharpDesign patterns in_c_sharp
Design patterns in_c_sharp
Cao Tuan
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
K.s. Ramesh
 

Similar to The Epsilon Pattern Language (20)

SADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdfSADP PPTs of all modules - Shanthi D.L.pdf
SADP PPTs of all modules - Shanthi D.L.pdf
 
UML01
UML01UML01
UML01
 
ALT
ALTALT
ALT
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
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)
 
Day5
Day5Day5
Day5
 
Third AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docxThird AssignmentDescribe in 100 – 200 words an application with .docx
Third AssignmentDescribe in 100 – 200 words an application with .docx
 
ATI Courses Professional Development Short Course Engineering Systems Modelin...
ATI Courses Professional Development Short Course Engineering Systems Modelin...ATI Courses Professional Development Short Course Engineering Systems Modelin...
ATI Courses Professional Development Short Course Engineering Systems Modelin...
 
Design patterns in_c_sharp
Design patterns in_c_sharpDesign patterns in_c_sharp
Design patterns in_c_sharp
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Python
 
chapter 5 Objectdesign.ppt
chapter 5 Objectdesign.pptchapter 5 Objectdesign.ppt
chapter 5 Objectdesign.ppt
 
Excel ways training_course_contents
Excel ways training_course_contentsExcel ways training_course_contents
Excel ways training_course_contents
 
Bca winter 2013 2nd sem
Bca winter 2013 2nd semBca winter 2013 2nd sem
Bca winter 2013 2nd sem
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categories
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
UNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptxUNIT II STATIC UML DIAGRAMS.pptx
UNIT II STATIC UML DIAGRAMS.pptx
 

More from Dimitris Kolovos

More from Dimitris Kolovos (8)

Picto: Model Visualisation via M2T Transformation
Picto: Model Visualisation via M2T TransformationPicto: Model Visualisation via M2T Transformation
Picto: Model Visualisation via M2T Transformation
 
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
 
Merging Models with the Epsilon Merging Language - A Decade Later
Merging Models with the Epsilon Merging Language - A Decade LaterMerging Models with the Epsilon Merging Language - A Decade Later
Merging Models with the Epsilon Merging Language - A Decade Later
 
Assessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
Assessing the Use of Eclipse MDE Technologies in Open-Source Software ProjectsAssessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
Assessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
 
Eclipse Modellng Forums: Looking at the Data
Eclipse Modellng Forums: Looking at the DataEclipse Modellng Forums: Looking at the Data
Eclipse Modellng Forums: Looking at the Data
 
Adding Spreadsheets to the MDE Toolbox
Adding Spreadsheets to the MDE ToolboxAdding Spreadsheets to the MDE Toolbox
Adding Spreadsheets to the MDE Toolbox
 
Managing XML documents with Epsilon
Managing XML documents with EpsilonManaging XML documents with Epsilon
Managing XML documents with Epsilon
 
COMPASS Early Safety Warning System (ESWS)
COMPASS Early Safety Warning System (ESWS)COMPASS Early Safety Warning System (ESWS)
COMPASS Early Safety Warning System (ESWS)
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

The Epsilon Pattern Language

  • 1. The Epsilon Pattern Language Dimitris Kolovos, Richard Paige May 22, 2017 Department of Computer Science University of York 9th Workshop on Modelling in Software Engineering (MiSE) ICSE 2017, Buneos Aires, Argentina
  • 2. Pattern Matching • In general: finding sub-structures of interest within more complex structures • e.g. character sequences that look like email addresses • In modelling: finding sets of model elements that have certain properties and/or are connected in interesting ways 1
  • 3. Example: Attributes to Pull Up • Find pairs of attributes that can be moved up to a common supertype 2
  • 4. Declarative Pattern Matching • Describe patterns declaratively • Let the pattern matching engine figure out the optimal execution plan 1 1 from Arend et. al. – Henshin: Advanced Concepts and Tools for In-Place EMF Model Transformations, ACM/IEEE MoDELS 2010 3
  • 5. Declarative Pattern Matching Languages Strengths • Lots of room for behind-the-scene optimisation • Can be executed incrementally (speed/memory trade-off) Weaknesses • Complex patterns can be challenging/verbose to express graphically • Falling back to complex expressions can reduce the scope for optimisation/incrementality • Current execution planners are not great 4
  • 6. Practical Considerations • Bound to a particular modelling technology / model representation format • Non-negligible conversion cost • No support for patterns that involve elements from different (heterogeneous) models • e.g. UML activities and Simulink blocks • No out-of-the-box support for “exporting” the results of pattern matching to downstream activities (e.g. M2M, M2T) 5
  • 7. Epsilon Pattern Language • Hybrid OCL-based pattern matching language • Modelling-technology independent • Support for patterns that involve elements from multiple heterogeneous models • Support for “exporting” detected pattern instances to M2T, M2M transformations etc. 6
  • 9. Example: Attributes to Pull Up • Find pairs of attributes that can be moved up to a common supertype 8
  • 10. Finding Attributes to Pull Up using EPL pattern AttributesToPullUp c : EClass , a1 , a2 : EAttribute { match : a1.name = a2.name and a1.eType = a2.eType and a1 <> a2 and a1. eContainingClass . eAllSuperTypes .includes(c) and a2. eContainingClass . eAllSuperTypes .includes(c) } 9
  • 11. A More Performant Version pre { var attributes = EAttribute.all.mapBy(a|a.name ); } pattern AttributesToPullUp c : EClass , a1 : EAttribute , a2 : EAttribute from : attributes.get(a1.name ). excluding(a1) { match : a1.eType = a2.eType and a1. eContainingClass . eAllSuperTypes .includes(c) and a2. eContainingClass . eAllSuperTypes .includes(c) } 10
  • 12. Adding a Second Model • To specify attributes which should be ignored during pattern detection • The second model is an Excel spreadsheet with one worksheet called “Ignore” M class attribute . . . . . . Employee name . . . . . . C 11
  • 13. Pattern Matching on Two Models pre { var attributes = M!EAttribute.all.mapBy(a|a.name ); } pattern AttributesToPullUp c : M!EClass , a1 : M!EAttribute , a2 : M!EAttribute from : attributes.get(a1.name ). excluding(a1) guard : not a1.isIgnored() and not a2.isIgnored() { match : a1.eType = a2.eType and a1. eContainingClass . eAllSuperTypes .includes(c) and a2. eContainingClass . eAllSuperTypes .includes(c) } operation M!EAttribute isIgnored() { return C!Ignore.all.exists(i|i.attribute = self.name and i.class = self. eContainingClass .name ); } 12
  • 14. Consuming Pattern Instances • Pattern instances are wrapped as an EMC-compatible in-memory “model” • Patterns become types (e.g. AttributesToPullUp) • Roles become fields (e.g. c, a1, a2) • Other Epsilon programs can query and navigate them • To transform, validate them etc. • . . . even to detect patterns of patterns 13
  • 15. Pattern Matching in a Workflow <project default="main"> <target name="main"> <epsilon.emf.loadModel name="M" modelfile="model.ecore" metamodeluri="http://www.eclipse.org/emf/2002/Ecore"/> <epsilon.loadModel name="C" type="ExcelModel"> <parameter name="SPREADSHEET FILE" file="config.xlsx"/> </epsilon.loadModel> <epsilon.epl src="patterns.epl" exportas="P"> <model ref="M"/> <model ref="C"/> </epsilon.epl> <epsilon.eol> for (atp in P!AttributesToPullUp.all) { atp.c.name.println(); } <model ref="M"/><model ref="C"/><model ref="P"/> </epsilon.eol> </target > </project > 14
  • 16. Future Work • Experimental evaluation against GrGen.NET, Henshin, VIATRA/EMF-IncQuery, AGG etc. • Static analysis • Parallel and incremental pattern matching 15
  • 17. Summary • Hybrid OCL-based pattern matching language • Modelling-technology independent • Support for “exporting” detected patterns to downstream model management programs eclipse.org/epsilon 16