UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
GTS.h
1 /***************************************************************************
2  * Copyright (C) 2005 by SZS *
3  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
19  ***************************************************************************/
20 
21 #ifndef DATA_STRUCTURESGTS_H
22 #define DATA_STRUCTURESGTS_H
23 
24 #include "Rule.h"
25 #include "UQRule.h"
26 #include "Hypergraph.h"
27 
28 namespace uncover {
29  namespace graphs {
30 
37  {
38 
39  public:
40 
44  typedef unordered_map<IDType, Rule_sp> RuleMap;
45 
49  typedef unordered_map<IDType, UQRule_sp> UQRuleMap;
50 
58  GTS(string name = "",
59  RuleMap const& rules = (RuleMap()),
60  UQRuleMap const& uqRules = (UQRuleMap()),
61  vector<Hypergraph_sp> const& initialGraphs = vector<Hypergraph_sp>());
62 
66  ~GTS();
67 
72  vector<Hypergraph_sp> const& getInitialGraphs() const;
73 
79  bool addInitialGraph(Hypergraph_sp graph);
80 
85  size_t getInitialCount() const;
86 
91  string getName() const;
92 
97  RuleMap const& getStdRules() const;
98 
104  bool addStdRule(Rule_sp rule);
105 
110  size_t getStdRuleCount() const;
111 
116  UQRuleMap const& getUQRules() const;
117 
123  bool addUQRule(UQRule_sp rule);
124 
129  size_t getUQRuleCount() const;
130 
135  virtual void streamTo(std::ostream& ost) const;
136 
137  protected:
138 
142  string name;
143 
147  vector<Hypergraph_sp> initialGraphs;
148 
153 
158 
159  };
160 
164  typedef shared_ptr<GTS> GTS_sp;
165 
169  typedef shared_ptr<const GTS> GTS_csp;
170 
171  }
172 }
173 
174 #endif
UQRuleMap const & getUQRules() const
Returns a reference to the universally quantified rules of this GTS.
Definition: GTS.cpp:66
bool addStdRule(Rule_sp rule)
Adds the given Rule to the standard rules of this GTS.
Definition: GTS.cpp:41
vector< Hypergraph_sp > const & getInitialGraphs() const
Returns a reference to the collection of initial graphs of this GTS.
Definition: GTS.cpp:54
Streamable provides a streaming function which must be implemented by any deriving class...
Definition: Streamable.h:31
shared_ptr< const GTS > GTS_csp
Alias for a shared pointer to a constant GTS object.
Definition: GTS.h:169
size_t getInitialCount() const
Returns the number of initial graphs of this GTS.
Definition: GTS.cpp:58
shared_ptr< Rule > Rule_sp
Alias for a shared pointer to a Rule.
Definition: Rule.h:105
virtual void streamTo(std::ostream &ost) const
Prints a string representation of this GTS to the given steam.
Definition: GTS.cpp:96
unordered_map< IDType, UQRule_sp > UQRuleMap
An alias for the map storing universally quantified rules.
Definition: GTS.h:49
bool addInitialGraph(Hypergraph_sp graph)
Adds the given graph to the collection of initial graphs of this GTS.
Definition: GTS.cpp:83
string name
Stores the name of the GTS.
Definition: GTS.h:142
~GTS()
Destroys this GTS instance.
Definition: GTS.cpp:35
string getName() const
Returns the name of this GTS.
Definition: GTS.cpp:62
size_t getStdRuleCount() const
Returns the number of standard rules stored in this GTS.
Definition: GTS.cpp:50
UQRuleMap uqRules
Stores all quantified rules of this GTS, indexed by ID.
Definition: GTS.h:157
shared_ptr< UQRule > UQRule_sp
Alias for a shared pointer to a UQRule.
Definition: UQRule.h:261
bool addUQRule(UQRule_sp rule)
Adds the given UQRule to the quantified rules of this GTS.
Definition: GTS.cpp:70
RuleMap const & getStdRules() const
Returns a reference to the standard rules of this GTS.
Definition: GTS.cpp:37
unordered_map< IDType, Rule_sp > RuleMap
An alias for the map storing standard rules.
Definition: GTS.h:44
The GTS class is the data structure for a graph transformation system.
Definition: GTS.h:36
size_t getUQRuleCount() const
Returns the number of universally quantified rules stored in this GTS.
Definition: GTS.cpp:79
RuleMap stdRules
Stores all standard rules of this GTS, indexed by ID.
Definition: GTS.h:152
vector< Hypergraph_sp > initialGraphs
Stores all initial graphs of this GTS.
Definition: GTS.h:147
GTS(string name="", RuleMap const &rules=(RuleMap()), UQRuleMap const &uqRules=(UQRuleMap()), vector< Hypergraph_sp > const &initialGraphs=vector< Hypergraph_sp >())
Generates a new GTS with the given name, standard rule set, quantified rule set and initial graphs...
Definition: GTS.cpp:29
shared_ptr< GTS > GTS_sp
Alias for a shared pointer to a GTS object.
Definition: GTS.h:164
shared_ptr< Hypergraph > Hypergraph_sp
Alias for a shared pointer to a Hypergraph.
Definition: Hypergraph.h:85