UnCoVer (Using Coverability for Verification)
|
This enumerator computes all pushout complements for all co-matches from a total (given) rule to a given graph. More...
#include <TotalPOCEnumerator.h>
Public Member Functions | |
TotalPOCEnumerator (graphs::AnonRule_csp rule, graphs::Hypergraph_csp graph, bool injective) | |
Initializes a new TotalPOCEnumerator with the given graph and rule as parameters. More... | |
TotalPOCEnumerator (TotalPOCEnumerator &&oldEnum) | |
Move constructor. More... | |
virtual | ~TotalPOCEnumerator () |
Destroys this instance of the TotalPOCEnumerator. | |
void | reset () |
Resets this enumerator to its initial values. More... | |
bool | ended () const |
Returns true if there are no more POCs to compute. More... | |
TotalPOCEnumerator & | operator++ () |
Computes the next pushout complement. More... | |
graphs::Mapping_sp | getMapping () const |
Returns the last computed Mapping (from L to the POC). More... | |
graphs::Hypergraph_sp | getGraph () const |
Returns the last computed pushout complement graph. More... | |
graphs::Mapping const & | getCurrentCoMatch () const |
Returns a reference to the co-match currently used for the computation of POCs. More... | |
Private Member Functions | |
void | initEdgeTemplates () |
Generates enumerators for the equivalences on edges and computes an initial, non-merged POC. More... | |
void | initVertexTemplates () |
First performs merging of vertices and edges according to the current equivalence on the edges, and then generates the enumerators for possible equivalences on vertices. More... | |
void | initTemplatesInj () |
Generates enumerators for attaching edges in all possible ways to split vertices in the POC and generates an initial non-merged POC. More... | |
void | generateNonMergedPOC () |
Generates an initial POC without any mergings. More... | |
void | computePOC () |
Computes the current pushout complement from the temporary values computed to far. More... | |
void | computePOCInj () |
Computes the current pushout complement from the temporary values computed to far. More... | |
void | computePOCInjRule () |
Computes the current pushout complement without use of any temporary computed values. More... | |
bool | chooseNextMatch () |
Searches for the next match where pushout complements exist. More... | |
bool | incEnums (vector< IDClosureEnumerator > &enums) |
Increments the given collection of enumerators such that the next POC can be generated from it. More... | |
bool | incEnums (vector< IDtoIDEnumerator > &enums) |
Increments the given collection of enumerators such that the next POC can be generated from it. More... | |
void | deleteTemporaryFields () |
Deletes all temporary fields used in the POC computation (freeing their memory). | |
Private Attributes | |
graphs::AnonRule_csp | rule |
The rule which should be applied backwards. | |
graphs::Hypergraph_csp | graph |
The graph to be matched to. | |
const bool | injective |
Stores if the POCs should be injective. | |
const bool | injectiveRule |
Stores if the rule is injective. | |
StdMatchFinder * | matcher |
Stores a matcher used to compute matchings from the right side to the given graph. | |
shared_ptr< vector < graphs::Mapping > > | matchList |
A list of all co-matches computed. More... | |
graphs::Hypergraph_sp | currGraph |
The last computed POC graph. | |
graphs::Mapping_sp | currMapp |
The last computed match from the left side to the last computed POC. | |
vector< IDClosureEnumerator > * | edgeEnums |
A list of enumerators for enumerating all possible equivalences on edges. More... | |
vector< IDClosureEnumerator > * | vertexEnums |
A list of enumerators for enumerating all possible equivalences on vertices. More... | |
graphs::Hypergraph * | templateGraphOr |
A copy of an initially non-merged POC. More... | |
graphs::Mapping * | templateMappOr |
The mapping from L to templateGraphOr. More... | |
graphs::Hypergraph * | templateGraphME |
A copy of the POC after performing the mergings of edges (including implied mergings on vertices. More... | |
graphs::Mapping * | templateMappME |
The mapping from L to templateGraphME. More... | |
graphs::Mapping * | mappPOCtoGraph |
The mapping from templateGraphOr to the matched graph. More... | |
vector< IDtoIDEnumerator > * | vertexEnumsInj |
A list of enumerators for enumerating possibilities to attach edges to split vertices. More... | |
This enumerator computes all pushout complements for all co-matches from a total (given) rule to a given graph.
The enumerator can be configured to compute only pushout complements, where the match (from L to the POC) is injective.
TotalPOCEnumerator | ( | graphs::AnonRule_csp | rule, |
graphs::Hypergraph_csp | graph, | ||
bool | injective | ||
) |
Initializes a new TotalPOCEnumerator with the given graph and rule as parameters.
The given rule must be a total morphism. The matches can be set to injective or conflict-free.
rule | the rule which should be applied backwards |
graph | the graph to which the co-matches will be computed |
injective | set to true if only injective POCs are wanted |
TotalPOCEnumerator | ( | TotalPOCEnumerator && | oldEnum | ) |
Move constructor.
Constructs a new TotalPOCEnumerator and moves the content of the given TotalPOCEnumerator to the new one. Thereafter the old enumerator is invalid and may cause exceptions and/or undefined behaviour if used.
oldEnum | the enumerator of which the contents will be moved |
|
private |
Searches for the next match where pushout complements exist.
Discards all matches where no POCs exist.
|
private |
Computes the current pushout complement from the temporary values computed to far.
Only used if the rule is non-injective and matchings may be non-injective.
|
private |
Computes the current pushout complement from the temporary values computed to far.
Only used if the rule is non-injective and matchings are set to be injective.
|
private |
Computes the current pushout complement without use of any temporary computed values.
Only used if the rule is injective.
bool ended | ( | ) | const |
Returns true if there are no more POCs to compute.
If this method returns true, call of other functions may throw exceptions.
|
private |
Generates an initial POC without any mergings.
Only used if the rule is non-injective. The initial POC is generated in the following way: 1) Generate a copy of the left side L. 2) Add a vertex for each vertex of the matched graph G without a preimage in R. 3) Add an edge for each edge of G without a preimage in R. Attach this edge to new vertices (adding them), except the vertex was already added in the previous step.
Mapping const & getCurrentCoMatch | ( | ) | const |
Returns a reference to the co-match currently used for the computation of POCs.
Hypergraph_sp getGraph | ( | ) | const |
Returns the last computed pushout complement graph.
Mapping_sp getMapping | ( | ) | const |
Returns the last computed Mapping (from L to the POC).
|
private |
Increments the given collection of enumerators such that the next POC can be generated from it.
Only used if the rule is non-injective and matchings may be non-injective.
|
private |
Increments the given collection of enumerators such that the next POC can be generated from it.
Only used if the rule is non-injective and matchings are set to be injective.
|
private |
Generates enumerators for the equivalences on edges and computes an initial, non-merged POC.
Only used if the rule is non-injective and matchings may be non-injective. Initializes the fields: edgeEnums, templateGraphOr, templateMappOr and mappPOCtoGraph.
|
private |
Generates enumerators for attaching edges in all possible ways to split vertices in the POC and generates an initial non-merged POC.
Only used if the rule is non-injective and matchings are set to be injective. Initializes the fields: vertexEnumsInj, templateGraphOr and templateMappOr.
|
private |
First performs merging of vertices and edges according to the current equivalence on the edges, and then generates the enumerators for possible equivalences on vertices.
Only used if the rule is non-injective and matchings may be non-injective. Initializes the fields: vertexEnums, templateGraphME and templateMappME.
TotalPOCEnumerator & operator++ | ( | ) |
Computes the next pushout complement.
If the enumerator ended before calling this method, it behaves as a no-op.
void reset | ( | ) |
Resets this enumerator to its initial values.
After this call will cause the enumeration process to start from the beginning.
|
private |
A list of enumerators for enumerating all possible equivalences on edges.
Only used if rule is non-injective and matchings may be non-injective.
|
private |
The mapping from templateGraphOr to the matched graph.
Only used if rule is non-injective.
|
private |
A list of all co-matches computed.
The last element is used as the current match and used matches are popped.
|
private |
A copy of the POC after performing the mergings of edges (including implied mergings on vertices.
Only used if rule is non-injective and matchings may be non-injective.
|
private |
A copy of an initially non-merged POC.
Only used if rule is non-injective.
|
private |
The mapping from L to templateGraphME.
Only used if rule is non-injective and matchings may be non-injective.
|
private |
The mapping from L to templateGraphOr.
Only used if rule is non-injective.
|
private |
A list of enumerators for enumerating all possible equivalences on vertices.
Only used if rule is non-injective and matchings may be non-injective.
|
private |
A list of enumerators for enumerating possibilities to attach edges to split vertices.
Only used if rule is non-injective and matchings are set to be injective.