}
}
-Node TheoryArithPrivate::axiomIteForTotalDivision(Node div_tot){
- Assert(div_tot.getKind() == DIVISION_TOTAL);
-
- // Inverse of multiplication axiom:
- // (for all ((n Real) (d Real))
- // (ite (= d 0)
- // (= (DIVISION_TOTAL n d) 0)
- // (= (* d (DIVISION_TOTAL n d)) n)))
-
-
- Polynomial n = Polynomial::parsePolynomial(div_tot[0]);
- Polynomial d = Polynomial::parsePolynomial(div_tot[1]);
- Polynomial div_tot_p = Polynomial::parsePolynomial(div_tot);
-
- Comparison invEq = Comparison::mkComparison(EQUAL, n, d * div_tot_p);
- Comparison zeroEq = Comparison::mkComparison(EQUAL, div_tot_p, Polynomial::mkZero());
- Node dEq0 = (d.getNode()).eqNode(mkRationalNode(0));
- Node ite = dEq0.iteNode(zeroEq.getNode(), invEq.getNode());
-
- return ite;
-}
-
-Node TheoryArithPrivate::axiomIteForTotalIntDivision(Node int_div_like){
- Kind k = int_div_like.getKind();
- Assert(k == INTS_DIVISION_TOTAL || k == INTS_MODULUS_TOTAL);
-
- // See the discussion of integer division axioms above.
-
- Polynomial n = Polynomial::parsePolynomial(int_div_like[0]);
- Polynomial d = Polynomial::parsePolynomial(int_div_like[1]);
-
- NodeManager* currNM = NodeManager::currentNM();
- Node zero = mkRationalNode(0);
-
- Node q = (k == INTS_DIVISION_TOTAL) ? int_div_like : currNM->mkNode(INTS_DIVISION_TOTAL, n.getNode(), d.getNode());
- Node r = (k == INTS_MODULUS_TOTAL) ? int_div_like : currNM->mkNode(INTS_MODULUS_TOTAL, n.getNode(), d.getNode());
-
- Node dEq0 = (d.getNode()).eqNode(zero);
- Node qEq0 = q.eqNode(zero);
- Node rEq0 = r.eqNode(zero);
-
- Polynomial rp = Polynomial::parsePolynomial(r);
- Polynomial qp = Polynomial::parsePolynomial(q);
-
- Node abs_d = (d.isConstant()) ?
- d.getHead().getConstant().abs().getNode() : mkIntSkolem("abs");
-
- Node eq = Comparison::mkComparison(EQUAL, n, d * qp + rp).getNode();
- Node leq0 = currNM->mkNode(LEQ, zero, r);
- Node leq1 = currNM->mkNode(LT, r, abs_d);
-
- Node andE = currNM->mkNode(AND, eq, leq0, leq1);
- Node defDivMode = dEq0.iteNode(qEq0.andNode(rEq0), andE);
- Node lem = abs_d.getMetaKind () == metakind::VARIABLE ?
- defDivMode.andNode(d.makeAbsCondition(Variable(abs_d))) : defDivMode;
-
- return lem;
-}
-
void TheoryArithPrivate::setupPolynomial(const Polynomial& poly) {
Assert(!poly.containsConstant());