#include "smt/smt_engine.h"
#include "smt/smt_engine_scope.h"
#include "theory/theory_engine.h"
-#include "theory/bv/theory_bv_rewrite_rules.h"
+#include "theory/bv/theory_bv_rewriter.h"
#include "proof/proof_manager.h"
#include "util/proof.h"
#include "util/boolean_simplification.h"
Node node = n;
NodeManager* nm = d_smt.d_nodeManager;
-
+ // FIXME: this theory specific code should be factored out of the SmtEngine, somehow
switch(k) {
case kind::BITVECTOR_SDIV:
case kind::BITVECTOR_SREM:
case kind::BITVECTOR_SMOD: {
- node = bv::LinearRewriteStrategy <
- bv::RewriteRule<bv::SremEliminate>,
- bv::RewriteRule<bv::SdivEliminate>,
- bv::RewriteRule<bv::SmodEliminate>
- >::apply(node);
+ node = bv::TheoryBVRewriter::eliminateBVSDiv(node);
break;
}
d_rewriteTable [ kind::BITVECTOR_ROTATE_LEFT ] = RewriteRotateLeft;
}
+Node TheoryBVRewriter::eliminateBVSDiv(TNode node) {
+ Node result = bv::LinearRewriteStrategy <
+ bv::RewriteRule<bv::SremEliminate>,
+ bv::RewriteRule<bv::SdivEliminate>,
+ bv::RewriteRule<bv::SmodEliminate>
+ >::apply(node);
+ return result;
+}
static RewriteResponse postRewrite(TNode node);
static RewriteResponse preRewrite(TNode node);
-
+
static void init();
static void shutdown();
-
+ /**
+ * Temporary hack for devision-by-zero until we refactor theory code from
+ * smt engine.
+ *
+ * @param node
+ *
+ * @return
+ */
+ static Node eliminateBVSDiv(TNode node);
};/* class TheoryBVRewriter */
}/* CVC4::theory::bv namespace */