UnCoVer (Using Coverability for Verification)
|
This enumerator can be used to enumerate all pushout complements of a (partial) rule and a graph. More...
#include <SubgraphPOCEnumerator.h>
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 SubgraphPOCEnumerator & | operator++ () 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::PartialPOCEnumerator * | partialEnumerator |
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. | |
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.
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.
inj | use true for injective and false for conflict-free matches |
bound | sets the longest path length allowed in a pushout complement; a negative number disables check |
SubgraphPOCEnumerator | ( | SubgraphPOCEnumerator && | oldEnum | ) |
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.
oldEnum | the old enumerator of which the data will be moved |
|
private |
Checks if this enumerator is valid, i.e.
its data was not moved away, and throws an exception if it is not.
|
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.
Implements MinPOCEnumerator.
|
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.
|
overridevirtual |
Returns the last computed minimal pushout complement.
If this enumerator has ended, this function will return null.
Implements MinPOCEnumerator.
|
overridevirtual |
Computes the next minimal pushout complement if any.
Implements MinPOCEnumerator.
|
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.
rule | the rule used for the pushout complement computation |
ruleID | the rule ID which will be displayed in the logs |
graph | the graph (pushout object) used for the POC computation |
Implements MinPOCEnumerator.
|
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.
rule | the rule used for pushout complement computation |
graph | the graph used for pushout complement computation |
|
inlineinherited |
Set the PreparedGTS used by this enumerator to the given one.
gts | the new PreparedGTS to be used |
|
inlineinherited |
Set the BackwardResultHandler used by this enumerator to the given one.
resHandler | the BackwardResultHandler to be used |
|
private |
Stores the path bound used by this enumerator.
May be negative.