#ifndef __CVC4__BITBLAST__STRATEGIES_TEMPLATE_H
#define __CVC4__BITBLAST__STRATEGIES_TEMPLATE_H
+#include <cmath>
+#include <ostream>
+
#include "cvc4_private.h"
#include "expr/node.h"
#include "theory/bv/bitblast_utils.h"
#include "theory/bv/theory_bv_utils.h"
-#include <ostream>
-#include <cmath>
+#include "theory/rewriter.h"
+
namespace CVC4 {
namespace theory {
}
// cache the remainder in case we need it later
- Node remainder = utils::mkNode(kind::BITVECTOR_UREM_TOTAL, node[0], node[1]);
+ Node remainder = Rewriter::rewrite(
+ utils::mkNode(kind::BITVECTOR_UREM_TOTAL, node[0], node[1]));
bb->storeBBTerm(remainder, r);
}
}
// cache the quotient in case we need it later
- Node quotient = utils::mkNode(kind::BITVECTOR_UDIV_TOTAL, node[0], node[1]);
+ Node quotient = Rewriter::rewrite(
+ utils::mkNode(kind::BITVECTOR_UDIV_TOTAL, node[0], node[1]));
bb->storeBBTerm(quotient, q);
}
// check for b < log2(n)
unsigned size = utils::getSize(node);
unsigned log2_size = std::ceil(log2((double)size));
- Node a_size = utils::mkConst(BitVector(size, size));
- Node b_ult_a_size_node = utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size);
+ Node a_size = utils::mkConst(BitVector(size, size));
+ Node b_ult_a_size_node =
+ Rewriter::rewrite(utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size));
// ensure that the inequality is bit-blasted
bb->bbAtom(b_ult_a_size_node);
T b_ult_a_size = bb->getBBAtom(b_ult_a_size_node);
// check for b < log2(n)
unsigned size = utils::getSize(node);
unsigned log2_size = std::ceil(log2((double)size));
- Node a_size = utils::mkConst(BitVector(size, size));
- Node b_ult_a_size_node = utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size);
+ Node a_size = utils::mkConst(BitVector(size, size));
+ Node b_ult_a_size_node =
+ Rewriter::rewrite(utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size));
// ensure that the inequality is bit-blasted
bb->bbAtom(b_ult_a_size_node);
T b_ult_a_size = bb->getBBAtom(b_ult_a_size_node);
// check for b < n
unsigned size = utils::getSize(node);
unsigned log2_size = std::ceil(log2((double)size));
- Node a_size = utils::mkConst(BitVector(size, size));
- Node b_ult_a_size_node = utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size);
+ Node a_size = utils::mkConst(BitVector(size, size));
+ Node b_ult_a_size_node =
+ Rewriter::rewrite(utils::mkNode(kind::BITVECTOR_ULT, node[1], a_size));
// ensure that the inequality is bit-blasted
bb->bbAtom(b_ult_a_size_node);
T b_ult_a_size = bb->getBBAtom(b_ult_a_size_node);