UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MinPOCEnumerator.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 MINPOCENUMERATOR_H_
21 #define MINPOCENUMERATOR_H_
22 
23 #include "../graphs/AnonRule.h"
24 #include "../graphs/Hypergraph.h"
25 #include "BackwardResultHandler.h"
26 #include "PreparedGTS.h"
27 
28 namespace uncover {
29  namespace analysis {
30 
39 
40  public:
41 
45  virtual ~MinPOCEnumerator() {}
46 
53  virtual bool ended() const = 0;
54 
59  virtual MinPOCEnumerator& operator++() = 0;
60 
66  virtual graphs::Hypergraph_sp operator*() const = 0;
67 
76  virtual bool resetWith(graphs::AnonRule_csp rule, IDType ruleID, graphs::Hypergraph_csp graph) = 0;
77 
86  if(rule != nullptr && graph != nullptr) {
87  return resetWith(rule,rule->getID(),graph);
88  } else {
89  return false;
90  }
91  }
92 
97  void setResultHandler(BackwardResultHandler_sp resHandler) { resultHandler = resHandler; }
98 
104 
105  protected:
106 
110  MinPOCEnumerator() : resultHandler(nullptr), prepGTS(nullptr) {}
111 
116 
122 
123  };
124 
128  typedef shared_ptr<MinPOCEnumerator> MinPOCEnumerator_sp;
129 
130  }
131 }
132 
133 #endif /* MINPOCENUMERATOR_H_ */
This abstract class serves as a schema of an enumerator taking a rule and a graph and enumerating all...
Definition: MinPOCEnumerator.h:38
shared_ptr< Rule const > Rule_csp
Alias for a shared pointer to a constant Rule.
Definition: Rule.h:110
virtual graphs::Hypergraph_sp operator*() const =0
Returns the last computed minimal pushout complement.
void setPreparedGTS(PreparedGTS_csp gts)
Set the PreparedGTS used by this enumerator to the given one.
Definition: MinPOCEnumerator.h:103
virtual bool ended() const =0
Returns true, iff the last element was already enumerated, i.e.
shared_ptr< PreparedGTS const > PreparedGTS_csp
Alias of a shared pointer to a constant PreparedGTS.
Definition: PreparedGTS.h:289
BackwardResultHandler_sp resultHandler
Stores the BackwardResultHandler used by this enumerator.
Definition: MinPOCEnumerator.h:115
shared_ptr< BackwardResultHandler > BackwardResultHandler_sp
Alias for a shared pointer to a BackwardResultHandler.
Definition: BackwardResultHandler.h:105
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...
Definition: MinPOCEnumerator.h:85
shared_ptr< const Hypergraph > Hypergraph_csp
Alias for a shared pointer to a constant Hypergraph.
Definition: Hypergraph.h:90
void setResultHandler(BackwardResultHandler_sp resHandler)
Set the BackwardResultHandler used by this enumerator to the given one.
Definition: MinPOCEnumerator.h:97
shared_ptr< const AnonRule > AnonRule_csp
Alias for a shared pointer to a constant AnonRule.
Definition: AnonRule.h:229
MinPOCEnumerator()
Initializes this enumerator.
Definition: MinPOCEnumerator.h:110
PreparedGTS_csp prepGTS
Stores a pointer to the PrepareGTS from which the rules will be taken, which are used to initialize t...
Definition: MinPOCEnumerator.h:121
virtual MinPOCEnumerator & operator++()=0
Computes the next minimal pushout complement if any.
virtual ~MinPOCEnumerator()
Destroys this instance of the enumerator.
Definition: MinPOCEnumerator.h:45
virtual bool resetWith(graphs::AnonRule_csp rule, IDType ruleID, graphs::Hypergraph_csp graph)=0
Initializes this enumerator to compute all minimal pushout complements for the given rule and graph...
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53
shared_ptr< MinPOCEnumerator > MinPOCEnumerator_sp
Alias of a shared pointer to an MinPOCEnumerator.
Definition: MinPOCEnumerator.h:128
shared_ptr< Hypergraph > Hypergraph_sp
Alias for a shared pointer to a Hypergraph.
Definition: Hypergraph.h:85