SlideShare a Scribd company logo
1 of 28
Download to read offline
Local Search-based
Pattern Matching Features in
EMF-IncQuery
2015. 07. 22. 1Local search-based pattern matching features in EMF-IncQuery
Márton Búr, Zoltán Ujhelyi, Ákos Horváth, Dániel Varró
Presenter: Ábel Hegedüs
IncQuery Labs Ltd.
Budapest University of Technology and Economics
Anti-pattern Detection in Java Programs
2015. 07. 22. 2Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
Anti-pattern Detection in Java Programs
2015. 07. 22. 3Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
EMF metamodel of Java programs (part)
Anti-pattern Detection in Java Programs
2015. 07. 22. 4Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
Instance model in EMF editor
Anti-pattern Detection in Java Programs
2015. 07. 22. 5Local search-based pattern matching features in EMF-IncQuery
public class StringLiteralCompareTest {
public StringLiteralCompareTest srcVar;
@Override
public boolean equals(Object other) {
return super.equals(other);
}
public void test() {
srcVar.equals("source");
}
}
String Literal as Compare Parameter
(anti-pattern as graph pattern)
inv: MethodInvocation
name = “equals”
m: NormalMethod
arg: StringLiteral
op: Literal
invokes operand
argument
check count
matches == 1
: Expression
Pattern Matching Strategies
2015. 07. 22. 6Local search-based pattern matching features in EMF-IncQuery
Local Search
• Executes a search plan
• Lower memory requirements
• Tools: ATL, GrGen.net, FUJABA, …
Incremental
• Maintains a cache structure
• Efficient recalculation
• Tools: EMF-IncQuery, Drools, ...
Local-search Based Pattern Matching
2015. 07. 22. 7Local search-based pattern matching features in EMF-IncQuery
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
Local-search Based Pattern Matching
2015. 07. 22. 8Local search-based pattern matching features in EMF-IncQuery
Normal Method
1
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
Local-search Based Pattern Matching
2015. 07. 22. 9Local search-based pattern matching features in EMF-IncQuery
Normal Method
1
2
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 10Local search-based pattern matching features in EMF-IncQuery
Normal Method
Method
Invocation
invokes
1
2
3
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 11Local search-based pattern matching features in EMF-IncQuery
Normal Method
StringLiteral
Method
Invocation
invokes
1
2
3
6
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
Local-search Based Pattern Matching
2015. 07. 22. 12Local search-based pattern matching features in EMF-IncQuery
Normal Method
StringLiteral
Identifier
Method
Invocation
invokes
1
2
3
6
8
Find all m that m ∈ NormalMethod
Attribute test: m.name=="equals”
Find inv that inv.invokes → m
Count of inv.argument → arg is 1
Find arg that inv.argument → arg
Instance test: arg is a StringLiteral
Find op that inv.operand → op
NEG: op is not a Literal8
7
6
5
4
3
2
1
name: “equals”
EMF-IncQuery
2015. 07. 22. 13Local search-based pattern matching features in EMF-IncQuery
Runtime
Incremental
queries using
Rete backend
Local search
backend
IDE
Language
Code
generator
Development
tools
Query
Explorer
Local Search
Debugger
Local Search Runtime
2015. 07. 22. 14Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Graph
patterns
Local Search Runtime
2015. 07. 22. 15Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Graph
patterns
• Calculates matches
• Manages model indexes
Local Search Runtime
2015. 07. 22. 16Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Local Search Runtime
2015. 07. 22. 17Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Default (incremental)
query executor
Local Search Runtime
2015. 07. 22. 18Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Rete backend
Graph
patterns
Pattern matches
Local Search Runtime
2015. 07. 22. 19Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Local search backend
Planner
Graph
patterns
Pattern matches
• Initializes search plans
• Reuses pre-populated
model indexes
Local Search Runtime
2015. 07. 22. 20Local search-based pattern matching features in EMF-IncQuery
IncQuery Engine
Model
Local search backend
Planner Matcher
Graph
patterns
Pattern matches
• Executes search plans
• Based on depth-first search
EMF-IncQuery IDE
2015. 07. 22. 21Local search-based pattern matching features in EMF-IncQuery
EMF-IncQuery IDE
2015. 07. 22. 22Local search-based pattern matching features in EMF-IncQuery
Query Editor
Defines graph patterns
Model Editor
EMF-based editor
Query Explorer
Displays query results
Local Search Debugger
2015. 07. 22. 23Local search-based pattern matching features in EMF-IncQuery
Step-by-step execution of search plans
• Visualizes search plans
• Visualizes (partial) query results
Local Search Debugger
2015. 07. 22. 24Local search-based pattern matching features in EMF-IncQuery
Step-by-step execution of search plans
• Visualizes search plans
• Visualizes (partial) query results
Local Search Debugger
• Based on local search
• Visualizes query
structure
• Step-by-step
execution
Query Explorer
• Relies on incremental
query evaluation
• Reacts on model
changes
• Results can be filtered
DEMO
2015. 07. 22. 25Local search-based pattern matching features in EMF-IncQuery
Performance Characteristics – 1.
2015. 07. 22. 26Local search-based pattern matching features in EMF-IncQuery
1
10
100
1000 10000 100000
SEARCHTIME(S)
PROGRAM SIZE (LOC)
LS INC LS (100) INC (100) LS INC LS (100) INC (100)
Incremental approach is beneficial
in case of re-evaluation
Performance Characteristics – 2.
2015. 07. 22. 27Local search-based pattern matching features in EMF-IncQuery
1
10
100
1000
10000
100000
1000 10000 100000 1000000 10000000
MEMORYUSAGE(MB)
PROGRAM SIZE (LOC)
LS INC LS INC
Local search works
uses less memory
Summary
Local search based pattern matcher
• Alternative execution strategy
• Reuses existing infrastructure
Search Plan Debugger
• Step-by-step execution of search plans
• Complements Query Explorer
Future plans
• Enhanced search plan generation
• Hybrid pattern matching
2015. 07. 22. 28Local search-based pattern matching features in EMF-IncQuery

