// d_equalityEngine.addFunctionKind(kind::BITVECTOR_COMP);
d_equalityEngine.addFunctionKind(kind::BITVECTOR_MULT, true);
d_equalityEngine.addFunctionKind(kind::BITVECTOR_PLUS, true);
- d_equalityEngine.addFunctionKind(kind::BITVECTOR_EXTRACT);
+ d_equalityEngine.addFunctionKind(kind::BITVECTOR_EXTRACT, true);
// d_equalityEngine.addFunctionKind(kind::BITVECTOR_SUB);
// d_equalityEngine.addFunctionKind(kind::BITVECTOR_NEG);
// d_equalityEngine.addFunctionKind(kind::BITVECTOR_UDIV);
}
bool CoreSolver::assertFactToEqualityEngine(TNode fact, TNode reason) {
- Debug("bv-slicer") << "CoreSolver::assertFactToEqualityEngine fact=" << fact << endl;
- Debug("bv-slicer") << " reason=" << reason << endl;
+ Debug("bv-slicer-eq") << "CoreSolver::assertFactToEqualityEngine fact=" << fact << endl;
+ Debug("bv-slicer-eq") << " reason=" << reason << endl;
// Notify the equality engine
if (d_useEqualityEngine && !d_bv->inConflict() && !d_bv->propagatedBy(fact, SUB_CORE) ) {
Trace("bitvector::core") << " (assert " << fact << ")\n";
bool check(Theory::Effort e);
void propagate(Theory::Effort e);
void explain(TNode literal, std::vector<TNode>& assumptions);
- bool isInequalityTheory() { return false; }
+ bool isInequalityTheory() { return true; }
virtual void collectModelInfo(TheoryModel* m) {}
};
}
// construct actual extract nodes
- Index current_low = 0;
- Index current_high = 0;
- for (unsigned i = 0; i < nf.decomp.size(); ++i) {
- Index current_size = d_unionFind.getBitwidth(nf.decomp[i]);
- current_high += current_size;
- Node current = Rewriter::rewrite(utils::mkExtract(node, current_high - 1, current_low));
- current_low += current_size;
+ Index size = utils::getSize(node);
+ Index current_low = size - 1;
+ Index current_high = size - 1;
+
+ for (int i = nf.decomp.size() - 1; i>=0 ; --i) {
+ Index current_size = d_unionFind.getBitwidth(nf.decomp[i]);
+ current_low = current_low - current_size;
+ Node current = Rewriter::rewrite(utils::mkExtract(node, current_high, current_low+1));
+ current_high -= current_size;
decomp.push_back(current);
}
+
Debug("bv-slicer") << "as [";
for (unsigned i = 0; i < decomp.size(); ++i) {
Assert (!ok == inConflict());
if (!inConflict() && !d_coreSolver.isCoreTheory()) {
- // if (!inConflict() && !d_inequalitySolver.isInequalityTheory()) {
+ // if (!inConflict() && !d_inequalitySolver.isInequalityTheory()) {
ok = d_bitblastSolver.check(e);
}
(benchmark slice
:status unsat
:logic QF_BV
- :extrafuns ((x BitVec[16]))
- :assumption (= (extract[15:1] x) (extract[14:0] x))
+ :extrafuns ((x BitVec[6]))
+ :assumption (= (extract[5:1] x) (extract[4:0] x))
:assumption (= (extract[0:0] x) bv0[1])
- :formula (not (= x bv0[16]))
+ :formula (not (= x bv0[6]))
)