CnfStream* d_cnfStream;
DPLLSatSolverInterface* d_satSolver;
+ context::Context* d_satContext;
SatValue d_result;
- context::Context* d_satContext;
public:
// Necessary functions
EqualityStatus eqStatusDomain = d_valuation.getEqualityStatus(x_shared, y_shared);
switch (eqStatusDomain) {
- case EQUALITY_FALSE_AND_PROPAGATED:
- case EQUALITY_FALSE:
- continue;
- break;
case EQUALITY_TRUE_AND_PROPAGATED:
- case EQUALITY_TRUE:
// Should have been propagated to us
Assert(false);
+ break;
+ case EQUALITY_FALSE_AND_PROPAGATED:
+ // TODO: eventually this should be an Assert(false), but for now, disequalities are not propagated
continue;
break;
+ case EQUALITY_FALSE:
+ case EQUALITY_TRUE:
+ // Missed propagation - need to add the pair so that theory engine can force propagation
+ Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): missed propagation" << std::endl;
+ break;
case EQUALITY_FALSE_IN_MODEL:
- Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): false in model, skipping" << std::endl;
- continue;
+ Debug("arrays::sharing") << "TheoryArrays::computeCareGraph(): false in model" << std::endl;
break;
default:
break;
// Normalize the equality
Node equality = left.eqNode(right);
Node normalized = Rewriter::rewriteEquality(currentTheory, equality);
- if (normalized.getKind() != kind::CONST_BOOLEAN) {
+ if (normalized.getKind() != kind::CONST_BOOLEAN || !normalized.getConst<bool>()) {
// Notify client
d_sharedNotify.notify(normalized, equality, currentTheory);
- } else {
- Assert(equality.getConst<bool>());
}
}
if (negated) {
Assert(!d_equalityEngine.areDisequal(atom[0], atom[1]));
d_equalityEngine.addDisequality(atom[0], atom[1], reason);
+ // !!! need to send this out
}
else {
Assert(!d_equalityEngine.areEqual(atom[0], atom[1]));
lemma(conflict, true, false);
}
}
+
+
+//Conflict from shared terms database
+void TheoryEngine::sharedConflict(TNode conflict) {
+ // Mark that we are in conflict
+ d_inConflict = true;
+
+ if(Dump.isOn("t-conflicts")) {
+ Dump("t-conflicts") << CommentCommand("theory conflict: expect unsat")
+ << CheckSatCommand(conflict.toExpr());
+ }
+
+ Node fullConflict = explain(ExplainTask(d_sharedTerms.explain(conflict), SHARED_DATABASE_EXPLANATION));
+ Assert(properConflict(fullConflict));
+ Debug("theory") << "TheoryEngine::sharedConflict(" << conflict << "): " << fullConflict << std::endl;
+ lemma(fullConflict, true, false);
+}
*/
void conflict(TNode conflict, theory::TheoryId theoryId);
+ /**
+ * Called by shared terms database to notify of a conflict.
+ */
+ void sharedConflict(TNode conflict);
+
/**
* Debugging flag to ensure that shutdown() is called before the
* destructor.
void propagateSharedLiteral(TNode literal, TNode original, theory::TheoryId theory)
{
- d_propagatedSharedLiterals.push_back(SharedLiteral(literal, original, theory));
+ if (literal.getKind() == kind::CONST_BOOLEAN) {
+ Assert(!literal.getConst<bool>());
+ sharedConflict(original);
+ }
+ else {
+ d_propagatedSharedLiterals.push_back(SharedLiteral(literal, original, theory));
+ }
}
/**