More Related Content

Similar to Local search-based pattern matching features in EMF-IncQuery

Local search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryLocal search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryÁkos Horváth
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScriptFu Cheng
 
Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Stephan Hochdörfer
 
Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Sanif Sanif
 
Nearest neighbour algorithm
Nearest neighbour algorithmNearest neighbour algorithm
Nearest neighbour algorithmAnmitas1
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep DiveManish Jangir
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopPVS-Studio
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticLB Denker
 
Testing untestable code - phpday
Testing untestable code - phpdayTesting untestable code - phpday
Testing untestable code - phpdayStephan Hochdörfer
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your testsStephen Leigh
 
Learning to rank search results
Learning to rank search resultsLearning to rank search results
Learning to rank search resultsJettro Coenradie
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course yoavrubin
 
ElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleNicolas Badey
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructureLindsay Holmwood
 
Scaling your Android App With Modularization
Scaling your Android App With ModularizationScaling your Android App With Modularization
Scaling your Android App With ModularizationBen Schwab
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14Anthony Ferrara
 

Similar to Local search-based pattern matching features in EMF-IncQuery (20)

Local search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQueryLocal search-based pattern matching features in EMF-IncQuery
Local search-based pattern matching features in EMF-IncQuery
 
Testing untestable code - DPC10
Testing untestable code - DPC10Testing untestable code - DPC10
Testing untestable code - DPC10
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010Testing untestable Code - PFCongres 2010
Testing untestable Code - PFCongres 2010
 
Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...Api specification based function search engine using natural language query-S...
Api specification based function search engine using natural language query-S...
 
Nearest neighbour algorithm
Nearest neighbour algorithmNearest neighbour algorithm
Nearest neighbour algorithm
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep Dive
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelop
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
 
Testing untestable code - phpday
Testing untestable code - phpdayTesting untestable code - phpday
Testing untestable code - phpday
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your tests
 
