diff options
author | Clark Barrett <barrett@cs.nyu.edu> | 2013-09-23 14:33:53 -0700 |
---|---|---|
committer | Clark Barrett <barrett@cs.nyu.edu> | 2013-09-23 14:33:53 -0700 |
commit | 9775bced75843c6f01e9524c2d0e7021535e3ec0 (patch) | |
tree | 3b150624ca81fcfd4940b73c7727e05d17c2ffc4 /src/theory/theory.cpp | |
parent | e50d0f0d93636f296b8d33dc4bd2cd9f91e159e5 (diff) |
Cleaner version of bug-fix for 528, also moved substitutions.h out of theory.h
for faster compilation
Diffstat (limited to 'src/theory/theory.cpp')
-rw-r--r-- | src/theory/theory.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp index a1a835170..9a23d5518 100644 --- a/src/theory/theory.cpp +++ b/src/theory/theory.cpp @@ -17,6 +17,7 @@ #include "theory/theory.h" #include "util/cvc4_assert.h" #include "theory/quantifiers_engine.h" +#include "theory/substitutions.h" #include <vector> @@ -206,5 +207,27 @@ void Theory::computeRelevantTerms(set<Node>& termSet) } +Theory::PPAssertStatus Theory::ppAssert(TNode in, SubstitutionMap& outSubstitutions) +{ + if (in.getKind() == kind::EQUAL) { + if (in[0].isVar() && !in[1].hasSubterm(in[0])) { + outSubstitutions.addSubstitution(in[0], in[1]); + return PP_ASSERT_STATUS_SOLVED; + } + if (in[1].isVar() && !in[0].hasSubterm(in[1])) { + outSubstitutions.addSubstitution(in[1], in[0]); + return PP_ASSERT_STATUS_SOLVED; + } + if (in[0].isConst() && in[1].isConst()) { + if (in[0] != in[1]) { + return PP_ASSERT_STATUS_CONFLICT; + } + } + } + + return PP_ASSERT_STATUS_UNSOLVED; +} + + }/* CVC4::theory namespace */ }/* CVC4 namespace */ |