UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
UQRuleInstance.h
1 /***************************************************************************
2  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef UQRULEINSTANCE_H_
21 #define UQRULEINSTANCE_H_
22 
23 #include "AnonRule.h"
24 
25 namespace uncover {
26  namespace graphs {
27 
35  class UQRuleInstance: public AnonRule {
36 
37  friend class UQRule;
38 
39  public:
40 
50  UQRuleInstance(AnonRule const& rule,
51  unordered_set<IDType> const& leftUQVertices,
52  unordered_set<IDType> const& rightUQVertices);
53 
66  UQRuleInstance(string name,
67  AnonHypergraph_sp leftGraph,
68  AnonHypergraph_sp rightGraph,
69  Mapping const& mapping,
70  unordered_set<IDType> const& leftUQVertices,
71  unordered_set<IDType> const& rightUQVertices);
72 
79  UQRuleInstance(AnonHypergraph const& graph, unordered_set<IDType> const& uqVertices);
80 
84  virtual ~UQRuleInstance();
85 
90  unordered_set<IDType>& getLeftUQVertices();
91 
96  unordered_set<IDType> const& getLeftUQVertices() const;
97 
102  unordered_set<IDType>& getRightUQVertices();
103 
108  unordered_set<IDType> const& getRightUQVertices() const;
109 
118  virtual bool isBackApplicable(AnonHypergraph const& graph, Mapping const& match) const override;
119 
120  virtual void fillSplitRule(pair<AnonRule_sp, AnonRule_sp>& rulePair) const override;
121 
122  protected:
123 
127  unordered_set<IDType> leftUQVertices;
128 
132  unordered_set<IDType> rightUQVertices;
133 
134  };
135 
139  typedef shared_ptr<UQRuleInstance> UQRuleInstance_sp;
140 
144  typedef shared_ptr<UQRuleInstance const> UQRuleInstance_csp;
145 
146  }
147 }
148 
149 #endif /* UQRULEINSTANCE_H_ */
shared_ptr< AnonHypergraph > AnonHypergraph_sp
Alias of a shared pointer to an AnonHypergraph.
Definition: AnonHypergraph.h:415
unordered_set< IDType > & getLeftUQVertices()
Returns the set of universally quantified vertices of the left-hand side.
Definition: UQRuleInstance.cpp:44
UQRuleInstance(AnonRule const &rule, unordered_set< IDType > const &leftUQVertices, unordered_set< IDType > const &rightUQVertices)
Creates a new UQRuleInstance from the given AnonRule and with the given sets of universally quantifie...
Definition: UQRuleInstance.cpp:29
This is the data structure representing a morphism mapping from a graph to another graph...
Definition: Mapping.h:36
virtual bool isBackApplicable(AnonHypergraph const &graph, Mapping const &match) const override
Checks whether this UQRuleInstance is backward applicable or not.
Definition: UQRuleInstance.cpp:60
shared_ptr< UQRuleInstance > UQRuleInstance_sp
Alias of a shared pointer to a UQRuleIstance.
Definition: UQRuleInstance.h:139
AnonRule serves as a data structure of a rule object.
Definition: AnonRule.h:39
An AnonHypergraph is a data structure storing a hypergraph.
Definition: AnonHypergraph.h:43
string name
Stores the name of this rule.
Definition: AnonRule.h:202
This class serves as data structure of a universally quantified rule.
Definition: UQRule.h:38
unordered_set< IDType > leftUQVertices
Stores all universally quantified IDs in the left-hand side.
Definition: UQRuleInstance.h:127
unordered_set< IDType > & getRightUQVertices()
Returns the set of images of universally quantified vertices in the right-hand side.
Definition: UQRuleInstance.cpp:52
The UQRuleInstance is a rule which is generated when UQRules are instantiated.
Definition: UQRuleInstance.h:35
virtual ~UQRuleInstance()
Destroys this UQRuleInstance.
Definition: UQRuleInstance.cpp:42
shared_ptr< UQRuleInstance const > UQRuleInstance_csp
Alias of a shared pointer to a constant UQRuleInstance.
Definition: UQRuleInstance.h:144
unordered_set< IDType > rightUQVertices
Stores all images of universally quantified IDs in the right-hand side.
Definition: UQRuleInstance.h:132