symbolicProposition symbolicRoundingMode::valid(void) const
{
NodeManager *nm = NodeManager::currentNM();
- Node zero(nm->mkConst(
- BitVector(SYMFPU_NUMBER_OF_ROUNDING_MODES, (long unsigned int)0)));
+ Node zero(nm->mkConst(BitVector(SYMFPU_NUMBER_OF_ROUNDING_MODES, 0u)));
// Is there a better encoding of this?
return symbolicProposition(nm->mkNode(
kind::BITVECTOR_AND,
- nm->mkNode(kind::BITVECTOR_COMP,
- nm->mkNode(kind::BITVECTOR_AND,
- *this,
- nm->mkNode(kind::BITVECTOR_SUB,
- *this,
- nm->mkConst(BitVector(
- SYMFPU_NUMBER_OF_ROUNDING_MODES,
- (long unsigned int)1)))),
- zero),
+ nm->mkNode(
+ kind::BITVECTOR_COMP,
+ nm->mkNode(kind::BITVECTOR_AND,
+ *this,
+ nm->mkNode(kind::BITVECTOR_SUB,
+ *this,
+ nm->mkConst(BitVector(
+ SYMFPU_NUMBER_OF_ROUNDING_MODES, 1u)))),
+ zero),
nm->mkNode(kind::BITVECTOR_NOT,
nm->mkNode(kind::BITVECTOR_COMP, *this, zero))));
}
#ifndef __CVC4__BITVECTOR_H
#define __CVC4__BITVECTOR_H
+#include <cstdint>
#include <iosfwd>
#include "base/exception.h"
BitVector(unsigned size = 0) : d_size(size), d_value(0) {}
- BitVector(unsigned size, unsigned int z) : d_size(size), d_value(z)
+ /**
+ * BitVector constructor using a 32-bit unsigned integer for the value.
+ *
+ * Note: we use an explicit bit-width here to be consistent across
+ * platforms (long is 32-bit when compiling 64-bit binaries on
+ * Windows but 64-bit on Linux) and to prevent ambiguous overloads.
+ */
+ BitVector(unsigned size, uint32_t z) : d_size(size), d_value(z)
{
d_value = d_value.modByPow2(size);
}
- BitVector(unsigned size, unsigned long int z) : d_size(size), d_value(z)
+ /**
+ * BitVector constructor using a 64-bit unsigned integer for the value.
+ *
+ * Note: we use an explicit bit-width here to be consistent across
+ * platforms (long is 32-bit when compiling 64-bit binaries on
+ * Windows but 64-bit on Linux) and to prevent ambiguous overloads.
+ */
+ BitVector(unsigned size, uint64_t z) : d_size(size), d_value(z)
{
d_value = d_value.modByPow2(size);
}