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/bv | |
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/bv')
-rw-r--r-- | src/theory/bv/theory_bv.cpp | 5 | ||||
-rw-r--r-- | src/theory/bv/theory_bv.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp index 94fc1e34c..27718b63f 100644 --- a/src/theory/bv/theory_bv.cpp +++ b/src/theory/bv/theory_bv.cpp @@ -112,6 +112,11 @@ TheoryBV::TheoryBV(context::Context* c, TheoryBV::~TheoryBV() {} +std::unique_ptr<TheoryRewriter> TheoryBV::mkTheoryRewriter() +{ + return std::unique_ptr<TheoryRewriter>(new TheoryBVRewriter()); +} + void TheoryBV::setMasterEqualityEngine(eq::EqualityEngine* eq) { if (options::bitblastMode() == options::BitblastMode::EAGER) { diff --git a/src/theory/bv/theory_bv.h b/src/theory/bv/theory_bv.h index 196535a19..ff1c9245a 100644 --- a/src/theory/bv/theory_bv.h +++ b/src/theory/bv/theory_bv.h @@ -72,6 +72,8 @@ public: ~TheoryBV(); + std::unique_ptr<TheoryRewriter> mkTheoryRewriter() override; + void setMasterEqualityEngine(eq::EqualityEngine* eq) override; void finishInit() override; |