AbstractionModule* d_abstraction;
bool d_emptyNotify;
- context::CDO<bool> d_satSolverFullModel;
+ // The size of the fact queue when we most recently called solve() in the
+ // bit-vector SAT solver. This is the level at which we should have
+ // a full model in the bv SAT solver.
+ context::CDO<int> d_fullModelAssertionLevel;
void addAtom(TNode atom);
bool hasValue(TNode a);
, d_bbAtoms()
, d_abstraction(NULL)
, d_emptyNotify(emptyNotify)
- , d_satSolverFullModel(c, false)
+ , d_fullModelAssertionLevel(c, 0)
, d_name(name)
, d_statistics(name) {
}
}
Debug("bitvector") << "TLazyBitblaster::solve() asserted atoms " << d_assertedAtoms->size() <<"\n";
- d_satSolverFullModel.set(true);
+ d_fullModelAssertionLevel.set(d_bv->numAssertions());
return prop::SAT_VALUE_TRUE == d_satSolver->solve();
}
EqualityStatus TLazyBitblaster::getEqualityStatus(TNode a, TNode b) {
+ int numAssertions = d_bv->numAssertions();
Debug("bv-equality-status")<< "TLazyBitblaster::getEqualityStatus " << a <<" = " << b <<"\n";
- Debug("bv-equality-status")<< "BVSatSolver has full model? " << d_satSolverFullModel.get() <<"\n";
+ Debug("bv-equality-status")<< "BVSatSolver has full model? " << (d_fullModelAssertionLevel.get() == numAssertions) <<"\n";
// First check if it trivially rewrites to false/true
Node a_eq_b = Rewriter::rewrite(utils::mkNode(kind::EQUAL, a, b));
if (a_eq_b == utils::mkFalse()) return theory::EQUALITY_FALSE;
if (a_eq_b == utils::mkTrue()) return theory::EQUALITY_TRUE;
- if (!d_satSolverFullModel.get())
+ if (d_fullModelAssertionLevel.get() != numAssertions) {
return theory::EQUALITY_UNKNOWN;
+ }
// Check if cache is valid (invalidated in check and pops)
if (d_bv->d_invalidateModelCache.get()) {
--- /dev/null
+; EXPECT: sat
+(set-logic QF_BV)
+(declare-fun x2 () (_ BitVec 3))
+(declare-fun x1 () (_ BitVec 3))
+(declare-fun x0 () (_ BitVec 3))
+(assert (not (bvult (bvudiv (bvudiv (bvudiv x0 x0) x1) x2) x1)))
+(assert (= #b000 x2))
+(check-sat)