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/booleans/theory_bool.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/booleans/theory_bool.cpp')
-rw-r--r-- | src/theory/booleans/theory_bool.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/theory/booleans/theory_bool.cpp b/src/theory/booleans/theory_bool.cpp index 8fbe83951..e670121d1 100644 --- a/src/theory/booleans/theory_bool.cpp +++ b/src/theory/booleans/theory_bool.cpp @@ -14,15 +14,17 @@ ** The theory of booleans. **/ -#include "theory/theory.h" #include "theory/booleans/theory_bool.h" -#include "theory/booleans/circuit_propagator.h" -#include "theory/valuation.h" -#include "smt_util/boolean_simplification.h" -#include "theory/substitutions.h" -#include <vector> #include <stack> +#include <vector> + +#include "smt_util/boolean_simplification.h" +#include "theory/booleans/circuit_propagator.h" +#include "theory/booleans/theory_bool_rewriter.h" +#include "theory/substitutions.h" +#include "theory/theory.h" +#include "theory/valuation.h" #include "util/hash.h" using namespace std; @@ -31,6 +33,11 @@ namespace CVC4 { namespace theory { namespace booleans { +std::unique_ptr<TheoryRewriter> TheoryBool::mkTheoryRewriter() +{ + return std::unique_ptr<TheoryRewriter>(new TheoryBoolRewriter()); +} + Theory::PPAssertStatus TheoryBool::ppAssert(TNode in, SubstitutionMap& outSubstitutions) { if (in.getKind() == kind::CONST_BOOLEAN && !in.getConst<bool>()) { |