20 #ifndef TOTALPOCENUMERATOR_H_
21 #define TOTALPOCENUMERATOR_H_
23 #include "../graphs/AnonRule.h"
24 #include "../graphs/Hypergraph.h"
25 #include "StdMatchFinder.h"
26 #include "IDClosureEnumerator.h"
27 #include "IDtoIDEnumerator.h"
30 namespace rule_engine {
173 bool incEnums(vector<IDClosureEnumerator>& enums);
182 bool incEnums(vector<IDtoIDEnumerator>& enums);
StdMatchFinder provides a simple algorithm which takes two arbitrary graphs and calculates all matchi...
Definition: StdMatchFinder.h:38
graphs::Mapping const & getCurrentCoMatch() const
Returns a reference to the co-match currently used for the computation of POCs.
Definition: TotalPOCEnumerator.cpp:157
void computePOC()
Computes the current pushout complement from the temporary values computed to far.
Definition: TotalPOCEnumerator.cpp:497
graphs::Hypergraph * templateGraphOr
A copy of an initially non-merged POC.
Definition: TotalPOCEnumerator.h:249
void generateNonMergedPOC()
Generates an initial POC without any mergings.
Definition: TotalPOCEnumerator.cpp:577
vector< IDClosureEnumerator > * edgeEnums
A list of enumerators for enumerating all possible equivalences on edges.
Definition: TotalPOCEnumerator.h:238
void reset()
Resets this enumerator to its initial values.
Definition: TotalPOCEnumerator.cpp:166
graphs::Mapping_sp currMapp
The last computed match from the left side to the last computed POC.
Definition: TotalPOCEnumerator.h:228
const bool injectiveRule
Stores if the rule is injective.
Definition: TotalPOCEnumerator.h:207
graphs::Mapping_sp getMapping() const
Returns the last computed Mapping (from L to the POC).
Definition: TotalPOCEnumerator.cpp:569
This enumerator computes all pushout complements for all co-matches from a total (given) rule to a gi...
Definition: TotalPOCEnumerator.h:38
virtual ~TotalPOCEnumerator()
Destroys this instance of the TotalPOCEnumerator.
Definition: TotalPOCEnumerator.cpp:143
TotalPOCEnumerator & operator++()
Computes the next pushout complement.
Definition: TotalPOCEnumerator.cpp:212
This is the data structure representing a morphism mapping from a graph to another graph...
Definition: Mapping.h:36
graphs::Hypergraph_csp graph
The graph to be matched to.
Definition: TotalPOCEnumerator.h:197
vector< IDClosureEnumerator > * vertexEnums
A list of enumerators for enumerating all possible equivalences on vertices.
Definition: TotalPOCEnumerator.h:244
vector< IDtoIDEnumerator > * vertexEnumsInj
A list of enumerators for enumerating possibilities to attach edges to split vertices.
Definition: TotalPOCEnumerator.h:279
shared_ptr< vector< graphs::Mapping > > matchList
A list of all co-matches computed.
Definition: TotalPOCEnumerator.h:218
void initEdgeTemplates()
Generates enumerators for the equivalences on edges and computes an initial, non-merged POC...
Definition: TotalPOCEnumerator.cpp:278
void computePOCInjRule()
Computes the current pushout complement without use of any temporary computed values.
Definition: TotalPOCEnumerator.cpp:693
graphs::Hypergraph_sp currGraph
The last computed POC graph.
Definition: TotalPOCEnumerator.h:223
void initTemplatesInj()
Generates enumerators for attaching edges in all possible ways to split vertices in the POC and gener...
Definition: TotalPOCEnumerator.cpp:436
A Hypergraph represents a graph with a unique identifier.
Definition: Hypergraph.h:35
shared_ptr< const Hypergraph > Hypergraph_csp
Alias for a shared pointer to a constant Hypergraph.
Definition: Hypergraph.h:90
shared_ptr< Mapping > Mapping_sp
Alias for a shared pointer to a Mapping object.
Definition: Mapping.h:238
void initVertexTemplates()
First performs merging of vertices and edges according to the current equivalence on the edges...
Definition: TotalPOCEnumerator.cpp:324
graphs::Mapping * templateMappME
The mapping from L to templateGraphME.
Definition: TotalPOCEnumerator.h:267
bool ended() const
Returns true if there are no more POCs to compute.
Definition: TotalPOCEnumerator.cpp:197
graphs::Mapping * templateMappOr
The mapping from L to templateGraphOr.
Definition: TotalPOCEnumerator.h:254
graphs::Hypergraph * templateGraphME
A copy of the POC after performing the mergings of edges (including implied mergings on vertices...
Definition: TotalPOCEnumerator.h:261
graphs::Mapping * mappPOCtoGraph
The mapping from templateGraphOr to the matched graph.
Definition: TotalPOCEnumerator.h:273
bool incEnums(vector< IDClosureEnumerator > &enums)
Increments the given collection of enumerators such that the next POC can be generated from it...
Definition: TotalPOCEnumerator.cpp:525
void deleteTemporaryFields()
Deletes all temporary fields used in the POC computation (freeing their memory).
Definition: TotalPOCEnumerator.cpp:636
shared_ptr< const AnonRule > AnonRule_csp
Alias for a shared pointer to a constant AnonRule.
Definition: AnonRule.h:229
void computePOCInj()
Computes the current pushout complement from the temporary values computed to far.
Definition: TotalPOCEnumerator.cpp:484
graphs::AnonRule_csp rule
The rule which should be applied backwards.
Definition: TotalPOCEnumerator.h:192
StdMatchFinder * matcher
Stores a matcher used to compute matchings from the right side to the given graph.
Definition: TotalPOCEnumerator.h:212
bool chooseNextMatch()
Searches for the next match where pushout complements exist.
Definition: TotalPOCEnumerator.cpp:201
graphs::Hypergraph_sp getGraph() const
Returns the last computed pushout complement graph.
Definition: TotalPOCEnumerator.cpp:573
TotalPOCEnumerator(graphs::AnonRule_csp rule, graphs::Hypergraph_csp graph, bool injective)
Initializes a new TotalPOCEnumerator with the given graph and rule as parameters. ...
Definition: TotalPOCEnumerator.cpp:83
const bool injective
Stores if the POCs should be injective.
Definition: TotalPOCEnumerator.h:202
shared_ptr< Hypergraph > Hypergraph_sp
Alias for a shared pointer to a Hypergraph.
Definition: Hypergraph.h:85