{
return false;
}
+
+ if (Configuration::isAssertionBuild() && isLeaf(node) && !node.isConst()
+ && node.getType().isFloatingPoint())
+ {
+ // Check that the equality engine has asssigned values to all the
+ // components of `node` except `(sign node)` (the sign component is
+ // assignable, meaning that the model builder can pick an arbitrary value
+ // for it if it hasn't been assigned in the equality engine).
+ NodeManager* nm = NodeManager::currentNM();
+ Node compNaN = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_NAN, node);
+ Node compInf = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_INF, node);
+ Node compZero = nm->mkNode(kind::FLOATINGPOINT_COMPONENT_ZERO, node);
+ Node compExponent =
+ nm->mkNode(kind::FLOATINGPOINT_COMPONENT_EXPONENT, node);
+ Node compSignificand =
+ nm->mkNode(kind::FLOATINGPOINT_COMPONENT_SIGNIFICAND, node);
+
+ eq::EqualityEngine* ee = m->getEqualityEngine();
+ Assert(ee->hasTerm(compNaN) && ee->getRepresentative(compNaN).isConst());
+ Assert(ee->hasTerm(compInf) && ee->getRepresentative(compInf).isConst());
+ Assert(ee->hasTerm(compZero)
+ && ee->getRepresentative(compZero).isConst());
+ Assert(ee->hasTerm(compExponent)
+ && ee->getRepresentative(compExponent).isConst());
+ Assert(ee->hasTerm(compSignificand));
+ Assert(ee->getRepresentative(compSignificand).isConst());
+
+ // At most one of the flags (NaN, inf, zero) can be set
+ Node one = nm->mkConst(BitVector(1U, 1U));
+ size_t numFlags = 0;
+ numFlags += ee->getRepresentative(compNaN) == one ? 1 : 0;
+ numFlags += ee->getRepresentative(compInf) == one ? 1 : 0;
+ numFlags += ee->getRepresentative(compZero) == one ? 1 : 0;
+ Assert(numFlags <= 1);
+ }
}
return true;
return !n.getType().isFunction();
}
}
+ else if (n.getKind() == kind::FLOATINGPOINT_COMPONENT_SIGN)
+ {
+ // Extracting the sign of a floating-point number acts similar to a
+ // selector on a datatype, i.e. if `(sign x)` wasn't assigned a value, we
+ // can pick an arbitrary one. Note that the other components of a
+ // floating-point number should always be assigned a value.
+ return true;
+ }
else
{
// non-function variables, and fully applied functions