UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
RulePreparer.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 RULEPREPARATION_H_
21 #define RULEPREPARATION_H_
22 
23 #include "../graphs/UQRuleInstance.h"
24 #include "../graphs/Rule.h"
25 #include "../basic_types/CollectionCallback.h"
26 
27 namespace uncover {
28  namespace analysis {
29 
37  class RulePreparer {
38 
39  public:
40 
44  virtual ~RulePreparer() {};
45 
52  virtual void prepareRule(graphs::Rule const& rule,
54 
62  virtual void prepareRule(graphs::UQRuleInstance const& rule,
64 
73  virtual bool isNoOpRule(graphs::AnonRule const& rule) const = 0;
74 
79  void setOptimization(bool opt) { optimize = true; }
80 
86  bool willOptimize() const { return optimize; }
87 
88  protected:
89 
93  RulePreparer() : optimize(true) {}
94 
98  bool optimize;
99 
100  };
101 
105  typedef shared_ptr<RulePreparer> RulePreparer_sp;
106 
110  typedef shared_ptr<RulePreparer const> RulePreparer_csp;
111 
112  } /* namespace basic_types */
113 } /* namespace uncover */
114 
115 #endif /* RULEPREPARATION_H_ */
virtual bool isNoOpRule(graphs::AnonRule const &rule) const =0
Checks if the given rule will only produce graphs already represented when the backward analysis is a...
shared_ptr< RulePreparer const > RulePreparer_csp
Alias for a shared pointer of a constant RulePreparer.
Definition: RulePreparer.h:110
bool optimize
Stores whether the rule preparation will be optimized.
Definition: RulePreparer.h:98
Represents the data structure for a rule including a unique identifier.
Definition: Rule.h:38
RulePreparer()
A RulePreparer can only be instantiated by a derived class.
Definition: RulePreparer.h:93
shared_ptr< RulePreparer > RulePreparer_sp
Alias for a shared pointer of a RulePreparer.
Definition: RulePreparer.h:105
AnonRule serves as a data structure of a rule object.
Definition: AnonRule.h:39
bool willOptimize() const
Returns whether the rule preparation will be optimized, i.e.
Definition: RulePreparer.h:86
virtual void prepareRule(graphs::Rule const &rule, basic_types::CollectionCallback< graphs::Rule_sp > &callback) const =0
Takes a single rule and creates the prepared set of rules for this rule.
This class takes a rule and prepares it such that no special case handling is necessary while perform...
Definition: RulePreparer.h:37
void setOptimization(bool opt)
Sets whether the rule preparation will be optimized, i.e.
Definition: RulePreparer.h:79
The UQRuleInstance is a rule which is generated when UQRules are instantiated.
Definition: UQRuleInstance.h:35
virtual ~RulePreparer()
Destroys the current RulePreparer instance.
Definition: RulePreparer.h:44