From 48b147577ba6a894f8f0498c39c7e77d466b0538 Mon Sep 17 00:00:00 2001 From: Dejan Jovanović Date: Sat, 10 Dec 2011 06:05:13 +0000 Subject: attempt to fix bug 293: if a split on a trivial shared pair is requested from a theory, such as 1 = 0, it is reasserted to the theory. --- src/theory/theory_engine.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/theory') diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index e36d163a4..aa897b244 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -230,11 +230,18 @@ void TheoryEngine::combineTheories() { Node equality = carePair.a.eqNode(carePair.b); Node normalizedEquality = Rewriter::rewrite(equality); + bool isTrivial = normalizedEquality.getKind() == kind::CONST_BOOLEAN; + // If the node has a literal, it has been asserted so we should just check it bool value; - if (d_propEngine->isSatLiteral(normalizedEquality) && d_propEngine->hasValue(normalizedEquality, value)) { - Debug("sharing") << "TheoryEngine::combineTheories(): has a literal " << std::endl; + if (isTrivial || (d_propEngine->isSatLiteral(normalizedEquality) && d_propEngine->hasValue(normalizedEquality, value))) { + Debug("sharing") << "TheoryEngine::combineTheories(): has a literal or is trivial" << std::endl; + + if (isTrivial) { + // if the equality is trivial, we assert it back to the theory saying the sat solver should explain + value = normalizedEquality.getConst(); + } // Normalize the equality to the theory that requested it Node toAssert = Rewriter::rewriteEquality(carePair.theory, equality); -- cgit v1.2.3