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/arith/arith_rewriter.h | |
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/arith/arith_rewriter.h')
-rw-r--r-- | src/theory/arith/arith_rewriter.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/theory/arith/arith_rewriter.h b/src/theory/arith/arith_rewriter.h index de6b3f228..600f38d4f 100644 --- a/src/theory/arith/arith_rewriter.h +++ b/src/theory/arith/arith_rewriter.h @@ -21,24 +21,19 @@ #define CVC4__THEORY__ARITH__ARITH_REWRITER_H #include "theory/theory.h" -#include "theory/rewriter.h" +#include "theory/theory_rewriter.h" namespace CVC4 { namespace theory { namespace arith { -class ArithRewriter { -public: - - static RewriteResponse preRewrite(TNode n); - static RewriteResponse postRewrite(TNode n); - - static void init() { } - - static void shutdown() { } - -private: +class ArithRewriter : public TheoryRewriter +{ + public: + RewriteResponse preRewrite(TNode n) override; + RewriteResponse postRewrite(TNode n) override; + private: static Node makeSubtractionNode(TNode l, TNode r); static Node makeUnaryMinusNode(TNode n); @@ -70,7 +65,7 @@ private: return !isAtom(n); } -};/* class ArithRewriter */ +}; /* class ArithRewriter */ }/* CVC4::theory::arith namespace */ }/* CVC4::theory namespace */ |