diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2018-08-16 16:46:05 -0700 |
---|---|---|
committer | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2018-08-16 18:46:05 -0500 |
commit | 7fc04bf78c6c20f3711d14425469eef2e0c2cd60 (patch) | |
tree | d9f2e91a52406edf66967faccad550631cd9e4a5 /src/theory/theory.cpp | |
parent | 4e62cdade61514f268b96e78e2f82ad12dfcad07 (diff) |
Move node algorithms to separate file (#2311)
Diffstat (limited to 'src/theory/theory.cpp')
-rw-r--r-- | src/theory/theory.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index 311776693..eedf0ff52 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -22,6 +22,7 @@ #include <string> #include "base/cvc4_assert.h" +#include "expr/node_algorithm.h" #include "smt/smt_statistics_registry.h" #include "theory/ext_theory.h" #include "theory/quantifiers_engine.h" @@ -283,27 +284,31 @@ void Theory::computeRelevantTerms(set<Node>& termSet, } } - Theory::PPAssertStatus Theory::ppAssert(TNode in, SubstitutionMap& outSubstitutions) { - if (in.getKind() == kind::EQUAL) { + if (in.getKind() == kind::EQUAL) + { // (and (= x t) phi) can be replaced by phi[x/t] if // 1) x is a variable // 2) x is not in the term t // 3) x : T and t : S, then S <: T - if (in[0].isVar() && !in[1].hasSubterm(in[0]) && - (in[1].getType()).isSubtypeOf(in[0].getType()) ){ + if (in[0].isVar() && !expr::hasSubterm(in[1], in[0]) + && (in[1].getType()).isSubtypeOf(in[0].getType())) + { outSubstitutions.addSubstitution(in[0], in[1]); return PP_ASSERT_STATUS_SOLVED; } - if (in[1].isVar() && !in[0].hasSubterm(in[1]) && - (in[0].getType()).isSubtypeOf(in[1].getType())){ + if (in[1].isVar() && !expr::hasSubterm(in[0], in[1]) + && (in[0].getType()).isSubtypeOf(in[1].getType())) + { outSubstitutions.addSubstitution(in[1], in[0]); return PP_ASSERT_STATUS_SOLVED; } - if (in[0].isConst() && in[1].isConst()) { - if (in[0] != in[1]) { + if (in[0].isConst() && in[1].isConst()) + { + if (in[0] != in[1]) + { return PP_ASSERT_STATUS_CONFLICT; } } |