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

This enumerator can be used to enumerate all pushout complements of a (partial) rule and a graph. More...

#include <SubgraphPOCEnumerator.h>

Inheritance diagram for SubgraphPOCEnumerator:
Inheritance graph
[legend]
Collaboration diagram for SubgraphPOCEnumerator:
Collaboration graph
[legend]

Public Member Functions

 SubgraphPOCEnumerator (bool inj, int bound)
 Creates a new enumerator with the given parameters. More...
 
 SubgraphPOCEnumerator (SubgraphPOCEnumerator &&oldEnum)
 Move constructor. More...
 
virtual ~SubgraphPOCEnumerator ()
 Destroys this enumerator.
 
virtual bool ended () const override
 Returns true, iff the last element was already enumerated, i.e. More...
 
virtual SubgraphPOCEnumeratoroperator++ () override
 Computes the next minimal pushout complement if any. More...
 
virtual graphs::Hypergraph_sp operator* () const override
 Returns the last computed minimal pushout complement. More...
 
virtual bool resetWith (graphs::AnonRule_csp rule, IDType ruleID, graphs::Hypergraph_csp graph) override
 Initializes this enumerator to compute all minimal pushout complements for the given rule and graph. More...
 
bool resetWith (graphs::Rule_csp rule, graphs::Hypergraph_csp graph)
 Initializes this enumerator to compute all minimal pushout complements for the given rule and graph. More...
 
void setResultHandler (BackwardResultHandler_sp resHandler)
 Set the BackwardResultHandler used by this enumerator to the given one. More...
 
void setPreparedGTS (PreparedGTS_csp gts)
 Set the PreparedGTS used by this enumerator to the given one. More...
 

Protected Attributes

BackwardResultHandler_sp resultHandler
 Stores the BackwardResultHandler used by this enumerator.
 
PreparedGTS_csp prepGTS
 Stores a pointer to the PrepareGTS from which the rules will be taken, which are used to initialize this enumerator.
 

Private Member Functions

void checkAndThrow () const
 Checks if this enumerator is valid, i.e. More...
 
bool exceedsBound () const
 Checks if the last graph computed by the stored PartialPOCEnumerator exceeds the path bound. More...
 

Private Attributes

int pathbound
 Stores the path bound used by this enumerator. More...
 
bool injective
 Stores whether injective (true) or conflict-free (false) matches should be used.
 
rule_engine::PartialPOCEnumeratorpartialEnumerator
 Stores a PartialPOCEnumerator used for the pushout complement computation.
 
IDType ruleID
 Stores the ID of the rule applied backwards, for logging.
 
IDType graphID
 Stores the ID of the graph, for logging.
 

Detailed Description

This enumerator can be used to enumerate all pushout complements of a (partial) rule and a graph.

Only the pushout complements minimal wrt the subgraph ordering are enumerated. Depending on the initialization parameters, the matches (to the pushout complement) are either guaranteed to be injective or conflict-free. Furthermore, a path bound can be given, which will cause every pushout complement exceeding this bound to be dropped.

Author
Jan Stückrath
See Also
SubgraphOrder
analysis::MinPOCEnumerator

Constructor & Destructor Documentation

SubgraphPOCEnumerator ( bool  inj,
int  bound 
)

Creates a new enumerator with the given parameters.

If the first parameter is true, only injective matches will be used, otherwise matches may be conflict-free. The second parameter sets a path bound, causing all pushout complements to be dropped containing a longer path. A negative path bound disables this check.

Parameters
injuse true for injective and false for conflict-free matches
boundsets the longest path length allowed in a pushout complement; a negative number disables check

Move constructor.

All data of the old enumerator will be moved to the new one, invalidating the old enumerator. Use the old enumerator after this call (apart from deletion) will throw exceptions.

Parameters
oldEnumthe old enumerator of which the data will be moved

Member Function Documentation

void checkAndThrow ( ) const
private

Checks if this enumerator is valid, i.e.

its data was not moved away, and throws an exception if it is not.

bool ended ( ) const
overridevirtual

Returns true, iff the last element was already enumerated, i.e.

no new graph could be computed, when operator++() was called the last time. If this function returns true, a call of operator*() will return null.

Returns
true, iff the last element was already enumerated

Implements MinPOCEnumerator.

bool exceedsBound ( ) const
private

Checks if the last graph computed by the stored PartialPOCEnumerator exceeds the path bound.

If this check fails, or if this check is disabled, false is returned.

Returns
true, iff the path bound is positive and the current graph exceeds it.
Hypergraph_sp operator* ( ) const
overridevirtual

Returns the last computed minimal pushout complement.

If this enumerator has ended, this function will return null.

Returns
the last computed minimal POC, or null if enumerator has ended

Implements MinPOCEnumerator.

SubgraphPOCEnumerator & operator++ ( )
overridevirtual

Computes the next minimal pushout complement if any.

Returns
a reference to this enumerator

Implements MinPOCEnumerator.

bool resetWith ( graphs::AnonRule_csp  rule,
IDType  ruleID,
graphs::Hypergraph_csp  graph 
)
overridevirtual

Initializes this enumerator to compute all minimal pushout complements for the given rule and graph.

When this function is called, any previous computation by this enumerator will be discarded.

Parameters
rulethe rule used for the pushout complement computation
ruleIDthe rule ID which will be displayed in the logs
graphthe graph (pushout object) used for the POC computation
Returns
true iff the reset operation was successful

Implements MinPOCEnumerator.

bool resetWith ( graphs::Rule_csp  rule,
graphs::Hypergraph_csp  graph 
)
inlineinherited

Initializes this enumerator to compute all minimal pushout complements for the given rule and graph.

When this function is called, any previous computation by this enumerator will be discarded.

Parameters
rulethe rule used for pushout complement computation
graphthe graph used for pushout complement computation
Returns
true iff the reset operation was successful
void setPreparedGTS ( PreparedGTS_csp  gts)
inlineinherited

Set the PreparedGTS used by this enumerator to the given one.

Parameters
gtsthe new PreparedGTS to be used
void setResultHandler ( BackwardResultHandler_sp  resHandler)
inlineinherited

Set the BackwardResultHandler used by this enumerator to the given one.

Parameters
resHandlerthe BackwardResultHandler to be used

Member Data Documentation

int pathbound
private

Stores the path bound used by this enumerator.

May be negative.


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