Learning to rank search results
Learning to rank search resultsLearning to rank search results
Learning to rank search results
 
JavaScript - Programming Languages course
JavaScript - Programming Languages course JavaScript - Programming Languages course
JavaScript - Programming Languages course
 
ElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundleElasticSearch, Elastica, ElasticaBundle
ElasticSearch, Elastica, ElasticaBundle
 
Js tips & tricks
Js tips & tricksJs tips & tricks
Js tips & tricks
 
Behaviour driven infrastructure
Behaviour driven infrastructureBehaviour driven infrastructure
Behaviour driven infrastructure
 
JavaScript Essentials
JavaScript EssentialsJavaScript Essentials
JavaScript Essentials
 
Scaling your Android App With Modularization
Scaling your Android App With ModularizationScaling your Android App With Modularization
Scaling your Android App With Modularization
 
BigCloneBench
BigCloneBenchBigCloneBench
BigCloneBench
 
Beyond design patterns phpnw14
Beyond design patterns   phpnw14Beyond design patterns   phpnw14
Beyond design patterns phpnw14
 

Recently uploaded

Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPirithiRaju
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bSérgio Sacani
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfmuntazimhurra
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and ClassificationsAreesha Ahmad
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsSérgio Sacani
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)Areesha Ahmad
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPirithiRaju
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Botany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questionsBotany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questionsSumit Kumar yadav
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoSérgio Sacani
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Monika Rani
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Lokesh Kothari
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRDelhi Call girls
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPirithiRaju
 

Recently uploaded (20)

Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdf
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Botany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questionsBotany krishna series 2nd semester Only Mcq type questions
Botany krishna series 2nd semester Only Mcq type questions
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 

