summaryrefslogtreecommitdiff
path: root/src/theory/arrays
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-04-01 19:35:25 -0700
committerGitHub <noreply@github.com>2020-04-01 19:35:25 -0700
commit3915eb7b497bd185385048f8c7f2b4c8f2bf7c03 (patch)
tree8686d5ceea120ebda1ea65c0a8696ab1bdf78543 /src/theory/arrays
parent936e9c442443799c866a65c6ca3fbdcd3ac9aab8 (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/arrays')
-rw-r--r--src/theory/arrays/theory_arrays.cpp6
-rw-r--r--src/theory/arrays/theory_arrays.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp
index dcf82e6b4..787ae84e2 100644
--- a/src/theory/arrays/theory_arrays.cpp
+++ b/src/theory/arrays/theory_arrays.cpp
@@ -29,6 +29,7 @@
#include "smt/command.h"
#include "smt/logic_exception.h"
#include "smt/smt_statistics_registry.h"
+#include "theory/arrays/theory_arrays_rewriter.h"
#include "theory/rewriter.h"
#include "theory/theory_model.h"
#include "theory/valuation.h"
@@ -178,6 +179,11 @@ TheoryArrays::~TheoryArrays() {
smtStatisticsRegistry()->unregisterStat(&d_numSetModelValConflicts);
}
+std::unique_ptr<TheoryRewriter> TheoryArrays::mkTheoryRewriter()
+{
+ return std::unique_ptr<TheoryRewriter>(new TheoryArraysRewriter());
+}
+
void TheoryArrays::setMasterEqualityEngine(eq::EqualityEngine* eq) {
d_equalityEngine.setMasterEqualityEngine(eq);
}
diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h
index 3d6d0692e..d1f912d95 100644
--- a/src/theory/arrays/theory_arrays.h
+++ b/src/theory/arrays/theory_arrays.h
@@ -144,6 +144,8 @@ class TheoryArrays : public Theory {
std::string name = "");
~TheoryArrays();
+ std::unique_ptr<TheoryRewriter> mkTheoryRewriter() override;
+
void setMasterEqualityEngine(eq::EqualityEngine* eq) override;
std::string identify() const override { return std::string("TheoryArrays"); }
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback