}
d_initRefine.insert(i);
Node op = i.getOperator();
+ size_t bsize = op.getConst<IntAnd>().d_size;
+ Node twok = nm->mkConstInt(Rational(Integer(2).pow(bsize)));
+ Node arg0Mod = nm->mkNode(kind::INTS_MODULUS, i[0], twok);
+ Node arg1Mod = nm->mkNode(kind::INTS_MODULUS, i[1], twok);
// initial refinement lemmas
std::vector<Node> conj;
// iand(x,y)=iand(y,x) is guaranteed by rewriting
// 0 <= iand(x,y) < 2^k
conj.push_back(nm->mkNode(LEQ, d_zero, i));
conj.push_back(nm->mkNode(LT, i, rewrite(d_iandUtils.twoToK(k))));
- // iand(x,y)<=x
- conj.push_back(nm->mkNode(LEQ, i, i[0]));
- // iand(x,y)<=y
- conj.push_back(nm->mkNode(LEQ, i, i[1]));
- // x=y => iand(x,y)=x
- conj.push_back(nm->mkNode(IMPLIES, i[0].eqNode(i[1]), i.eqNode(i[0])));
+ // iand(x,y)<=mod(x, 2^k)
+ conj.push_back(nm->mkNode(LEQ, i, arg0Mod));
+ // iand(x,y)<=mod(y, 2^k)
+ conj.push_back(nm->mkNode(LEQ, i, arg1Mod));
+ // x=y => iand(x,y)=mod(x, 2^k)
+ conj.push_back(nm->mkNode(IMPLIES, i[0].eqNode(i[1]), i.eqNode(arg0Mod)));
Node lem = conj.size() == 1 ? conj[0] : nm->mkNode(AND, conj);
Trace("iand-lemma") << "IAndSolver::Lemma: " << lem << " ; INIT_REFINE"
<< std::endl;
ArithVar TheoryArithPrivate::requestArithVar(TNode x, bool aux, bool internal){
//TODO : The VarList trick is good enough?
- Assert(isLeaf(x) || VarList::isMember(x) || x.getKind() == ADD || internal);
- if (logicInfo().isLinear() && Variable::isDivMember(x))
+ Kind xk = x.getKind();
+ Assert(isLeaf(x) || VarList::isMember(x) || xk == ADD || internal);
+ if (logicInfo().isLinear()
+ && (Variable::isDivMember(x) || xk == IAND || isTranscendentalKind(xk)))
{
stringstream ss;
- ss << "A non-linear fact (involving div/mod/divisibility) was asserted to "
+ ss << "A non-linear fact was asserted to "
"arithmetic in a linear logic: "
<< x << std::endl;
throw LogicException(ss.str());
regress1/nl/issue3966-conf-coeff.smt2
regress1/nl/issue4791-llr.smt2
regress1/nl/issue5372-2-no-m-presolve.smt2
+ regress1/nl/issue5461-iand-init-refine.smt2
regress1/nl/issue5660-mb-success.smt2
regress1/nl/issue5662-nl-tc.smt2
regress1/nl/issue5662-nl-tc-min.smt2