Op op = solver.mkOp(FLOATINGPOINT_TO_SBV, 16); // (_ fp.to_sbv 16)
lhs = solver.mkTerm(op, rtp, d);
rhs = solver.mkTerm(op, rtn, d);
- solver.assertFormula(solver.mkTerm(FLOATINGPOINT_ISN, d));
+ solver.assertFormula(solver.mkTerm(FLOATINGPOINT_IS_NORMAL, d));
solver.assertFormula(solver.mkTerm(NOT, solver.mkTerm(EQUAL, lhs, rhs)));
r = solver.checkSat(); // result is sat
Op op = solver.mkOp(Kind.FLOATINGPOINT_TO_SBV, 16); // (_ fp.to_sbv 16)
lhs = solver.mkTerm(op, rtp, d);
rhs = solver.mkTerm(op, rtn, d);
- solver.assertFormula(solver.mkTerm(Kind.FLOATINGPOINT_ISN, d));
+ solver.assertFormula(solver.mkTerm(Kind.FLOATINGPOINT_IS_NORMAL, d));
solver.assertFormula(solver.mkTerm(Kind.NOT, solver.mkTerm(Kind.EQUAL, lhs, rhs)));
r = solver.checkSat(); // result is sat
{FLOATINGPOINT_LT, cvc5::Kind::FLOATINGPOINT_LT},
{FLOATINGPOINT_GEQ, cvc5::Kind::FLOATINGPOINT_GEQ},
{FLOATINGPOINT_GT, cvc5::Kind::FLOATINGPOINT_GT},
- {FLOATINGPOINT_ISN, cvc5::Kind::FLOATINGPOINT_ISN},
- {FLOATINGPOINT_ISSN, cvc5::Kind::FLOATINGPOINT_ISSN},
- {FLOATINGPOINT_ISZ, cvc5::Kind::FLOATINGPOINT_ISZ},
- {FLOATINGPOINT_ISINF, cvc5::Kind::FLOATINGPOINT_ISINF},
- {FLOATINGPOINT_ISNAN, cvc5::Kind::FLOATINGPOINT_ISNAN},
- {FLOATINGPOINT_ISNEG, cvc5::Kind::FLOATINGPOINT_ISNEG},
- {FLOATINGPOINT_ISPOS, cvc5::Kind::FLOATINGPOINT_ISPOS},
+ {FLOATINGPOINT_IS_NORMAL, cvc5::Kind::FLOATINGPOINT_IS_NORMAL},
+ {FLOATINGPOINT_IS_SUBNORMAL, cvc5::Kind::FLOATINGPOINT_IS_SUBNORMAL},
+ {FLOATINGPOINT_IS_ZERO, cvc5::Kind::FLOATINGPOINT_IS_ZERO},
+ {FLOATINGPOINT_IS_INF, cvc5::Kind::FLOATINGPOINT_IS_INF},
+ {FLOATINGPOINT_IS_NAN, cvc5::Kind::FLOATINGPOINT_IS_NAN},
+ {FLOATINGPOINT_IS_NEG, cvc5::Kind::FLOATINGPOINT_IS_NEG},
+ {FLOATINGPOINT_IS_POS, cvc5::Kind::FLOATINGPOINT_IS_POS},
{FLOATINGPOINT_TO_FP_FLOATINGPOINT,
cvc5::Kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT},
{FLOATINGPOINT_TO_FP_IEEE_BITVECTOR,
{cvc5::Kind::FLOATINGPOINT_LT, FLOATINGPOINT_LT},
{cvc5::Kind::FLOATINGPOINT_GEQ, FLOATINGPOINT_GEQ},
{cvc5::Kind::FLOATINGPOINT_GT, FLOATINGPOINT_GT},
- {cvc5::Kind::FLOATINGPOINT_ISN, FLOATINGPOINT_ISN},
- {cvc5::Kind::FLOATINGPOINT_ISSN, FLOATINGPOINT_ISSN},
- {cvc5::Kind::FLOATINGPOINT_ISZ, FLOATINGPOINT_ISZ},
- {cvc5::Kind::FLOATINGPOINT_ISINF, FLOATINGPOINT_ISINF},
- {cvc5::Kind::FLOATINGPOINT_ISNAN, FLOATINGPOINT_ISNAN},
- {cvc5::Kind::FLOATINGPOINT_ISNEG, FLOATINGPOINT_ISNEG},
- {cvc5::Kind::FLOATINGPOINT_ISPOS, FLOATINGPOINT_ISPOS},
+ {cvc5::Kind::FLOATINGPOINT_IS_NORMAL, FLOATINGPOINT_IS_NORMAL},
+ {cvc5::Kind::FLOATINGPOINT_IS_SUBNORMAL, FLOATINGPOINT_IS_SUBNORMAL},
+ {cvc5::Kind::FLOATINGPOINT_IS_ZERO, FLOATINGPOINT_IS_ZERO},
+ {cvc5::Kind::FLOATINGPOINT_IS_INF, FLOATINGPOINT_IS_INF},
+ {cvc5::Kind::FLOATINGPOINT_IS_NAN, FLOATINGPOINT_IS_NAN},
+ {cvc5::Kind::FLOATINGPOINT_IS_NEG, FLOATINGPOINT_IS_NEG},
+ {cvc5::Kind::FLOATINGPOINT_IS_POS, FLOATINGPOINT_IS_POS},
{cvc5::Kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP,
FLOATINGPOINT_TO_FP_IEEE_BITVECTOR},
{cvc5::Kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR,
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISN,
+ FLOATINGPOINT_IS_NORMAL,
/**
* Floating-point is sub-normal.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISSN,
+ FLOATINGPOINT_IS_SUBNORMAL,
/**
* Floating-point is zero.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISZ,
+ FLOATINGPOINT_IS_ZERO,
/**
* Floating-point is infinite.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISINF,
+ FLOATINGPOINT_IS_INF,
/**
* Floating-point is NaN.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISNAN,
+ FLOATINGPOINT_IS_NAN,
/**
* Floating-point is negative.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISNEG,
+ FLOATINGPOINT_IS_NEG,
/**
* Floating-point is positive.
*
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
- FLOATINGPOINT_ISPOS,
+ FLOATINGPOINT_IS_POS,
/**
* Operator for to_fp from bit vector.
*
4. replace Bitvector with BV
There is one exception:
- FLOATINGPOINT_ISNAN --> FPIsNan
+ FLOATINGPOINT_IS_NAN --> FPIsNan
For every "_IS" in the name, there's an underscore added before step 1,
so that the word after "Is" is capitalized
Examples:
BITVECTOR_ADD --> BVAdd
APPLY_SELECTOR --> ApplySelector
- FLOATINGPOINT_ISNAN --> FPIsNan
+ FLOATINGPOINT_IS_NAN --> FPIsNan
SET_MINUS --> Setminus
See the generated .pxi file for an explicit mapping
addOperator(api::FLOATINGPOINT_LT, "fp.lt");
addOperator(api::FLOATINGPOINT_GEQ, "fp.geq");
addOperator(api::FLOATINGPOINT_GT, "fp.gt");
- addOperator(api::FLOATINGPOINT_ISN, "fp.isNormal");
- addOperator(api::FLOATINGPOINT_ISSN, "fp.isSubnormal");
- addOperator(api::FLOATINGPOINT_ISZ, "fp.isZero");
- addOperator(api::FLOATINGPOINT_ISINF, "fp.isInfinite");
- addOperator(api::FLOATINGPOINT_ISNAN, "fp.isNaN");
- addOperator(api::FLOATINGPOINT_ISNEG, "fp.isNegative");
- addOperator(api::FLOATINGPOINT_ISPOS, "fp.isPositive");
+ addOperator(api::FLOATINGPOINT_IS_NORMAL, "fp.isNormal");
+ addOperator(api::FLOATINGPOINT_IS_SUBNORMAL, "fp.isSubnormal");
+ addOperator(api::FLOATINGPOINT_IS_ZERO, "fp.isZero");
+ addOperator(api::FLOATINGPOINT_IS_INF, "fp.isInfinite");
+ addOperator(api::FLOATINGPOINT_IS_NAN, "fp.isNaN");
+ addOperator(api::FLOATINGPOINT_IS_NEG, "fp.isNegative");
+ addOperator(api::FLOATINGPOINT_IS_POS, "fp.isPositive");
addOperator(api::FLOATINGPOINT_TO_REAL, "fp.to_real");
addIndexedOperator(api::FLOATINGPOINT_TO_FP_GENERIC,
case kind::FLOATINGPOINT_GEQ: return "fp.geq";
case kind::FLOATINGPOINT_GT: return "fp.gt";
- case kind::FLOATINGPOINT_ISN: return "fp.isNormal";
- case kind::FLOATINGPOINT_ISSN: return "fp.isSubnormal";
- case kind::FLOATINGPOINT_ISZ: return "fp.isZero";
- case kind::FLOATINGPOINT_ISINF: return "fp.isInfinite";
- case kind::FLOATINGPOINT_ISNAN: return "fp.isNaN";
- case kind::FLOATINGPOINT_ISNEG: return "fp.isNegative";
- case kind::FLOATINGPOINT_ISPOS: return "fp.isPositive";
+ case kind::FLOATINGPOINT_IS_NORMAL: return "fp.isNormal";
+ case kind::FLOATINGPOINT_IS_SUBNORMAL: return "fp.isSubnormal";
+ case kind::FLOATINGPOINT_IS_ZERO: return "fp.isZero";
+ case kind::FLOATINGPOINT_IS_INF: return "fp.isInfinite";
+ case kind::FLOATINGPOINT_IS_NAN: return "fp.isNaN";
+ case kind::FLOATINGPOINT_IS_NEG: return "fp.isNegative";
+ case kind::FLOATINGPOINT_IS_POS: return "fp.isPositive";
case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR: return "to_fp";
case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT: return "to_fp";
break;
/* ---- Tester -------------------------------------------- */
- case kind::FLOATINGPOINT_ISN:
+ case kind::FLOATINGPOINT_IS_NORMAL:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISSN:
+ case kind::FLOATINGPOINT_IS_SUBNORMAL:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISZ:
+ case kind::FLOATINGPOINT_IS_ZERO:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISINF:
+ case kind::FLOATINGPOINT_IS_INF:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISNAN:
+ case kind::FLOATINGPOINT_IS_NAN:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISNEG:
+ case kind::FLOATINGPOINT_IS_NEG:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
(*d_fpMap.find(cur[0])).second));
break;
- case kind::FLOATINGPOINT_ISPOS:
+ case kind::FLOATINGPOINT_IS_POS:
Assert(d_fpMap.find(cur[0]) != d_fpMap.end());
d_boolMap.insert(
cur,
-operator FLOATINGPOINT_ISN 1 "floating-point is normal"
-typerule FLOATINGPOINT_ISN ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_NORMAL 1 "floating-point is normal"
+typerule FLOATINGPOINT_IS_NORMAL ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISSN 1 "floating-point is sub-normal"
-typerule FLOATINGPOINT_ISSN ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_SUBNORMAL 1 "floating-point is sub-normal"
+typerule FLOATINGPOINT_IS_SUBNORMAL ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISZ 1 "floating-point is zero"
-typerule FLOATINGPOINT_ISZ ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_ZERO 1 "floating-point is zero"
+typerule FLOATINGPOINT_IS_ZERO ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISINF 1 "floating-point is infinite"
-typerule FLOATINGPOINT_ISINF ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_INF 1 "floating-point is infinite"
+typerule FLOATINGPOINT_IS_INF ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISNAN 1 "floating-point is NaN"
-typerule FLOATINGPOINT_ISNAN ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_NAN 1 "floating-point is NaN"
+typerule FLOATINGPOINT_IS_NAN ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISNEG 1 "floating-point is negative"
-typerule FLOATINGPOINT_ISNEG ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_NEG 1 "floating-point is negative"
+typerule FLOATINGPOINT_IS_NEG ::cvc5::theory::fp::FloatingPointTestTypeRule
-operator FLOATINGPOINT_ISPOS 1 "floating-point is positive"
-typerule FLOATINGPOINT_ISPOS ::cvc5::theory::fp::FloatingPointTestTypeRule
+operator FLOATINGPOINT_IS_POS 1 "floating-point is positive"
+typerule FLOATINGPOINT_IS_POS ::cvc5::theory::fp::FloatingPointTestTypeRule
d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_LT);
// d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_GEQ); // Removed
// d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_GT); // Removed
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISN);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISSN);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISZ);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISINF);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISNAN);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISNEG);
- d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_ISPOS);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_NORMAL);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_SUBNORMAL);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_ZERO);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_INF);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_NAN);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_NEG);
+ d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_IS_POS);
d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR);
d_equalityEngine->addFunctionKind(kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT);
Node defined = nm->mkNode(
kind::AND,
nm->mkNode(kind::NOT,
- nm->mkNode(kind::FLOATINGPOINT_ISNAN, concrete[0])),
+ nm->mkNode(kind::FLOATINGPOINT_IS_NAN, concrete[0])),
nm->mkNode(kind::NOT,
- nm->mkNode(kind::FLOATINGPOINT_ISINF, concrete[0])));
+ nm->mkNode(kind::FLOATINGPOINT_IS_INF, concrete[0])));
// First the "forward" constraints
Node fg = nm->mkNode(
kind::IMPLIES,
// Give the expansion of classifications in terms of equalities
// This should make equality reasoning slightly more powerful.
- if ((k == kind::FLOATINGPOINT_ISNAN) || (k == kind::FLOATINGPOINT_ISZ)
- || (k == kind::FLOATINGPOINT_ISINF))
+ if ((k == kind::FLOATINGPOINT_IS_NAN) || (k == kind::FLOATINGPOINT_IS_ZERO)
+ || (k == kind::FLOATINGPOINT_IS_INF))
{
NodeManager* nm = NodeManager::currentNM();
FloatingPointSize s = node[0].getType().getConst<FloatingPointSize>();
Node equalityAlias = Node::null();
- if (k == kind::FLOATINGPOINT_ISNAN)
+ if (k == kind::FLOATINGPOINT_IS_NAN)
{
equalityAlias = nm->mkNode(
kind::EQUAL, node[0], nm->mkConst(FloatingPoint::makeNaN(s)));
}
- else if (k == kind::FLOATINGPOINT_ISZ)
+ else if (k == kind::FLOATINGPOINT_IS_ZERO)
{
equalityAlias = nm->mkNode(
kind::OR,
node[0],
nm->mkConst(FloatingPoint::makeZero(s, false))));
}
- else if (k == kind::FLOATINGPOINT_ISINF)
+ else if (k == kind::FLOATINGPOINT_IS_INF)
{
equalityAlias =
nm->mkNode(kind::OR,
Node pd =
nm->mkNode(kind::IMPLIES,
nm->mkNode(kind::OR,
- nm->mkNode(kind::FLOATINGPOINT_ISNAN, node[0]),
- nm->mkNode(kind::FLOATINGPOINT_ISINF, node[0])),
+ nm->mkNode(kind::FLOATINGPOINT_IS_NAN, node[0]),
+ nm->mkNode(kind::FLOATINGPOINT_IS_INF, node[0])),
nm->mkNode(kind::EQUAL, node, node[1]));
handleLemma(pd, InferenceId::FP_REGISTER_TERM);
Node z = nm->mkNode(
kind::IMPLIES,
- nm->mkNode(kind::FLOATINGPOINT_ISZ, node[0]),
+ nm->mkNode(kind::FLOATINGPOINT_IS_ZERO, node[0]),
nm->mkNode(kind::EQUAL, node, nm->mkConstReal(Rational(0U))));
handleLemma(z, InferenceId::FP_REGISTER_TERM);
return;
d_abstractionMap.insert(sk, node);
Node nnan =
- nm->mkNode(kind::NOT, nm->mkNode(kind::FLOATINGPOINT_ISNAN, node));
+ nm->mkNode(kind::NOT, nm->mkNode(kind::FLOATINGPOINT_IS_NAN, node));
handleLemma(nnan, InferenceId::FP_REGISTER_TERM);
Node z = nm->mkNode(
Assert(node.getKind() == kind::FLOATINGPOINT_EQ);
NodeManager *nm = NodeManager::currentNM();
- return RewriteResponse(REWRITE_DONE,
- nm->mkNode(kind::AND,
- nm->mkNode(kind::AND,
- nm->mkNode(kind::NOT, nm->mkNode(kind::FLOATINGPOINT_ISNAN, node[0])),
- nm->mkNode(kind::NOT, nm->mkNode(kind::FLOATINGPOINT_ISNAN, node[1]))),
- nm->mkNode(kind::OR,
- nm->mkNode(kind::EQUAL, node[0], node[1]),
- nm->mkNode(kind::AND,
- nm->mkNode(kind::FLOATINGPOINT_ISZ, node[0]),
- nm->mkNode(kind::FLOATINGPOINT_ISZ, node[1])))));
+ return RewriteResponse(
+ REWRITE_DONE,
+ nm->mkNode(
+ kind::AND,
+ nm->mkNode(
+ kind::AND,
+ nm->mkNode(kind::NOT,
+ nm->mkNode(kind::FLOATINGPOINT_IS_NAN, node[0])),
+ nm->mkNode(kind::NOT,
+ nm->mkNode(kind::FLOATINGPOINT_IS_NAN, node[1]))),
+ nm->mkNode(
+ kind::OR,
+ nm->mkNode(kind::EQUAL, node[0], node[1]),
+ nm->mkNode(kind::AND,
+ nm->mkNode(kind::FLOATINGPOINT_IS_ZERO, node[0]),
+ nm->mkNode(kind::FLOATINGPOINT_IS_ZERO, node[1])))));
}
RewriteResponse geqToleq(TNode node, bool isPreRewrite)
}
RewriteResponse removeSignOperations (TNode node, bool isPreRewrite) {
- Assert(node.getKind() == kind::FLOATINGPOINT_ISN
- || node.getKind() == kind::FLOATINGPOINT_ISSN
- || node.getKind() == kind::FLOATINGPOINT_ISZ
- || node.getKind() == kind::FLOATINGPOINT_ISINF
- || node.getKind() == kind::FLOATINGPOINT_ISNAN);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_NORMAL
+ || node.getKind() == kind::FLOATINGPOINT_IS_SUBNORMAL
+ || node.getKind() == kind::FLOATINGPOINT_IS_ZERO
+ || node.getKind() == kind::FLOATINGPOINT_IS_INF
+ || node.getKind() == kind::FLOATINGPOINT_IS_NAN);
Assert(node.getNumChildren() == 1);
Kind childKind(node[0].getKind());
return RewriteResponse(
isPreRewrite ? REWRITE_DONE : REWRITE_AGAIN_FULL,
nm->mkNode(kind::NOT,
- nm->mkNode(kind::FLOATINGPOINT_ISNAN, node[0])));
+ nm->mkNode(kind::FLOATINGPOINT_IS_NAN, node[0])));
}
return RewriteResponse(REWRITE_DONE, node);
}
RewriteResponse isNormal(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISN);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_NORMAL);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isNormal()));
RewriteResponse isSubnormal(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISSN);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_SUBNORMAL);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isSubnormal()));
RewriteResponse isZero(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISZ);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_ZERO);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isZero()));
RewriteResponse isInfinite(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISINF);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_INF);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isInfinite()));
RewriteResponse isNaN(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISNAN);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_NAN);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isNaN()));
RewriteResponse isNegative(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISNEG);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_NEG);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isNegative()));
RewriteResponse isPositive(TNode node, bool isPreRewrite)
{
- Assert(node.getKind() == kind::FLOATINGPOINT_ISPOS);
+ Assert(node.getKind() == kind::FLOATINGPOINT_IS_POS);
Assert(node.getNumChildren() == 1);
return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(node[0].getConst<FloatingPoint>().isPositive()));
rewrite::then<rewrite::breakChain, rewrite::gtTolt>;
/******** Classifications ********/
- d_preRewriteTable[kind::FLOATINGPOINT_ISN] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISSN] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISZ] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISINF] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISNAN] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISNEG] = rewrite::identity;
- d_preRewriteTable[kind::FLOATINGPOINT_ISPOS] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_NORMAL] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_SUBNORMAL] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_ZERO] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_INF] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_NAN] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_NEG] = rewrite::identity;
+ d_preRewriteTable[kind::FLOATINGPOINT_IS_POS] = rewrite::identity;
/******** Conversions ********/
d_preRewriteTable[kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR] =
d_postRewriteTable[kind::FLOATINGPOINT_GT] = rewrite::identity;
/******** Classifications ********/
- d_postRewriteTable[kind::FLOATINGPOINT_ISN] = rewrite::removeSignOperations;
- d_postRewriteTable[kind::FLOATINGPOINT_ISSN] = rewrite::removeSignOperations;
- d_postRewriteTable[kind::FLOATINGPOINT_ISZ] = rewrite::removeSignOperations;
- d_postRewriteTable[kind::FLOATINGPOINT_ISINF] = rewrite::removeSignOperations;
- d_postRewriteTable[kind::FLOATINGPOINT_ISNAN] = rewrite::removeSignOperations;
- d_postRewriteTable[kind::FLOATINGPOINT_ISNEG] = rewrite::identity;
- d_postRewriteTable[kind::FLOATINGPOINT_ISPOS] = rewrite::identity;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_NORMAL] =
+ rewrite::removeSignOperations;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_SUBNORMAL] =
+ rewrite::removeSignOperations;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_ZERO] =
+ rewrite::removeSignOperations;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_INF] =
+ rewrite::removeSignOperations;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_NAN] =
+ rewrite::removeSignOperations;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_NEG] = rewrite::identity;
+ d_postRewriteTable[kind::FLOATINGPOINT_IS_POS] = rewrite::identity;
/******** Conversions ********/
d_postRewriteTable[kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR] =
d_constantFoldTable[kind::FLOATINGPOINT_LT] = constantFold::lt;
/******** Classifications ********/
- d_constantFoldTable[kind::FLOATINGPOINT_ISN] = constantFold::isNormal;
- d_constantFoldTable[kind::FLOATINGPOINT_ISSN] = constantFold::isSubnormal;
- d_constantFoldTable[kind::FLOATINGPOINT_ISZ] = constantFold::isZero;
- d_constantFoldTable[kind::FLOATINGPOINT_ISINF] = constantFold::isInfinite;
- d_constantFoldTable[kind::FLOATINGPOINT_ISNAN] = constantFold::isNaN;
- d_constantFoldTable[kind::FLOATINGPOINT_ISNEG] = constantFold::isNegative;
- d_constantFoldTable[kind::FLOATINGPOINT_ISPOS] = constantFold::isPositive;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_NORMAL] = constantFold::isNormal;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_SUBNORMAL] =
+ constantFold::isSubnormal;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_ZERO] = constantFold::isZero;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_INF] = constantFold::isInfinite;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_NAN] = constantFold::isNaN;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_NEG] = constantFold::isNegative;
+ d_constantFoldTable[kind::FLOATINGPOINT_IS_POS] = constantFold::isPositive;
/******** Conversions ********/
d_constantFoldTable[kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR] =
else if (types[i].isFloatingPoint())
{
Trace("sygus-grammar-def") << "...add FP predicates" << std::endl;
- std::vector<Kind> fp_unary_predicates = {FLOATINGPOINT_ISN,
- FLOATINGPOINT_ISSN,
- FLOATINGPOINT_ISZ,
- FLOATINGPOINT_ISINF,
- FLOATINGPOINT_ISNAN,
- FLOATINGPOINT_ISNEG,
- FLOATINGPOINT_ISPOS};
+ std::vector<Kind> fp_unary_predicates = {FLOATINGPOINT_IS_NORMAL,
+ FLOATINGPOINT_IS_SUBNORMAL,
+ FLOATINGPOINT_IS_ZERO,
+ FLOATINGPOINT_IS_INF,
+ FLOATINGPOINT_IS_NAN,
+ FLOATINGPOINT_IS_NEG,
+ FLOATINGPOINT_IS_POS};
for (const Kind kind : fp_unary_predicates)
{
sdtBool.addConstructor(kind, cargs);
Term const2 = slv.mkConst(sort_bool, "_c4");
Term ite = slv.mkTerm(ITE, const2, const1, const0);
Term rem = slv.mkTerm(FLOATINGPOINT_REM, ite, const1);
- Term isnan = slv.mkTerm(FLOATINGPOINT_ISNAN, rem);
+ Term isnan = slv.mkTerm(FLOATINGPOINT_IS_NAN, rem);
slv.checkSatAssuming(isnan);
return 0;
}