/**
* Runs the nonclausal solver and tries to solve all the assigned
* theory literals.
+ *
+ * Returns false if the formula simplifies to "false"
*/
- void nonClausalSimplify();
+ bool nonClausalSimplify();
/**
* Performs static learning on the assertions.
* Perform non-clausal simplification of a Node. This involves
* Theory implementations, but does NOT involve the SAT solver in
* any way.
+ *
+ * Returns false if the formula simplifies to "false"
*/
- void simplifyAssertions() throw(NoSuchFunctionException, AssertionException);
+ bool simplifyAssertions() throw(NoSuchFunctionException, AssertionException);
public:
}
}
-void SmtEnginePrivate::nonClausalSimplify() {
+
+// returns false if it learns a conflict
+bool SmtEnginePrivate::nonClausalSimplify() {
d_smt.finalOptionsAreSet();
TimerStat::CodeTimer nonclausalTimer(d_smt.d_nonclausalSimplificationTime);
<< "conflict in non-clausal propagation" << endl;
d_assertionsToPreprocess.clear();
d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst<bool>(false));
- return;
+ return false;
}
// No, conflict, go through the literals and solve them
<< d_nonClausalLearnedLiterals[i] << endl;
d_assertionsToPreprocess.clear();
d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst<bool>(false));
- return;
+ return false;
}
}
// Solve it with the corresponding theory
<< learnedLiteral << endl;
d_assertionsToPreprocess.clear();
d_assertionsToCheck.push_back(NodeManager::currentNM()->mkConst<bool>(false));
- return;
+ return false;
default:
if (d_doConstantProp && learnedLiteral.getKind() == kind::EQUAL && (learnedLiteral[0].isConst() || learnedLiteral[1].isConst())) {
// constant propagation
<< "non-clausal constant propagation : "
<< d_assertionsToCheck.back() << endl;
}
+
+ return true;
}
} while(! worklist.empty());
}
-void SmtEnginePrivate::simplifyAssertions()
+// returns false if simpflication led to "false"
+bool SmtEnginePrivate::simplifyAssertions()
throw(NoSuchFunctionException, AssertionException) {
try {
<< "performing non-clausal simplification" << endl;
// Abuse the user context to make sure circuit propagator gets backtracked
d_smt.d_userContext->push();
- nonClausalSimplify();
+ bool noConflict = nonClausalSimplify();
d_smt.d_userContext->pop();
+ if(!noConflict) return false;
} else {
Assert(d_assertionsToCheck.empty());
d_assertionsToCheck.swap(d_assertionsToPreprocess);
d_assertionsToCheck.swap(d_assertionsToPreprocess);
// Abuse the user context to make sure circuit propagator gets backtracked
d_smt.d_userContext->push();
- nonClausalSimplify();
+ bool noConflict = nonClausalSimplify();
d_smt.d_userContext->pop();
+ if(!noConflict) return false;
}
Debug("smt") << "POST repeatSimp" << std::endl;
<< tcep;
InternalError(ss.str().c_str());
}
+ return true;
}
Result SmtEngine::check() {
}
}
- simplifyAssertions();
+ bool noConflict = simplifyAssertions();
if(Options::current()->doStaticLearning) {
// Perform static learning
if(Options::current()->repeatSimp) {
d_assertionsToCheck.swap(d_assertionsToPreprocess);
- simplifyAssertions();
+ noConflict &= simplifyAssertions();
removeITEs();
}
// Push the formula to decision engine
Assert(iteRewriteAssertionsEnd == d_assertionsToCheck.size());
- d_smt.d_decisionEngine->addAssertions
- (d_assertionsToCheck, realAssertionsEnd, d_iteSkolemMap);
+ if(noConflict) {
+ d_smt.d_decisionEngine->addAssertions
+ (d_assertionsToCheck, realAssertionsEnd, d_iteSkolemMap);
+ }
// end: INVARIANT to maintain: no reordering of assertions or
// introducing new ones