diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2020-04-01 19:35:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-01 19:35:25 -0700 |
commit | 3915eb7b497bd185385048f8c7f2b4c8f2bf7c03 (patch) | |
tree | 8686d5ceea120ebda1ea65c0a8696ab1bdf78543 /src/theory/arith/theory_arith.cpp | |
parent | 936e9c442443799c866a65c6ca3fbdcd3ac9aab8 (diff) |
Initialize theory rewriters in theories (#4197)
Until now, the `Rewriter` was responsible for creating `TheoryRewriter`
instances. This commit adds a method `mkTheoryRewriter()` that theories
override to create an instance of their corresponding theory rewriter.
The advantage is that the theories can pass additional information to
their theory rewriter (e.g. a statistics object).
Diffstat (limited to 'src/theory/arith/theory_arith.cpp')
-rw-r--r-- | src/theory/arith/theory_arith.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/theory/arith/theory_arith.cpp b/src/theory/arith/theory_arith.cpp index 8986e6894..2c748f188 100644 --- a/src/theory/arith/theory_arith.cpp +++ b/src/theory/arith/theory_arith.cpp @@ -19,6 +19,7 @@ #include "options/smt_options.h" #include "smt/smt_statistics_registry.h" +#include "theory/arith/arith_rewriter.h" #include "theory/arith/infer_bounds.h" #include "theory/arith/theory_arith_private.h" #include "theory/ext_theory.h" @@ -53,6 +54,11 @@ TheoryArith::~TheoryArith(){ delete d_internal; } +std::unique_ptr<TheoryRewriter> TheoryArith::mkTheoryRewriter() +{ + return std::unique_ptr<TheoryRewriter>(new ArithRewriter()); +} + void TheoryArith::preRegisterTerm(TNode n){ d_internal->preRegisterTerm(n); } |