Local search-based pattern matching features in EMF-IncQuery

  • 1. Local Search-based Pattern Matching Features in EMF-IncQuery 2015. 07. 22. 1Local search-based pattern matching features in EMF-IncQuery Márton Búr, Zoltán Ujhelyi, Ákos Horváth, Dániel Varró Presenter: Ábel Hegedüs IncQuery Labs Ltd. Budapest University of Technology and Economics
  • 2. Anti-pattern Detection in Java Programs 2015. 07. 22. 2Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } }
  • 3. Anti-pattern Detection in Java Programs 2015. 07. 22. 3Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } EMF metamodel of Java programs (part)
  • 4. Anti-pattern Detection in Java Programs 2015. 07. 22. 4Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } Instance model in EMF editor
  • 5. Anti-pattern Detection in Java Programs 2015. 07. 22. 5Local search-based pattern matching features in EMF-IncQuery public class StringLiteralCompareTest { public StringLiteralCompareTest srcVar; @Override public boolean equals(Object other) { return super.equals(other); } public void test() { srcVar.equals("source"); } } String Literal as Compare Parameter (anti-pattern as graph pattern) inv: MethodInvocation name = “equals” m: NormalMethod arg: StringLiteral op: Literal invokes operand argument check count matches == 1 : Expression
  • 6. Pattern Matching Strategies 2015. 07. 22. 6Local search-based pattern matching features in EMF-IncQuery Local Search • Executes a search plan • Lower memory requirements • Tools: ATL, GrGen.net, FUJABA, … Incremental • Maintains a cache structure • Efficient recalculation • Tools: EMF-IncQuery, Drools, ...
  • 7. Local-search Based Pattern Matching 2015. 07. 22. 7Local search-based pattern matching features in EMF-IncQuery Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1
  • 8. Local-search Based Pattern Matching 2015. 07. 22. 8Local search-based pattern matching features in EMF-IncQuery Normal Method 1 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1
  • 9. Local-search Based Pattern Matching 2015. 07. 22. 9Local search-based pattern matching features in EMF-IncQuery Normal Method 1 2 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 10. Local-search Based Pattern Matching 2015. 07. 22. 10Local search-based pattern matching features in EMF-IncQuery Normal Method Method Invocation invokes 1 2 3 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 11. Local-search Based Pattern Matching 2015. 07. 22. 11Local search-based pattern matching features in EMF-IncQuery Normal Method StringLiteral Method Invocation invokes 1 2 3 6 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 12. Local-search Based Pattern Matching 2015. 07. 22. 12Local search-based pattern matching features in EMF-IncQuery Normal Method StringLiteral Identifier Method Invocation invokes 1 2 3 6 8 Find all m that m ∈ NormalMethod Attribute test: m.name=="equals” Find inv that inv.invokes → m Count of inv.argument → arg is 1 Find arg that inv.argument → arg Instance test: arg is a StringLiteral Find op that inv.operand → op NEG: op is not a Literal8 7 6 5 4 3 2 1 name: “equals”
  • 13. EMF-IncQuery 2015. 07. 22. 13Local search-based pattern matching features in EMF-IncQuery Runtime Incremental queries using Rete backend Local search backend IDE Language Code generator Development tools Query Explorer Local Search Debugger
  • 14. Local Search Runtime 2015. 07. 22. 14Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Graph patterns
  • 15. Local Search Runtime 2015. 07. 22. 15Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Graph patterns • Calculates matches • Manages model indexes
  • 16. Local Search Runtime 2015. 07. 22. 16Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns
  • 17. Local Search Runtime 2015. 07. 22. 17Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns Default (incremental) query executor
  • 18. Local Search Runtime 2015. 07. 22. 18Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Rete backend Graph patterns Pattern matches
  • 19. Local Search Runtime 2015. 07. 22. 19Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Local search backend Planner Graph patterns Pattern matches • Initializes search plans • Reuses pre-populated model indexes
  • 20. Local Search Runtime 2015. 07. 22. 20Local search-based pattern matching features in EMF-IncQuery IncQuery Engine Model Local search backend Planner Matcher Graph patterns Pattern matches • Executes search plans • Based on depth-first search
  • 21. EMF-IncQuery IDE 2015. 07. 22. 21Local search-based pattern matching features in EMF-IncQuery
  • 22. EMF-IncQuery IDE 2015. 07. 22. 22Local search-based pattern matching features in EMF-IncQuery Query Editor Defines graph patterns Model Editor EMF-based editor Query Explorer Displays query results
  • 23. Local Search Debugger 2015. 07. 22. 23Local search-based pattern matching features in EMF-IncQuery Step-by-step execution of search plans • Visualizes search plans • Visualizes (partial) query results
  • 24. Local Search Debugger 2015. 07. 22. 24Local search-based pattern matching features in EMF-IncQuery Step-by-step execution of search plans • Visualizes search plans • Visualizes (partial) query results Local Search Debugger • Based on local search • Visualizes query structure • Step-by-step execution Query Explorer • Relies on incremental query evaluation • Reacts on model changes • Results can be filtered
  • 25. DEMO 2015. 07. 22. 25Local search-based pattern matching features in EMF-IncQuery
  • 26. Performance Characteristics – 1. 2015. 07. 22. 26Local search-based pattern matching features in EMF-IncQuery 1 10 100 1000 10000 100000 SEARCHTIME(S) PROGRAM SIZE (LOC) LS INC LS (100) INC (100) LS INC LS (100) INC (100) Incremental approach is beneficial in case of re-evaluation
  • 27. Performance Characteristics – 2. 2015. 07. 22. 27Local search-based pattern matching features in EMF-IncQuery 1 10 100 1000 10000 100000 1000 10000 100000 1000000 10000000 MEMORYUSAGE(MB) PROGRAM SIZE (LOC) LS INC LS INC Local search works uses less memory
  • 28. Summary Local search based pattern matcher • Alternative execution strategy • Reuses existing infrastructure Search Plan Debugger • Step-by-step execution of search plans • Complements Query Explorer Future plans • Enhanced search plan generation • Hybrid pattern matching 2015. 07. 22. 28Local search-based pattern matching features in EMF-IncQuery