{
// current is not the elimination of any previously-visited node
// current hasn't been eliminated yet.
- // eliminate operators from it
+ // eliminate operators from it using rewrite rules
Node currentEliminated =
FixpointRewriteStrategy<RewriteRule<UdivZero>,
RewriteRule<SdivEliminateFewerBitwiseOps>,
RewriteRule<SltEliminate>,
RewriteRule<SgtEliminate>,
RewriteRule<SgeEliminate>>::apply(current);
+
+ // expanding definitions of udiv and urem
+ if (k == kind::BITVECTOR_UDIV)
+ {
+ currentEliminated = d_nm->mkNode(kind::BITVECTOR_UDIV_TOTAL,
+ currentEliminated[0],
+ currentEliminated[1]);
+ }
+ else if (k == kind::BITVECTOR_UREM)
+ {
+ currentEliminated = d_nm->mkNode(kind::BITVECTOR_UREM_TOTAL,
+ currentEliminated[0],
+ currentEliminated[1]);
+ }
+
// save in the cache
d_eliminationCache[current] = currentEliminated;
// also assign the eliminated now to itself to avoid revisiting.
// The following variable will only be used in assertions.
CVC4_UNUSED uint64_t originalNumChildren = original.getNumChildren();
Node returnNode;
+ // Assert that BITVECTOR_UDIV/UREM were replaced by their
+ // *_TOTAL versions
+ Assert(oldKind != kind::BITVECTOR_UDIV);
+ Assert(oldKind != kind::BITVECTOR_UREM);
switch (oldKind)
{
case kind::BITVECTOR_PLUS:
regress2/bv_to_int_ashr.smt2
regress2/bv_to_int_bitwise.smt2
regress2/bv_to_int_bvuf_to_intuf_smtlib.smt2
+ regress2/bv_to_int_bvmul1.smt2
regress2/bv_to_int_inc1.smt2
regress2/bv_to_int_mask_array_1.smt2
regress2/bv_to_int_mask_array_2.smt2
regress2/arith/real2int-test.smt2
regress2/bug396.smt2
# due to bv2int not handling unsigned/signed division
- regress2/bv_to_int_bvmul1.smt2
regress2/nl/dumortier-050317.smt2
regress2/nl/nt-lemmas-bad.smt2
regress2/quantifiers/ForElimination-scala-9.smt2