}
size_t bsize = a.getOperator().getConst<IntAnd>().d_size;
d_iands[bsize].push_back(a);
+ Trace("iand-mv") << "- " << a << std::endl;
}
-
- Trace("iand") << "We have " << d_iands.size() << " IAND terms." << std::endl;
}
void IAndSolver::checkInitialRefine()
Node IAndSolver::valueBasedLemma(Node i)
{
+ NodeManager* nm = NodeManager::currentNM();
Assert(i.getKind() == IAND);
Node x = i[0];
Node y = i[1];
+ size_t bvsize = i.getOperator().getConst<IntAnd>().d_size;
+ Node twok = nm->mkConstInt(Rational(Integer(2).pow(bvsize)));
Node valX = d_model.computeConcreteModelValue(x);
Node valY = d_model.computeConcreteModelValue(y);
+ valX = nm->mkNode(kind::INTS_MODULUS, valX, twok);
+ valY = nm->mkNode(kind::INTS_MODULUS, valY, twok);
- NodeManager* nm = NodeManager::currentNM();
Node valC = nm->mkNode(IAND, i.getOperator(), valX, valY);
valC = rewrite(valC);
- Node lem = nm->mkNode(
- IMPLIES, nm->mkNode(AND, x.eqNode(valX), y.eqNode(valY)), i.eqNode(valC));
+ Node xm = nm->mkNode(kind::INTS_MODULUS, x, twok);
+ Node ym = nm->mkNode(kind::INTS_MODULUS, y, twok);
+
+ // (=>
+ // (and (= (mod x 2^n) (mod c1 2^n)) (= (mod y 2^n) (mod c2 2^n)))
+ // (= ((_ iand n) x y) rewrite(((_ iand n) (mod c1 2^n) (mod c2 2^n))))
+ // Note we use mod above since it ensures the the set of possible literals
+ // introduced is finite, since there are finitely many values mod 2^n.
+ Node lem = nm->mkNode(IMPLIES,
+ nm->mkNode(AND, xm.eqNode(valX), ym.eqNode(valY)),
+ i.eqNode(valC));
return lem;
}
regress0/nl/coeff-sat.smt2
regress0/nl/combined-uf.smt2
regress0/nl/dd.fuzz01.smtv1-to-real-idem.smt2
+ regress0/nl/dd.iand-wrong-0513-pp.smt2
regress0/nl/iand-no-init.smt2
regress0/nl/issue3003.smt2
regress0/nl/issue3407.smt2
regress1/bv/bv2nat-simp-range-sat.smt2
regress1/bv/bv2nat-types.smt2
regress1/bv/cmu-rdk-3.smt2
+ regress1/bv/dd.iand-wrong-0513.smt2
regress1/bv/decision-weight00.smt2
regress1/bv/divtest.smt2
regress1/bv/fuzz18.smtv1.smt2
--- /dev/null
+; COMMAND-LINE: --solve-bv-as-int=iand --iand-mode=bitwise --nl-ext-tplanes
+; EXPECT: sat
+(set-logic ALL)
+(declare-const a (_ BitVec 2))
+(declare-const R (_ BitVec 2))
+(declare-const t (_ BitVec 2))
+(declare-const x Bool)
+(assert
+(or
+(and (= (_ bv1 6) ((_ zero_extend 4) t)) (= ((_ zero_extend 4) a) (bvor ((_ zero_extend 4) t) ((_ zero_extend 4) R))))
+x))
+(assert
+(= (_ bv0 6) (bvand ((_ zero_extend 4) a) ((_ zero_extend 4) t)))
+)
+(check-sat)