UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TotalPOCEnumerator Class Reference

This enumerator computes all pushout complements for all co-matches from a total (given) rule to a given graph. More...

#include <TotalPOCEnumerator.h>

Collaboration diagram for TotalPOCEnumerator:
Collaboration graph
[legend]

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...
 
TotalPOCEnumeratoroperator++ ()
 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.
 
StdMatchFindermatcher
 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::HypergraphtemplateGraphOr
 A copy of an initially non-merged POC. More...
 
graphs::MappingtemplateMappOr
 The mapping from L to templateGraphOr. More...
 
graphs::HypergraphtemplateGraphME
 A copy of the POC after performing the mergings of edges (including implied mergings on vertices. More...
 
graphs::MappingtemplateMappME
 The mapping from L to templateGraphME. More...
 
graphs::MappingmappPOCtoGraph
 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...
 

Detailed Description

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.

Author
Jan Stückrath

Constructor & Destructor Documentation

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.

Parameters
rulethe rule which should be applied backwards
graphthe graph to which the co-matches will be computed
injectiveset to true if only injective POCs are wanted

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.

Parameters
oldEnumthe enumerator of which the contents will be moved

Member Function Documentation

bool chooseNextMatch ( )
private

Searches for the next match where pushout complements exist.

Discards all matches where no POCs exist.

Returns
true iff a match was found, i.e. the enumerator did not end
void computePOC ( )
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.

void computePOCInj ( )
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.

void computePOCInjRule ( )
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.

Returns
true if there are no more POCs to compute
void generateNonMergedPOC ( )
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.

Returns
a reference to the co-match currently used
Hypergraph_sp getGraph ( ) const

Returns the last computed pushout complement graph.

Returns
the last computed pushout complement graph
Mapping_sp getMapping ( ) const

Returns the last computed Mapping (from L to the POC).

Returns
the last computed Mapping (from L to the POC)
bool incEnums ( vector< IDClosureEnumerator > &  enums)
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.

Returns
true iff the increment was possible, i.e. not all possibilities where enumerated yet
bool incEnums ( vector< IDtoIDEnumerator > &  enums)
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.

Returns
true iff the increment was possible, i.e. not all possibilities where enumerated yet
void initEdgeTemplates ( )
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.

void initTemplatesInj ( )
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.

void initVertexTemplates ( )
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.

Returns
a reference to this enumerator
void reset ( )

Resets this enumerator to its initial values.

After this call will cause the enumeration process to start from the beginning.

Member Data Documentation

vector<IDClosureEnumerator>* edgeEnums
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.

graphs::Mapping* mappPOCtoGraph
private

The mapping from templateGraphOr to the matched graph.

Only used if rule is non-injective.

shared_ptr<vector<graphs::Mapping> > matchList
private

A list of all co-matches computed.

The last element is used as the current match and used matches are popped.

graphs::Hypergraph* templateGraphME
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.

graphs::Hypergraph* templateGraphOr
private

A copy of an initially non-merged POC.

Only used if rule is non-injective.

graphs::Mapping* templateMappME
private

The mapping from L to templateGraphME.

Only used if rule is non-injective and matchings may be non-injective.

graphs::Mapping* templateMappOr
private

The mapping from L to templateGraphOr.

Only used if rule is non-injective.

vector<IDClosureEnumerator>* vertexEnums
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.

vector<IDtoIDEnumerator>* vertexEnumsInj
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.


The documentation for this class was generated from the following files: