summaryrefslogtreecommitdiff
path: root/src/theory/fp/theory_fp.cpp
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/fp/theory_fp.cpp
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/fp/theory_fp.cpp')
-rw-r--r--src/theory/fp/theory_fp.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/theory/fp/theory_fp.cpp b/src/theory/fp/theory_fp.cpp
index 2632a6f38..5ab285766 100644
--- a/src/theory/fp/theory_fp.cpp
+++ b/src/theory/fp/theory_fp.cpp
@@ -15,18 +15,18 @@
** \todo document this file
**/
-
-#include "options/fp_options.h"
-#include "theory/rewriter.h"
-#include "theory/theory_model.h"
#include "theory/fp/theory_fp.h"
-
#include <set>
#include <stack>
#include <unordered_set>
#include <vector>
+#include "options/fp_options.h"
+#include "theory/fp/theory_fp_rewriter.h"
+#include "theory/rewriter.h"
+#include "theory/theory_model.h"
+
using namespace std;
namespace CVC4 {
@@ -177,6 +177,11 @@ TheoryFp::TheoryFp(context::Context *c,
} /* TheoryFp::TheoryFp() */
+std::unique_ptr<TheoryRewriter> TheoryFp::mkTheoryRewriter()
+{
+ return std::unique_ptr<TheoryRewriter>(new TheoryFpRewriter());
+}
+
Node TheoryFp::minUF(Node node) {
Assert(node.getKind() == kind::FLOATINGPOINT_MIN);
TypeNode t(node.getType());
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback