#endif
#ifndef CVC4_USE_SYMFPU
-#define PRECONDITION(X) Assert((X))
#define SYMFPU_NUMBER_OF_ROUNDING_MODES 5
#endif
symbolicRoundingMode traits::RTP(void) { return symbolicRoundingMode(0x04); };
symbolicRoundingMode traits::RTN(void) { return symbolicRoundingMode(0x08); };
symbolicRoundingMode traits::RTZ(void) { return symbolicRoundingMode(0x10); };
+
void traits::precondition(const bool b)
{
AlwaysAssert(b);
symbolicProposition::symbolicProposition(const Node n) : nodeWrapper(n)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
} // Only used within this header so could be friend'd
symbolicProposition::symbolicProposition(bool v)
: nodeWrapper(
NodeManager::currentNM()->mkConst(BitVector(1U, (v ? 1U : 0U))))
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
+
symbolicProposition::symbolicProposition(const symbolicProposition &old)
: nodeWrapper(old)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
symbolicProposition symbolicProposition::operator!(void)const
symbolicRoundingMode::symbolicRoundingMode(const Node n) : nodeWrapper(n)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
#ifdef CVC4_USE_SYMFPU
: nodeWrapper(NodeManager::currentNM()->mkConst(
BitVector(SYMFPU_NUMBER_OF_ROUNDING_MODES, v)))
{
- PRECONDITION((v & (v - 1)) == 0 && v != 0); // Exactly one bit set
- PRECONDITION(checkNodeType(*this));
+ Assert((v & (v - 1)) == 0 && v != 0); // Exactly one bit set
+ Assert(checkNodeType(*this));
}
#else
symbolicRoundingMode::symbolicRoundingMode(const unsigned v)
symbolicRoundingMode::symbolicRoundingMode(const symbolicRoundingMode &old)
: nodeWrapper(old)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
symbolicProposition symbolicRoundingMode::valid(void) const
template <bool isSigned>
symbolicBitVector<isSigned>::symbolicBitVector(const Node n) : nodeWrapper(n)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
template <bool isSigned>
symbolicBitVector<isSigned>::symbolicBitVector(const bwt w, const unsigned v)
: nodeWrapper(NodeManager::currentNM()->mkConst(BitVector(w, v)))
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
template <bool isSigned>
symbolicBitVector<isSigned>::symbolicBitVector(const symbolicProposition &p)
const symbolicBitVector<isSigned> &old)
: nodeWrapper(old)
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
template <bool isSigned>
symbolicBitVector<isSigned>::symbolicBitVector(const BitVector &old)
: nodeWrapper(NodeManager::currentNM()->mkConst(old))
{
- PRECONDITION(checkNodeType(*this));
+ Assert(checkNodeType(*this));
}
template <bool isSigned>
symbolicBitVector<isSigned> symbolicBitVector<isSigned>::contract(
bwt reduction) const
{
- PRECONDITION(this->getWidth() > reduction);
+ Assert(this->getWidth() > reduction);
NodeBuilder<> construct(kind::BITVECTOR_EXTRACT);
construct << NodeManager::currentNM()->mkConst<BitVectorExtract>(
symbolicBitVector<isSigned> symbolicBitVector<isSigned>::matchWidth(
const symbolicBitVector<isSigned> &op) const
{
- PRECONDITION(this->getWidth() <= op.getWidth());
+ Assert(this->getWidth() <= op.getWidth());
return this->extend(op.getWidth() - this->getWidth());
}
symbolicBitVector<isSigned> symbolicBitVector<isSigned>::extract(
bwt upper, bwt lower) const
{
- PRECONDITION(upper >= lower);
+ Assert(upper >= lower);
NodeBuilder<> construct(kind::BITVECTOR_EXTRACT);
construct << NodeManager::currentNM()->mkConst<BitVectorExtract>(
floatingPointTypeInfo::floatingPointTypeInfo(const TypeNode type)
: FloatingPointSize(type.getConst<FloatingPointSize>())
{
- PRECONDITION(type.isFloatingPoint());
+ Assert(type.isFloatingPoint());
}
floatingPointTypeInfo::floatingPointTypeInfo(unsigned exp, unsigned sig)
: FloatingPointSize(exp, sig)