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 /test/unit/theory/theory_white.h | |
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 'test/unit/theory/theory_white.h')
-rw-r--r-- | test/unit/theory/theory_white.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/theory/theory_white.h b/test/unit/theory/theory_white.h index 0dd52be8c..eb43e00cb 100644 --- a/test/unit/theory/theory_white.h +++ b/test/unit/theory/theory_white.h @@ -93,7 +93,7 @@ class TestOutputChannel : public OutputChannel { }; class DummyTheory : public Theory { -public: + public: set<Node> d_registered; vector<Node> d_getSequence; @@ -102,6 +102,11 @@ public: : Theory(theory::THEORY_BUILTIN, ctxt, uctxt, out, valuation, logicInfo) {} + std::unique_ptr<TheoryRewriter> mkTheoryRewriter() + { + return std::unique_ptr<TheoryRewriter>(); + } + void registerTerm(TNode n) { // check that we registerTerm() a term only once TS_ASSERT(d_registered.find(n) == d_registered.end()); |