diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2019-12-09 11:19:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-09 11:19:10 -0800 |
commit | b6ce0f23ce0aaa0552767e8067fe58dbceee11cb (patch) | |
tree | 0783321580ed511c7ecfa3f59363dadcee15acde /src/theory/arrays | |
parent | d06b46efade674023236da228601806daf06f1af (diff) |
Make theory rewriters non-static (#3547)
This commit changes theory rewriters to be non-static. This refactoring
is needed as a stepping stone to making our rewriter configurable: If we
have multiple solver objects with different rewrite configurations, we
cannot use `static` variables for the rewriter table in the BV rewriter
for example. It is also in line with our goal of getting rid of
singletons in general. Note that the `Rewriter` class is still a
singleton, which will be changed in a future commit.
Diffstat (limited to 'src/theory/arrays')
-rw-r--r-- | src/theory/arrays/theory_arrays_rewriter.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/theory/arrays/theory_arrays_rewriter.h b/src/theory/arrays/theory_arrays_rewriter.h index 5f3fcf48d..851d2ca5d 100644 --- a/src/theory/arrays/theory_arrays_rewriter.h +++ b/src/theory/arrays/theory_arrays_rewriter.h @@ -24,6 +24,7 @@ #include <unordered_set> #include "theory/rewriter.h" +#include "theory/theory_rewriter.h" #include "theory/type_enumerator.h" namespace CVC4 { @@ -39,11 +40,13 @@ static inline Node mkEqNode(Node a, Node b) { return a.eqNode(b); } -class TheoryArraysRewriter { +class TheoryArraysRewriter : public TheoryRewriter +{ static Node normalizeConstant(TNode node) { return normalizeConstant(node, node[1].getType().getCardinality()); } -public: + + public: //this function is called by printers when using the option "--model-u-dt-enum" static Node normalizeConstant(TNode node, Cardinality indexCard) { TNode store = node[0]; @@ -229,9 +232,9 @@ public: return n; } -public: - - static RewriteResponse postRewrite(TNode node) { + public: + RewriteResponse postRewrite(TNode node) override + { Trace("arrays-postrewrite") << "Arrays::postRewrite start " << node << std::endl; switch (node.getKind()) { case kind::SELECT: { @@ -403,7 +406,8 @@ public: return RewriteResponse(REWRITE_DONE, node); } - static inline RewriteResponse preRewrite(TNode node) { + RewriteResponse preRewrite(TNode node) override + { Trace("arrays-prerewrite") << "Arrays::preRewrite start " << node << std::endl; switch (node.getKind()) { case kind::SELECT: { @@ -503,7 +507,7 @@ public: static inline void init() {} static inline void shutdown() {} -};/* class TheoryArraysRewriter */ +}; /* class TheoryArraysRewriter */ }/* CVC4::theory::arrays namespace */ }/* CVC4::theory namespace */ |