UnCoVer (Using Coverability for Verification)
|
Represents the data structure for a rule including a unique identifier. More...
#include <Rule.h>
Public Member Functions | |
Rule (string name="", AnonHypergraph_sp left=make_shared< AnonHypergraph >(), AnonHypergraph_sp right=make_shared< AnonHypergraph >(), Mapping const &match=Mapping()) | |
Generates a new rule with the given name, left graph, right graph and mapping. More... | |
Rule (Rule const &oldRule) | |
Generates a new rule for the given rule, copying its content. More... | |
Rule (AnonRule const &oldRule) | |
Generates a new rule for the given rule, copying its content. More... | |
Rule (AnonHypergraph const &graph) | |
Generates a new rule using the given graph. More... | |
virtual | ~Rule () |
Destroys this Rule object. | |
IDType | getID () const |
Returns the unique identifier of this Rule object. More... | |
virtual void | streamTo (std::ostream &ost) const override |
Streams as string representation of this Streamable object to the given ostream. More... | |
string | getName () const |
Returns the name of this rule. More... | |
void | setName (string name) |
Sets the name of this rule to the given string. More... | |
AnonHypergraph_sp | getLeft () |
Returns a pointer to the left graph of this rule. More... | |
AnonHypergraph_csp | getLeft () const |
Returns a pointer to the left graph of this rule. More... | |
AnonHypergraph_sp | getRight () |
Returns a pointer to the right graph of this rule. More... | |
AnonHypergraph_csp | getRight () const |
Returns a pointer to the right graph of this rule. More... | |
void | setLeft (AnonHypergraph_sp graph) |
Sets the left graph of this rule to be the given graph. More... | |
void | setRight (AnonHypergraph_sp graph) |
Sets the right graph of this rule to be the given graph. More... | |
Mapping & | getMapping () |
Returns a reference to the mapping of this rule. More... | |
Mapping const & | getMapping () const |
Returns a reference to the mapping of this rule. More... | |
void | setMapping (Mapping const &map) |
Replaces the mapping of this rule by the given mapping. More... | |
virtual bool | isBackApplicable (AnonHypergraph const &graph, Mapping const &match) const |
Returns true, if this rule is backward applicable to the given graph, i.e. More... | |
virtual void | fillSplitRule (pair< shared_ptr< AnonRule >, shared_ptr< AnonRule >> &rulePair) const |
Splits this rule into a total and a partial part and stores both subrules in the given pair. More... | |
bool | isInjective () const |
Checks and returns true, iff the rule is injective. More... | |
bool | isConflictFree (Mapping const &match) const |
Check whether the given match is conflict-free wrt. More... | |
Protected Member Functions | |
void | adjustSplitRule (AnonRule &partial, AnonRule &total) const |
Takes two rules and changes them to be the two split rules of this rule. More... | |
Protected Attributes | |
IDType | ID |
Stores the ID of this Rule. | |
string | name |
Stores the name of this rule. | |
AnonHypergraph_sp | left |
Stores a pointer to the left graph of this rule. | |
AnonHypergraph_sp | right |
Stores a pointer to the right graph of this rule. | |
Mapping | interface |
Stores the mapping from the left to the right graph of this rule. | |
Represents the data structure for a rule including a unique identifier.
The rule consists of a name, a left rulegraph, a right rulegraph and a mapping form the left to the right graph. This class slightly extends the AnonRule class.
Rule | ( | string | name = "" , |
AnonHypergraph_sp | left = make_shared<AnonHypergraph>() , |
||
AnonHypergraph_sp | right = make_shared<AnonHypergraph>() , |
||
Mapping const & | match = Mapping() |
||
) |
Generates a new rule with the given name, left graph, right graph and mapping.
If these parameters are not given, an empty string is used as name, empty graphs are used as left and right sides and an empty mapping is used as mapping. This rule is also assigned a new unique identifier. Caution, the left and right graphs are stores and not copied by this constructor.
name | the name of the rule (default: empty string) |
left | the left graph of the rule (default: empty graph) |
right | the right graph of the rule (default: empty graph) |
match | the mapping of the left to the right graph (default: empty mapping) |
Generates a new rule for the given rule, copying its content.
The new rule is an independent copy of the old rule and is assigned a new unique identifier.
oldRule | the old rule from which the data will be copied |
Generates a new rule for the given rule, copying its content.
The new rule is an independent copy of the old rule and is assigned a new unique identifier.
oldRule | the old rule from which the data will be copied |
Rule | ( | AnonHypergraph const & | graph | ) |
Generates a new rule using the given graph.
A copy of the given graph is generated as left and as right graph and the mapping is initialized to be the identity. Furthermore, the new rule is assigned a new unique identifier.
graph | the graph which will be used as left and right graph |
Takes two rules and changes them to be the two split rules of this rule.
The first rule (partial) has to be the identity on the left side of this rule and the second rule (total) has to be a copy of this rule.
partial | the identity rule on the left graph of this rule |
total | a copy of this rule |
|
virtualinherited |
Splits this rule into a total and a partial part and stores both subrules in the given pair.
The first rule p is the partial rule and the second rule t is the total rule, such that the composition t(p(x)) is the old rule.
rulePair | a reference to a pair of rule pointer, which will be set to the actual pointer to the split rules |
IDType getID | ( | ) | const |
Returns the unique identifier of this Rule object.
|
inherited |
Returns a pointer to the left graph of this rule.
|
inherited |
Returns a pointer to the left graph of this rule.
|
inherited |
Returns a reference to the mapping of this rule.
|
inherited |
Returns a reference to the mapping of this rule.
|
inherited |
Returns the name of this rule.
|
inherited |
Returns a pointer to the right graph of this rule.
|
inherited |
Returns a pointer to the right graph of this rule.
|
virtualinherited |
Returns true, if this rule is backward applicable to the given graph, i.e.
there is at least one graph to which this rule can be applied and the application results in the given graph. The given mapping is used as co-match from the right side of the rule to the given graph. Caution, this functions assumes that the match is a valid total morphism, but does not perfom checks.
graph | the graph to which the rule should be applied backwards |
match | the mapping used as co-match from the right graph to the given graph |
Reimplemented in UQRuleInstance.
|
inherited |
Check whether the given match is conflict-free wrt.
this rule, i.e. there are no two nodes or edges with the same image under the match such that one of these nodes is deleted by the rule and the other is preserved.
match | the match to be checked; it must match all nodes of the left-hand side to some graph (which we do not need to know) return true iff the match is conflict-free wrt. this rule |
|
inherited |
Checks and returns true, iff the rule is injective.
A rule is injective if two elements of the left graph are never mapped to the same element of the right graph. Note that a rule need not be total to be injective.
|
inherited |
Sets the left graph of this rule to be the given graph.
Caution, the given graph is used directly and not copied. Furthermore, the mapping and right graph are not changed.
graph | the new left graph of this rule |
|
inherited |
Replaces the mapping of this rule by the given mapping.
The given mapping is copied and not used directly.
map | the new mapping of this rule |
|
inherited |
Sets the name of this rule to the given string.
name | the new name of this rule |
|
inherited |
Sets the right graph of this rule to be the given graph.
Caution, the given graph is used directly and not copied. Furthermore, the mapping and left graph are not changed.
graph | the new right graph of this rule |
|
overridevirtual |
Streams as string representation of this Streamable object to the given ostream.
ost | the stream to which the string representation will be written |
Reimplemented from AnonRule.