UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
SubgraphPOCEnumerator.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 SUBGRAPHPOCENUMERATOR_H_
21 #define SUBGRAPHPOCENUMERATOR_H_
22 
23 #include "../analysis/MinPOCEnumerator.h"
24 #include "../rule_engine/PartialPOCEnumerator.h"
25 
26 namespace uncover {
27  namespace subgraphs {
28 
40 
41  public:
42 
51  SubgraphPOCEnumerator(bool inj, int bound);
52 
59 
63  virtual ~SubgraphPOCEnumerator();
64 
65  virtual bool ended() const override;
66 
67  virtual SubgraphPOCEnumerator& operator++() override;
68 
69  virtual graphs::Hypergraph_sp operator*() const override;
70 
71  virtual bool resetWith(graphs::AnonRule_csp rule, IDType ruleID, graphs::Hypergraph_csp graph) override;
72 
74 
75  private:
76 
81  void checkAndThrow() const;
82 
88  bool exceedsBound() const;
89 
93  int pathbound;
94 
98  bool injective;
99 
104 
109 
114 
115  };
116 
117  } /* namespace subgraphs */
118 } /* namespace uncover */
119 
120 #endif /* SUBGRAPHPOCENUMERATOR_H_ */
virtual bool ended() const override
Returns true, iff the last element was already enumerated, i.e.
Definition: SubgraphPOCEnumerator.cpp:54
This abstract class serves as a schema of an enumerator taking a rule and a graph and enumerating all...
Definition: MinPOCEnumerator.h:38
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...
Definition: SubgraphPOCEnumerator.cpp:59
virtual ~SubgraphPOCEnumerator()
Destroys this enumerator.
Definition: SubgraphPOCEnumerator.cpp:50
int pathbound
Stores the path bound used by this enumerator.
Definition: SubgraphPOCEnumerator.h:93
This enumerator can be used to enumerate all pushout complements of a (partial) rule and a graph...
Definition: SubgraphPOCEnumerator.h:39
bool injective
Stores whether injective (true) or conflict-free (false) matches should be used.
Definition: SubgraphPOCEnumerator.h:98
IDType ruleID
Stores the ID of the rule applied backwards, for logging.
Definition: SubgraphPOCEnumerator.h:108
The PartialPOCEnumerator computes a subset of all pushout complement of a partial rule and a total ma...
Definition: PartialPOCEnumerator.h:40
virtual SubgraphPOCEnumerator & operator++() override
Computes the next minimal pushout complement if any.
Definition: SubgraphPOCEnumerator.cpp:96
shared_ptr< const Hypergraph > Hypergraph_csp
Alias for a shared pointer to a constant Hypergraph.
Definition: Hypergraph.h:90
virtual graphs::Hypergraph_sp operator*() const override
Returns the last computed minimal pushout complement.
Definition: SubgraphPOCEnumerator.cpp:117
IDType graphID
Stores the ID of the graph, for logging.
Definition: SubgraphPOCEnumerator.h:113
shared_ptr< const AnonRule > AnonRule_csp
Alias for a shared pointer to a constant AnonRule.
Definition: AnonRule.h:229
rule_engine::PartialPOCEnumerator * partialEnumerator
Stores a PartialPOCEnumerator used for the pushout complement computation.
Definition: SubgraphPOCEnumerator.h:103
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
void checkAndThrow() const
Checks if this enumerator is valid, i.e.
Definition: SubgraphPOCEnumerator.cpp:122
SubgraphPOCEnumerator(bool inj, int bound)
Creates a new enumerator with the given parameters.
Definition: SubgraphPOCEnumerator.cpp:32
shared_ptr< Hypergraph > Hypergraph_sp
Alias for a shared pointer to a Hypergraph.
Definition: Hypergraph.h:85
bool exceedsBound() const
Checks if the last graph computed by the stored PartialPOCEnumerator exceeds the path bound...
Definition: SubgraphPOCEnumerator.cpp:129