summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/bv/bv_subtheory_core.cpp6
-rw-r--r--src/theory/bv/bv_subtheory_inequality.h2
-rw-r--r--src/theory/bv/slicer.cpp17
-rw-r--r--src/theory/bv/theory_bv.cpp2
4 files changed, 15 insertions, 12 deletions
diff --git a/src/theory/bv/bv_subtheory_core.cpp b/src/theory/bv/bv_subtheory_core.cpp
index d8fc596c0..01378da56 100644
--- a/src/theory/bv/bv_subtheory_core.cpp
+++ b/src/theory/bv/bv_subtheory_core.cpp
@@ -50,7 +50,7 @@ CoreSolver::CoreSolver(context::Context* c, TheoryBV* bv)
// 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);
@@ -197,8 +197,8 @@ bool CoreSolver::check(Theory::Effort e) {
}
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";
diff --git a/src/theory/bv/bv_subtheory_inequality.h b/src/theory/bv/bv_subtheory_inequality.h
index 92248205f..07c561c84 100644
--- a/src/theory/bv/bv_subtheory_inequality.h
+++ b/src/theory/bv/bv_subtheory_inequality.h
@@ -38,7 +38,7 @@ public:
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) {}
};
diff --git a/src/theory/bv/slicer.cpp b/src/theory/bv/slicer.cpp
index 92166224b..474c70052 100644
--- a/src/theory/bv/slicer.cpp
+++ b/src/theory/bv/slicer.cpp
@@ -657,15 +657,18 @@ void Slicer::getBaseDecomposition(TNode node, std::vector<Node>& decomp, std::ve
}
// 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) {
diff --git a/src/theory/bv/theory_bv.cpp b/src/theory/bv/theory_bv.cpp
index a794d63a3..33f464400 100644
--- a/src/theory/bv/theory_bv.cpp
+++ b/src/theory/bv/theory_bv.cpp
@@ -128,7 +128,7 @@ void TheoryBV::check(Effort e)
Assert (!ok == inConflict());
if (!inConflict() && !d_coreSolver.isCoreTheory()) {
- // if (!inConflict() && !d_inequalitySolver.isInequalityTheory()) {
+ // if (!inConflict() && !d_inequalitySolver.isInequalityTheory()) {
ok = d_bitblastSolver.check(e);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback