SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
stabilizer::util::BitVector Class Reference

#include <bitvector.h>

Public Member Functions

 BitVector ()
 
 BitVector (uint64_t size)
 
 BitVector (uint64_t size, const std::string &value, uint32_t base=2)
 
 BitVector (uint64_t size, const mpz_t value, bool truncate=false)
 
 BitVector (const BitVector &other)
 
 BitVector (BitVector &&other)
 
 ~BitVector ()
 
BitVectoroperator= (const BitVector &other)
 
size_t hash () const
 
bool is_null () const
 
void iset (uint64_t value)
 
void iset (const BitVector &bv)
 
bool operator== (const BitVector &bv) const
 
bool operator!= (const BitVector &bv) const
 
std::string str (uint32_t base=2) const
 
uint64_t to_uint64 (bool truncate=false) const
 
uint64_t size () const
 
int32_t compare (const BitVector &bv) const
 
int32_t signed_compare (const BitVector &bv) const
 
bool bit (uint64_t idx) const
 
void set_bit (uint64_t idx, bool value)
 
void flip_bit (uint64_t idx)
 
bool lsb () const
 
bool msb () const
 
bool is_true () const
 
bool is_false () const
 
bool is_zero () const
 
bool is_ones () const
 
bool is_one () const
 
bool is_min_signed () const
 
bool is_max_signed () const
 
bool is_power_of_two () const
 
bool is_neg_overflow () const
 
bool is_uadd_overflow (const BitVector &bv) const
 
bool is_sadd_overflow (const BitVector &bv) const
 
bool is_usub_overflow (const BitVector &bv) const
 
bool is_ssub_overflow (const BitVector &bv) const
 
bool is_umul_overflow (const BitVector &bv) const
 
bool is_smul_overflow (const BitVector &bv) const
 
bool is_sdiv_overflow (const BitVector &bv) const
 
uint64_t count_trailing_zeros () const
 
uint64_t count_trailing_ones () const
 
uint64_t count_leading_zeros () const
 
uint64_t count_leading_ones () const
 
BitVector bvneg () const
 
BitVector bvnot () const
 
BitVector bvinc () const
 
BitVector bvdec () const
 
BitVector bvredand () const
 
BitVector bvredor () const
 
BitVector bvredxor () const
 
BitVector bvnego () const
 
BitVector bvadd (const BitVector &bv) const
 
BitVector bvsub (const BitVector &bv) const
 
BitVector bvand (const BitVector &bv) const
 
BitVector bvimplies (const BitVector &bv) const
 
BitVector bvnand (const BitVector &bv) const
 
BitVector bvnor (const BitVector &bv) const
 
BitVector bvor (const BitVector &bv) const
 
BitVector bvxnor (const BitVector &bv) const
 
BitVector bvxor (const BitVector &bv) const
 
BitVector bveq (const BitVector &bv) const
 
BitVector bvne (const BitVector &bv) const
 
BitVector bvult (const BitVector &bv) const
 
BitVector bvule (const BitVector &bv) const
 
BitVector bvugt (const BitVector &bv) const
 
BitVector bvuge (const BitVector &bv) const
 
BitVector bvslt (const BitVector &bv) const
 
BitVector bvsle (const BitVector &bv) const
 
BitVector bvsgt (const BitVector &bv) const
 
BitVector bvsge (const BitVector &bv) const
 
BitVector bvshl (uint64_t shift) const
 
BitVector bvshl (const BitVector &bv) const
 
BitVector bvshr (uint64_t shift) const
 
BitVector bvshr (const BitVector &bv) const
 
BitVector bvashr (uint64_t shift) const
 
BitVector bvashr (const BitVector &bv) const
 
BitVector bvmul (const BitVector &bv) const
 
BitVector bvudiv (const BitVector &bv) const
 
BitVector bvurem (const BitVector &bv) const
 
BitVector bvsdiv (const BitVector &bv) const
 
BitVector bvsrem (const BitVector &bv) const
 
BitVector bvsmod (const BitVector &bv) const
 
BitVector bvuaddo (const BitVector &bv) const
 
BitVector bvsaddo (const BitVector &bv) const
 
BitVector bvusubo (const BitVector &bv) const
 
BitVector bvssubo (const BitVector &bv) const
 
BitVector bvumulo (const BitVector &bv) const
 
BitVector bvsmulo (const BitVector &bv) const
 
BitVector bvsdivo (const BitVector &bv) const
 
BitVector bvconcat (const BitVector &bv) const
 
BitVector bvextract (uint64_t idx_hi, uint64_t idx_lo) const
 
BitVector bvzext (uint64_t n) const
 
BitVector bvsext (uint64_t n) const
 
BitVector bvrepeat (uint64_t n) const
 
BitVector bvroli (uint64_t n) const
 
BitVector bvrol (const BitVector &n) const
 
BitVector bvrori (uint64_t n) const
 
BitVector bvror (const BitVector &n) const
 
BitVector bvmodinv () const
 
BitVector bvpow (const mpz_t exp) const
 
BitVectoribvneg (const BitVector &bv)
 
BitVectoribvneg ()
 
BitVectoribvnot (const BitVector &bv)
 
BitVectoribvnot ()
 
BitVectoribvinc (const BitVector &bv)
 
BitVectoribvinc ()
 
BitVectoribvdec (const BitVector &bv)
 
BitVectoribvdec ()
 
BitVectoribvredand (const BitVector &bv)
 
BitVectoribvredand ()
 
BitVectoribvredor (const BitVector &bv)
 
BitVectoribvredor ()
 
BitVectoribvredxor (const BitVector &bv)
 
BitVectoribvredxor ()
 
BitVectoribvnego (const BitVector &bv)
 
BitVectoribvnego ()
 
BitVectoribvadd (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvadd (const BitVector &bv)
 
BitVectoribvand (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvand (const BitVector &bv)
 
BitVectoribvimplies (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvimplies (const BitVector &bv)
 
BitVectoribvnand (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvnand (const BitVector &bv)
 
BitVectoribvnor (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvnor (const BitVector &bv)
 
BitVectoribvor (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvor (const BitVector &bv)
 
BitVectoribvsub (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsub (const BitVector &bv)
 
BitVectoribvxnor (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvxnor (const BitVector &bv)
 
BitVectoribvxor (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvxor (const BitVector &bv)
 
BitVectoribveq (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribveq (const BitVector &bv)
 
BitVectoribvne (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvne (const BitVector &bv)
 
BitVectoribvult (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvult (const BitVector &bv)
 
BitVectoribvule (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvule (const BitVector &bv)
 
BitVectoribvugt (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvugt (const BitVector &bv)
 
BitVectoribvuge (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvuge (const BitVector &bv)
 
BitVectoribvslt (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvslt (const BitVector &bv)
 
BitVectoribvsle (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsle (const BitVector &bv)
 
BitVectoribvsgt (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsgt (const BitVector &bv)
 
BitVectoribvsge (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsge (const BitVector &bv)
 
BitVectoribvshl (const BitVector &bv, uint64_t shift)
 
BitVectoribvshl (uint64_t shift)
 
BitVectoribvshl (const BitVector &bv, const BitVector &shift)
 
BitVectoribvshl (const BitVector &bv)
 
BitVectoribvshr (const BitVector &bv, uint64_t shift)
 
BitVectoribvshr (uint64_t shift)
 
BitVectoribvshr (const BitVector &bv, const BitVector &shift)
 
BitVectoribvshr (const BitVector &bv)
 
BitVectoribvashr (const BitVector &bv, uint64_t shift)
 
BitVectoribvashr (uint64_t shift)
 
BitVectoribvashr (const BitVector &bv, const BitVector &arithmetic)
 
BitVectoribvashr (const BitVector &bv)
 
BitVectoribvmul (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvmul (const BitVector &bv)
 
BitVectoribvudiv (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvudiv (const BitVector &bv)
 
BitVectoribvurem (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvurem (const BitVector &bv)
 
BitVectoribvsdiv (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsdiv (const BitVector &bv)
 
BitVectoribvsrem (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsrem (const BitVector &bv)
 
BitVectoribvsmod (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsmod (const BitVector &bv)
 
BitVectoribvuaddo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvuaddo (const BitVector &bv)
 
BitVectoribvsaddo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsaddo (const BitVector &bv)
 
BitVectoribvusubo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvusubo (const BitVector &bv)
 
BitVectoribvssubo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvssubo (const BitVector &bv)
 
BitVectoribvumulo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvumulo (const BitVector &bv)
 
BitVectoribvsmulo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsmulo (const BitVector &bv)
 
BitVectoribvsdivo (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvsdivo (const BitVector &bv)
 
BitVectoribvconcat (const BitVector &bv0, const BitVector &bv1)
 
BitVectoribvconcat (const BitVector &bv)
 
BitVectoribvextract (const BitVector &bv, uint64_t idx_hi, uint64_t idx_lo)
 
BitVectoribvextract (uint64_t idx_hi, uint64_t idx_lo)
 
BitVectoribvzext (const BitVector &bv, uint64_t n)
 
BitVectoribvzext (uint64_t n)
 
BitVectoribvsext (const BitVector &bv, uint64_t n)
 
BitVectoribvsext (uint64_t n)
 
BitVectoribvrepeat (const BitVector &bv, uint64_t n)
 
BitVectoribvrepeat (uint64_t n)
 
BitVectoribvroli (const BitVector &bv, uint64_t n)
 
BitVectoribvroli (uint64_t n)
 
BitVectoribvrori (const BitVector &bv, uint64_t n)
 
BitVectoribvrori (uint64_t n)
 
BitVectoribvrol (const BitVector &bv, const BitVector &n)
 
BitVectoribvrol (const BitVector &n)
 
BitVectoribvror (const BitVector &bv, const BitVector &n)
 
BitVectoribvror (const BitVector &n)
 
BitVectoribvite (const BitVector &c, const BitVector &t, const BitVector &e)
 
BitVectoribvmodinv (const BitVector &bv)
 
BitVectoribvmodinv ()
 
BitVectoribvpow (const BitVector &base, const mpz_t exp)
 
BitVectoribvpow (const mpz_t exp)
 
void bvudivurem (const BitVector &bv, BitVector *quot, BitVector *rem) const
 
const mpz_tgmp_value () const
 
mpz_class to_mpz () const
 

Static Public Member Functions

static bool fits_in_size (uint64_t size, const std::string &str, uint32_t base)
 
static bool fits_in_size (uint64_t size, uint64_t value, bool sign=false)
 
static bool fits_in_size (uint64_t size, const mpz_t value)
 
static BitVector from_ui (uint64_t size, uint64_t value, bool truncate=false)
 
static BitVector from_si (uint64_t size, int64_t value, bool truncate=false)
 
static BitVector mk_true ()
 
static BitVector mk_false ()
 
static BitVector mk_zero (uint64_t size)
 
static BitVector mk_one (uint64_t size)
 
static BitVector mk_ones (uint64_t size)
 
static BitVector mk_min_signed (uint64_t size)
 
static BitVector mk_max_signed (uint64_t size)
 
static BitVector bvite (const BitVector &c, const BitVector &t, const BitVector &e)
 

Static Public Attributes

static constexpr size_t s_native_size = sizeof(unsigned long) * 8
 

Private Member Functions

uint64_t count_leading (bool zeros) const
 
bool shift_is_uint64 (uint64_t *res) const
 
uint64_t get_limb (void *limb, uint64_t nbits_rem, bool zeros) const
 
bool is_gmp () const
 

Static Private Member Functions

static uint64_t uint64_fdiv_r_2exp (uint64_t size, uint64_t val)
 

Private Attributes

uint64_t d_size = 0
 
union { 
 
   uint64_t   d_val_uint64 
 
   mpz_t   d_val_gmp 
 
};  
 

Detailed Description

Definition at line 27 of file bitvector.h.

Constructor & Destructor Documentation

◆ BitVector() [1/6]

◆ BitVector() [2/6]

stabilizer::util::BitVector::BitVector ( uint64_t  size)

Construct a zero bit-vector of given size.

Parameters
sizeThe size of the bit-vector.

Definition at line 164 of file bitvector.cpp.

References d_val_gmp, hash(), is_gmp(), and size().

◆ BitVector() [3/6]

stabilizer::util::BitVector::BitVector ( uint64_t  size,
const std::string &  value,
uint32_t  base = 2 
)

Construct a bit-vector of given size from given binary string.

Parameters
sizeThe size of the bit-vector, must be >= the length of value.
valueA string representing the value of the bit-vector. If the length of this string is > size, the value is zero extended.
baseThe base the string is given in (2 for binary, 10 for decimal, 16 for hexadecimal).

Definition at line 171 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, fits_in_size(), hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

◆ BitVector() [4/6]

stabilizer::util::BitVector::BitVector ( uint64_t  size,
const mpz_t  value,
bool  truncate = false 
)

Construct a bit-vector of given size from given GMP value.

Parameters
sizeThe size of the bit-vector.
valueA GMP value representing the bit-vector value. The value must be representable with size bits if truncate is false.
truncateTrue to allow truncating the value if it is not representable with size bits.

Definition at line 192 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, fits_in_size(), hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), and size().

◆ BitVector() [5/6]

stabilizer::util::BitVector::BitVector ( const BitVector other)

Copy constructor.

Definition at line 246 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

◆ BitVector() [6/6]

stabilizer::util::BitVector::BitVector ( BitVector &&  other)

Move constructor.

Definition at line 264 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

◆ ~BitVector()

stabilizer::util::BitVector::~BitVector ( )

Destructor.

Definition at line 287 of file bitvector.cpp.

References d_val_gmp, hash(), and is_gmp().

Member Function Documentation

◆ bit()

bool stabilizer::util::BitVector::bit ( uint64_t  idx) const

Determine the value of the bit at given index.

Parameters
idxThe index of the bit.
Returns
True if the bit at given index is 1, and false otherwise.

Definition at line 472 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, hash(), is_gmp(), is_null(), and size().

Referenced by count_trailing_ones(), count_trailing_zeros(), flip_bit(), is_false(), is_true(), lsb(), and msb().

◆ bvadd()

BitVector stabilizer::util::BitVector::bvadd ( const BitVector bv) const

Create a bit-vector representing the addition of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the addition.

Definition at line 781 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvadd().

Referenced by is_sadd_overflow().

◆ bvand()

BitVector stabilizer::util::BitVector::bvand ( const BitVector bv) const

Create a bit-vector representing the bit-wise and of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise and.

Definition at line 789 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvand().

◆ bvashr() [1/2]

BitVector stabilizer::util::BitVector::bvashr ( const BitVector bv) const

Create a bit-vector representing the arithmetic right shift of this bit-vector by the given bit-vector shift value.

Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the right.
Returns
A bit-vector representing the result of the arithmetic right shift.

Definition at line 877 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvashr().

◆ bvashr() [2/2]

BitVector stabilizer::util::BitVector::bvashr ( uint64_t  shift) const

Create a bit-vector representing the arithmetic right shift of this bit-vector by the given unsigned integer shift value.

Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the right.
Returns
A bit-vector representing the result of the arithmetic right shift.

Definition at line 873 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvashr().

◆ bvconcat()

BitVector stabilizer::util::BitVector::bvconcat ( const BitVector bv) const

Create a bit-vector representing the concatenation of this bit-vector and the given bit-vector. The given bit-vector is concatenated (at the right, the lsb side) to this bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the concatenation.

Definition at line 933 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvconcat().

◆ bvdec()

BitVector stabilizer::util::BitVector::bvdec ( ) const

Create a bit-vector representing the decrement (- 1) of this bit-vector.

Returns
The decrement of this bit-vector.

Definition at line 771 of file bitvector.cpp.

References BitVector(), d_size, and ibvdec().

Referenced by is_power_of_two().

◆ bveq()

BitVector stabilizer::util::BitVector::bveq ( const BitVector bv) const

Create a bit-vector representing the equality of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the equality.

Definition at line 817 of file bitvector.cpp.

References BitVector(), hash(), and ibveq().

◆ bvextract()

BitVector stabilizer::util::BitVector::bvextract ( uint64_t  idx_hi,
uint64_t  idx_lo 
) const

Create a bit-vector representing the extract of a given bit range from this bit-vector.

Parameters
idx_hiThe upper bit-index of the range (inclusive).
idx_loThe lower bit-index of the range (inclusive).
Returns
A bit-vector representing the extracted bit range.

Definition at line 937 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvextract().

Referenced by shift_is_uint64().

◆ bvimplies()

BitVector stabilizer::util::BitVector::bvimplies ( const BitVector bv) const

Create a bit-vector representing the implication of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the implication.

Definition at line 793 of file bitvector.cpp.

References BitVector(), hash(), and ibvimplies().

◆ bvinc()

BitVector stabilizer::util::BitVector::bvinc ( ) const

Create a bit-vector representing the increment (+ 1) of this bit-vector.

Returns
The increment of this bit-vector.

Definition at line 769 of file bitvector.cpp.

References BitVector(), d_size, and ibvinc().

◆ bvite()

BitVector stabilizer::util::BitVector::bvite ( const BitVector c,
const BitVector t,
const BitVector e 
)
static

Create an if-then-else (ite) over the given bit-vectors.

Parameters
cA bit-vector representing the condition of the ite.
tA bit-vector representing the then branch of the ite.
eA bit-vector representing the else branch of the ite.
Returns
A bit-vector representing the ite.

Definition at line 153 of file bitvector.cpp.

References d_size, hash(), and is_null().

◆ bvmodinv()

BitVector stabilizer::util::BitVector::bvmodinv ( ) const

Calculate modular inverse for this bit-vector by means of the Extended Euclidean Algorithm.

Note
Bit-vector must be odd. The greatest common divisor gcd (c, 2^bw) must be (and is, in this case) always 1.
Returns
A bit-vector representing the modular inverse of this bit-vector.

Definition at line 969 of file bitvector.cpp.

References BitVector(), d_size, and ibvmodinv().

◆ bvmul()

BitVector stabilizer::util::BitVector::bvmul ( const BitVector bv) const

Create a bit-vector representing the multiplication of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the multiplication.

Definition at line 881 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvmul().

◆ bvnand()

BitVector stabilizer::util::BitVector::bvnand ( const BitVector bv) const

Create a bit-vector representing the bit-wise nand of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise nand.

Definition at line 797 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvnand().

◆ bvne()

BitVector stabilizer::util::BitVector::bvne ( const BitVector bv) const

Create a bit-vector representing the disequality of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the disequality.

Definition at line 821 of file bitvector.cpp.

References BitVector(), hash(), and ibvne().

◆ bvneg()

BitVector stabilizer::util::BitVector::bvneg ( ) const

Create a bit-vector representing the two's complement negation of this bit-vector.

Returns
The two's complement of this bit-vector.

Definition at line 765 of file bitvector.cpp.

References BitVector(), d_size, and ibvneg().

◆ bvnego()

BitVector stabilizer::util::BitVector::bvnego ( ) const

Create a bit-vector representing a predicate that indicates if bit-vector negation produces an overflow.

Returns
A bit-vector of size 1, representing the result of the overflow check.

Definition at line 779 of file bitvector.cpp.

References BitVector(), and ibvnego().

◆ bvnor()

BitVector stabilizer::util::BitVector::bvnor ( const BitVector bv) const

Create a bit-vector representing the bit-wise nor of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise nor.

Definition at line 801 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvnor().

◆ bvnot()

BitVector stabilizer::util::BitVector::bvnot ( ) const

Create a bit-vector representing the bit-wise negation of this bit-vector.

Returns
The bit-wise negation of this bit-vector.

Definition at line 767 of file bitvector.cpp.

References BitVector(), d_size, and ibvnot().

◆ bvor()

BitVector stabilizer::util::BitVector::bvor ( const BitVector bv) const

Create a bit-vector representing the bit-wise or of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise or.

Definition at line 805 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvor().

◆ bvpow()

BitVector stabilizer::util::BitVector::bvpow ( const mpz_t  exp) const

Calculate a bit-vector representing this bit-vector exponentiated by exp.

Parameters
expThe exponent GMP value.
Returns
A bit-vector representing the result of the exponentiation.

Definition at line 973 of file bitvector.cpp.

References BitVector(), d_size, and ibvpow().

◆ bvredand()

BitVector stabilizer::util::BitVector::bvredand ( ) const

Create a bit-vector representing the and reduction of this bit-vector.

Returns
A bit-vector of size 1, representing the result of the and reduction of this bit-vector (1 if all bits of this bit-vector are one, and 0 otherwise).

Definition at line 773 of file bitvector.cpp.

References BitVector(), and ibvredand().

◆ bvredor()

BitVector stabilizer::util::BitVector::bvredor ( ) const

Create a bit-vector representing the or reduction of this bit-vector.

Returns
A bit-vector of size 1, representing the result of the or reduction of this bit-vector (1 if at least one bit of this bit-vector is one, and 0 otherwise).

Definition at line 775 of file bitvector.cpp.

References BitVector(), and ibvredor().

◆ bvredxor()

BitVector stabilizer::util::BitVector::bvredxor ( ) const

Create a bit-vector representing the xor reduction of this bit-vector.

Returns
A bit-vector of size 1, representing the result of the xor reduction of this bit-vector (1 if an uneven number of bits is set to 1, and 0 otherwise).

Definition at line 777 of file bitvector.cpp.

References BitVector(), and ibvredxor().

◆ bvrepeat()

BitVector stabilizer::util::BitVector::bvrepeat ( uint64_t  n) const

Create a bit-vector representing this bit-vector repeated n times.

Parameters
nThe number of times to repeat this bit-vector, must be > 0.
Returns
A bit-vector representing the result of the repeat operation.

Definition at line 949 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvrepeat().

◆ bvrol()

BitVector stabilizer::util::BitVector::bvrol ( const BitVector n) const

Create a bit-vector representing this bit-vector rotated left by n bits.

Parameters
nThe number of bits to rotate this bit-vector by.
Returns
A bit-vector representing the result of the rotation.

Definition at line 957 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvrol().

◆ bvroli()

BitVector stabilizer::util::BitVector::bvroli ( uint64_t  n) const

Create a bit-vector representing this bit-vector rotated left by n bits.

Parameters
nThe number of bits to rotate this bit-vector by.
Returns
A bit-vector representing the result of the rotation.

Definition at line 953 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvroli().

◆ bvror()

BitVector stabilizer::util::BitVector::bvror ( const BitVector n) const

Create a bit-vector representing this bit-vector rotated right by n bits.

Parameters
nThe number of bits to rotate this bit-vector by.
Returns
A bit-vector representing the result of the rotation.

Definition at line 965 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvror().

◆ bvrori()

BitVector stabilizer::util::BitVector::bvrori ( uint64_t  n) const

Create a bit-vector representing this bit-vector rotated right by n bits.

Parameters
nThe number of bits to rotate this bit-vector by.
Returns
A bit-vector representing the result of the rotation.

Definition at line 961 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvrori().

◆ bvsaddo()

BitVector stabilizer::util::BitVector::bvsaddo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector signed addition produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 909 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsaddo().

◆ bvsdiv()

BitVector stabilizer::util::BitVector::bvsdiv ( const BitVector bv) const

Create a bit-vector representing the signed division of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed division.

Definition at line 893 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsdiv().

◆ bvsdivo()

BitVector stabilizer::util::BitVector::bvsdivo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector signed division produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 929 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsdivo().

◆ bvsext()

BitVector stabilizer::util::BitVector::bvsext ( uint64_t  n) const

Create a bit-vector representing the sign extension of this bit-vector by the given number of bits.

Parameters
nThe number of bits to extend this bit-vector with.
Returns
A bit-vector representing the sign extension.

Definition at line 945 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsext().

Referenced by is_smul_overflow().

◆ bvsge()

BitVector stabilizer::util::BitVector::bvsge ( const BitVector bv) const

Create a bit-vector representing the signed greater than or equal of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed greater than or equal.

Definition at line 853 of file bitvector.cpp.

References BitVector(), hash(), and ibvsge().

◆ bvsgt()

BitVector stabilizer::util::BitVector::bvsgt ( const BitVector bv) const

Create a bit-vector representing the signed greater than of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed greater than.

Definition at line 849 of file bitvector.cpp.

References BitVector(), hash(), and ibvsgt().

◆ bvshl() [1/2]

BitVector stabilizer::util::BitVector::bvshl ( const BitVector bv) const

Create a bit-vector representing the logical left shift of this bit-vector by the given bit-vector shift value.

Parameters
shiftA bit-vector representing he number of bits to shift this bit-vector to the left.
Returns
A bit-vector representing the result of the logical left shift.

Definition at line 861 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvshl().

◆ bvshl() [2/2]

BitVector stabilizer::util::BitVector::bvshl ( uint64_t  shift) const

Create a bit-vector representing the logical left shift of this bit-vector by the given unsigned integer shift value.

Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the left.
Returns
A bit-vector representing the result of the logical left shift.

Definition at line 857 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvshl().

◆ bvshr() [1/2]

BitVector stabilizer::util::BitVector::bvshr ( const BitVector bv) const

Create a bit-vector representing the logical right shift of this bit-vector by the given bit-vector shift value.

Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the right.
Returns
A bit-vector representing the result of the logical right shift.

Definition at line 869 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvshr().

◆ bvshr() [2/2]

BitVector stabilizer::util::BitVector::bvshr ( uint64_t  shift) const

Create a bit-vector representing the logical right shift of this bit-vector by the given unsigned integer shift value.

Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the right.
Returns
A bit-vector representing the result of the logical right shift.

Definition at line 865 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvshr().

◆ bvsle()

BitVector stabilizer::util::BitVector::bvsle ( const BitVector bv) const

Create a bit-vector representing the signed less than or equal of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed less than or equal.

Definition at line 845 of file bitvector.cpp.

References BitVector(), hash(), and ibvsle().

◆ bvslt()

BitVector stabilizer::util::BitVector::bvslt ( const BitVector bv) const

Create a bit-vector representing the signed less than of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed less than.

Definition at line 841 of file bitvector.cpp.

References BitVector(), hash(), and ibvslt().

◆ bvsmod()

BitVector stabilizer::util::BitVector::bvsmod ( const BitVector bv) const

Create a bit-vector representing the signed remainder (sign follows divisor) of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed remainder.

Definition at line 901 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsmod().

◆ bvsmulo()

BitVector stabilizer::util::BitVector::bvsmulo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector signed multiplication produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 925 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsmulo().

◆ bvsrem()

BitVector stabilizer::util::BitVector::bvsrem ( const BitVector bv) const

Create a bit-vector representing the signed remainder (sign follows dividend) of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the signed remainder.

Definition at line 897 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsrem().

◆ bvssubo()

BitVector stabilizer::util::BitVector::bvssubo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector signed subtraction produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 917 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvssubo().

◆ bvsub()

BitVector stabilizer::util::BitVector::bvsub ( const BitVector bv) const

Create a bit-vector representing the subtraction of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the subtraction.

Definition at line 785 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvsub().

Referenced by is_ssub_overflow().

◆ bvuaddo()

BitVector stabilizer::util::BitVector::bvuaddo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector unsigned addition produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 905 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvuaddo().

◆ bvudiv()

BitVector stabilizer::util::BitVector::bvudiv ( const BitVector bv) const

Create a bit-vector representing the unsigned division of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned division.

Definition at line 885 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvudiv().

◆ bvudivurem()

void stabilizer::util::BitVector::bvudivurem ( const BitVector bv,
BitVector quot,
BitVector rem 
) const

Merged bit-vector operations. --------------------------------------— Calculate the unsigned division and remainder of this bit-vector with bv. The result of the division is stored in quot, and the result of the remainder operation is stored in rem.

Parameters
bvThe bit-vector to divide by.
quotThe bit-vector to store the result of the division in.
remThe bit-vector to store the result of the remainder in.

Definition at line 2910 of file bitvector.cpp.

References d_size, d_val_uint64, from_ui(), hash(), is_gmp(), is_null(), mk_ones(), mk_zero(), and stabilizer::util::mpz_fdiv_r_2exp_ull().

Referenced by ibvmodinv().

◆ bvuge()

BitVector stabilizer::util::BitVector::bvuge ( const BitVector bv) const

Create a bit-vector representing the unsigned greater than or equal of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned greater than or equal.

Definition at line 837 of file bitvector.cpp.

References BitVector(), hash(), and ibvuge().

◆ bvugt()

BitVector stabilizer::util::BitVector::bvugt ( const BitVector bv) const

Create a bit-vector representing the unsigned greater than of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned greater than.

Definition at line 833 of file bitvector.cpp.

References BitVector(), hash(), and ibvugt().

◆ bvule()

BitVector stabilizer::util::BitVector::bvule ( const BitVector bv) const

Create a bit-vector representing the unsigned less than or equal of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned less than or equal.

Definition at line 829 of file bitvector.cpp.

References BitVector(), hash(), and ibvule().

◆ bvult()

BitVector stabilizer::util::BitVector::bvult ( const BitVector bv) const

Create a bit-vector representing the unsigned less than of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned less than.

Definition at line 825 of file bitvector.cpp.

References BitVector(), hash(), and ibvult().

◆ bvumulo()

BitVector stabilizer::util::BitVector::bvumulo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector unsigned multiplication produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 921 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvumulo().

◆ bvurem()

BitVector stabilizer::util::BitVector::bvurem ( const BitVector bv) const

Create a bit-vector representing the unsigned remainder of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the unsigned remainder.

Definition at line 889 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvurem().

Referenced by ibvrol(), and ibvror().

◆ bvusubo()

BitVector stabilizer::util::BitVector::bvusubo ( const BitVector bv) const

Create a bit-vector representing a predicate that indicates if bit-vector unsigned subtraction produces an overflow.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the overflow check.

Definition at line 913 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvusubo().

◆ bvxnor()

BitVector stabilizer::util::BitVector::bvxnor ( const BitVector bv) const

Create a bit-vector representing the bit-wise xnor of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise xnor.

Definition at line 809 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvxnor().

◆ bvxor()

BitVector stabilizer::util::BitVector::bvxor ( const BitVector bv) const

Create a bit-vector representing the bit-wise xor of this bit-vector and the given bit-vector.

Parameters
bvThe other bit-vector.
Returns
A bit-vector representing the result of the bit-wise xor.

Definition at line 813 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvxor().

◆ bvzext()

BitVector stabilizer::util::BitVector::bvzext ( uint64_t  n) const

Create a bit-vector representing the zero extension of this bit-vector by the given number of bits.

Parameters
nThe number of bits to extend this bit-vector with.
Returns
A bit-vector representing the zero extension.

Definition at line 941 of file bitvector.cpp.

References BitVector(), d_size, hash(), and ibvzext().

◆ compare()

int32_t stabilizer::util::BitVector::compare ( const BitVector bv) const

Compare this bit-vector with given bit-vector (unsigned).

Parameters
bvThe bit-vector to compare this bit-vector with.
Returns
0 if the bit-vectors are equal, -1 if their sizes don't match or if this is unsigned less than bv, and 1 if this is unsigned greater than bv.

Definition at line 431 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by is_usub_overflow(), operator!=(), operator==(), and signed_compare().

◆ count_leading()

uint64_t stabilizer::util::BitVector::count_leading ( bool  zeros) const
private

Count leading zeros or ones.

Parameters
zerosTrue to determine number of leading zeros, false to count number of leading ones.
Returns
The number of leading zeros/ones.

Definition at line 2980 of file bitvector.cpp.

References d_size, get_limb(), hash(), and is_null().

Referenced by count_leading_ones(), and count_leading_zeros().

◆ count_leading_ones()

uint64_t stabilizer::util::BitVector::count_leading_ones ( ) const
Returns
The number of leading ones (counted from msb).

Definition at line 756 of file bitvector.cpp.

References count_leading(), and is_null().

◆ count_leading_zeros()

uint64_t stabilizer::util::BitVector::count_leading_zeros ( ) const
Returns
The number of leading zeros (counted from msb).

Definition at line 751 of file bitvector.cpp.

References count_leading(), and is_null().

Referenced by shift_is_uint64().

◆ count_trailing_ones()

uint64_t stabilizer::util::BitVector::count_trailing_ones ( ) const
Returns
The number of trailing ones (counted from lsb).

Definition at line 733 of file bitvector.cpp.

References bit(), d_size, d_val_gmp, hash(), is_gmp(), and is_null().

◆ count_trailing_zeros()

uint64_t stabilizer::util::BitVector::count_trailing_zeros ( ) const
Returns
The number of trailing zeros (counted from lsb).

Definition at line 715 of file bitvector.cpp.

References bit(), d_size, d_val_gmp, hash(), is_gmp(), and is_null().

◆ fits_in_size() [1/3]

bool stabilizer::util::BitVector::fits_in_size ( uint64_t  size,
const mpz_t  value 
)
static

Determine if given GMP value fits into a bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
valueThe GMP value.
Returns
True if given value fits into a bit-vector of given size.

Definition at line 116 of file bitvector.cpp.

References hash(), and size().

◆ fits_in_size() [2/3]

bool stabilizer::util::BitVector::fits_in_size ( uint64_t  size,
const std::string &  str,
uint32_t  base 
)
static

Determine if given string representation of a value in the given numeric base fits into a bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
strThe string represent of the value.
baseThe numeric base the value is given in.
Returns
True if string in base fits into a bit-vector of given size.

Definition at line 73 of file bitvector.cpp.

References hash(), mk_min_signed(), mk_ones(), size(), and str().

Referenced by BitVector(), BitVector(), fits_in_size(), from_si(), from_ui(), and to_uint64().

◆ fits_in_size() [3/3]

bool stabilizer::util::BitVector::fits_in_size ( uint64_t  size,
uint64_t  value,
bool  sign = false 
)
static

Determine if given integer value fits into a bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
valueThe integer value.
signTrue if given value is to be interpreted as signed.
Returns
True if given value fits into a bit-vector of given size.

Definition at line 104 of file bitvector.cpp.

References fits_in_size(), hash(), stabilizer::util::mpz_init_set_ull(), and size().

◆ flip_bit()

void stabilizer::util::BitVector::flip_bit ( uint64_t  idx)

Flip the bit at given index (in-place).

Parameters
idxThe index of the bit.

Definition at line 502 of file bitvector.cpp.

References bit(), d_val_gmp, hash(), is_gmp(), is_null(), and set_bit().

◆ from_si()

BitVector stabilizer::util::BitVector::from_si ( uint64_t  size,
int64_t  value,
bool  truncate = false 
)
static

Construct a bit-vector of given size from given int64 value.

Truncates value if truncate is true and the value cannot be represented with size bits.

Note
For signed values, always use this function. It guarantees that negative values are sign extended to size if size > 64, which is not the case with from_ui() (which zero extends the value).
Parameters
sizeThe size of the bit-vector.
valueA int64 representing the bit-vector value. The value must be representable with size bits if truncate is false.
truncateTrue to allow truncating the value if it is not representable with size bits.

Definition at line 230 of file bitvector.cpp.

References fits_in_size(), hash(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_init_set_sll(), size(), and uint64_fdiv_r_2exp().

◆ from_ui()

BitVector stabilizer::util::BitVector::from_ui ( uint64_t  size,
uint64_t  value,
bool  truncate = false 
)
static

Construct a bit-vector of given size from given uint64 value.

Truncates value if truncate is true and the value cannot be represented with size bits.

Note
For signed values, use from_si() instead. It guarantees that negative values are sign extended to size if size > 64, which is not the case with from_ui() (which zero extends the value).
Parameters
sizeThe size of the bit-vector.
valueA uint64 representing the bit-vector value. The value must be representable with size bits if truncate is false.
truncateTrue to allow truncating the value if it is not representable with size bits.

Definition at line 214 of file bitvector.cpp.

References fits_in_size(), hash(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_init_set_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvudivurem(), ibvrol(), ibvror(), and mk_one().

◆ get_limb()

uint64_t stabilizer::util::BitVector::get_limb ( void limb,
uint64_t  nbits_rem,
bool  zeros 
) const
private

Get the first limb and return the number of limbs needed to represent this bit-vector if all zero limbs are disregarded.

Parameters
limbThe result pointer for the first limb.
nbits_remThe number of bits that spill over into the most significant limb, assuming that all bits are represented). Zero if the bit-width is a multiple of n_bits_per_limb.
zerosTrue for leading zeros, else ones.
Returns
The number of limbs needed to represent this bit-vector.

Definition at line 3011 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by count_leading().

◆ gmp_value()

const mpz_t & stabilizer::util::BitVector::gmp_value ( ) const

Get mpz_t value from Integer class.

Definition at line 2957 of file bitvector.cpp.

References d_val_gmp, and is_gmp().

◆ hash()

size_t stabilizer::util::BitVector::hash ( ) const
Returns
The hash value of this bit-vector.

Definition at line 326 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and stabilizer::util::mpz_hash().

Referenced by bit(), BitVector(), BitVector(), BitVector(), BitVector(), BitVector(), bvadd(), bvand(), bvashr(), bvashr(), bvconcat(), bveq(), bvextract(), bvimplies(), bvite(), bvmul(), bvnand(), bvne(), bvnor(), bvor(), bvrepeat(), bvrol(), bvroli(), bvror(), bvrori(), bvsaddo(), bvsdiv(), bvsdivo(), bvsext(), bvsge(), bvsgt(), bvshl(), bvshl(), bvshr(), bvshr(), bvsle(), bvslt(), bvsmod(), bvsmulo(), bvsrem(), bvssubo(), bvsub(), bvuaddo(), bvudiv(), bvudivurem(), bvuge(), bvugt(), bvule(), bvult(), bvumulo(), bvurem(), bvusubo(), bvxnor(), bvxor(), bvzext(), compare(), count_leading(), count_trailing_ones(), count_trailing_zeros(), fits_in_size(), fits_in_size(), fits_in_size(), flip_bit(), from_si(), from_ui(), get_limb(), hash(), ibvadd(), ibvadd(), ibvand(), ibvand(), ibvashr(), ibvashr(), ibvashr(), ibvashr(), ibvconcat(), ibvconcat(), ibvdec(), ibveq(), ibveq(), ibvextract(), ibvextract(), ibvimplies(), ibvimplies(), ibvinc(), ibvite(), ibvmodinv(), ibvmul(), ibvmul(), ibvnand(), ibvnand(), ibvne(), ibvne(), ibvneg(), ibvnego(), ibvnor(), ibvnor(), ibvnot(), ibvor(), ibvor(), ibvpow(), ibvredand(), ibvredor(), ibvredxor(), ibvrepeat(), ibvrepeat(), ibvrol(), ibvrol(), ibvroli(), ibvroli(), ibvror(), ibvror(), ibvrori(), ibvrori(), ibvsaddo(), ibvsaddo(), ibvsdiv(), ibvsdiv(), ibvsdivo(), ibvsdivo(), ibvsext(), ibvsext(), ibvsge(), ibvsge(), ibvsgt(), ibvsgt(), ibvshl(), ibvshl(), ibvshl(), ibvshl(), ibvshr(), ibvshr(), ibvshr(), ibvshr(), ibvsle(), ibvsle(), ibvslt(), ibvslt(), ibvsmod(), ibvsmod(), ibvsmulo(), ibvsmulo(), ibvsrem(), ibvsrem(), ibvssubo(), ibvssubo(), ibvsub(), ibvsub(), ibvuaddo(), ibvuaddo(), ibvudiv(), ibvudiv(), ibvuge(), ibvuge(), ibvugt(), ibvugt(), ibvule(), ibvule(), ibvult(), ibvult(), ibvumulo(), ibvumulo(), ibvurem(), ibvurem(), ibvusubo(), ibvusubo(), ibvxnor(), ibvxnor(), ibvxor(), ibvxor(), ibvzext(), ibvzext(), is_max_signed(), is_min_signed(), is_one(), is_ones(), is_sadd_overflow(), is_sdiv_overflow(), is_smul_overflow(), is_ssub_overflow(), is_uadd_overflow(), is_umul_overflow(), is_usub_overflow(), is_zero(), iset(), mk_max_signed(), mk_min_signed(), mk_ones(), operator!=(), operator=(), operator==(), set_bit(), shift_is_uint64(), signed_compare(), str(), to_mpz(), to_uint64(), uint64_fdiv_r_2exp(), and ~BitVector().

◆ ibvadd() [1/2]

BitVector & stabilizer::util::BitVector::ibvadd ( const BitVector bv)

Addition (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the addition of this and the given bit-vector.

Definition at line 2643 of file bitvector.cpp.

References hash(), and ibvadd().

◆ ibvadd() [2/2]

BitVector & stabilizer::util::BitVector::ibvadd ( const BitVector bv0,
const BitVector bv1 
)

Addition (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the addition.
bv1The second operand of the addition.
Returns
A reference to this bit-vector, overwritten with the result of the addition of the given bit-vectors.

Definition at line 1128 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvadd(), stabilizer::parser::BitVectorUtils::bvAdd(), ibvadd(), ibvroli(), ibvrori(), and ibvsmod().

◆ ibvand() [1/2]

BitVector & stabilizer::util::BitVector::ibvand ( const BitVector bv)

Bit-wise and (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise and of this and the given bit-vector.

Definition at line 2648 of file bitvector.cpp.

References hash(), and ibvand().

◆ ibvand() [2/2]

BitVector & stabilizer::util::BitVector::ibvand ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise and (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise and.
bv1The second operand of the bit-wise and.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise and of the given bit-vectors.

Definition at line 1178 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvand(), ibvand(), and is_power_of_two().

◆ ibvashr() [1/4]

BitVector & stabilizer::util::BitVector::ibvashr ( const BitVector bv)

Arithmetic right shift (in-place) of this bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the right.
Returns
A reference to this bit-vector, overwritten with the result of the arithmetic right shift.

Definition at line 2763 of file bitvector.cpp.

References hash(), and ibvashr().

◆ ibvashr() [2/4]

BitVector & stabilizer::util::BitVector::ibvashr ( const BitVector bv,
const BitVector arithmetic 
)

Arithmetic right shift (in-place) of the given bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftThe bit-vector representing the number of bits to shift bv.
Returns
A reference to this bit-vector, overwritten with the result of the arithmetic right shift.

Definition at line 1696 of file bitvector.cpp.

References hash(), ibvnot(), and ibvshr().

◆ ibvashr() [3/4]

BitVector & stabilizer::util::BitVector::ibvashr ( const BitVector bv,
uint64_t  shift 
)

Arithmetic right shift (in-place) of the given bit-vector by the given unsigned integer shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftThe bit-vector representing the number of bits to shift bv.
Returns
A reference to this bit-vector, overwritten with the result of the arithmetic right shift.

Definition at line 1684 of file bitvector.cpp.

References hash(), ibvnot(), ibvnot(), and ibvshr().

Referenced by bvashr(), stabilizer::parser::BitVectorUtils::bvAshr(), bvashr(), ibvashr(), and ibvashr().

◆ ibvashr() [4/4]

BitVector & stabilizer::util::BitVector::ibvashr ( uint64_t  shift)

Arithmetic right shift (in-place) of this bit-vector by the given unsigned integer shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the right.
Returns
A reference to this bit-vector, overwritten with the result of the arithmetic right shift.

Definition at line 2758 of file bitvector.cpp.

References hash(), and ibvashr().

◆ ibvconcat() [1/2]

BitVector & stabilizer::util::BitVector::ibvconcat ( const BitVector bv)

Concatenation (in-place) of this bit-vector and the given bit-vector. Bit-vector bv is concatenated (at the right, the lsb side) to this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the concatenation of this and the given bit-vector.

Definition at line 2833 of file bitvector.cpp.

References hash(), and ibvconcat().

◆ ibvconcat() [2/2]

BitVector & stabilizer::util::BitVector::ibvconcat ( const BitVector bv0,
const BitVector bv1 
)

Concatenation (in-place) of the given bit-vectors. Bit-vector bv1 is concatenated (at the right, the lsb side) to bv0.

Parameters
bv0The first operand of the concatenation.
bv1The second operand of the concatenation.
Returns
A reference to this bit-vector, overwritten with the result of the concatenation of the given bit-vectors.

Definition at line 2026 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_mul_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvconcat(), and ibvconcat().

◆ ibvdec() [1/2]

BitVector & stabilizer::util::BitVector::ibvdec ( )

Decrement (in-place, chainable) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the decrement of this bit-vector.

Definition at line 2618 of file bitvector.cpp.

References ibvdec().

Referenced by ibvdec().

◆ ibvdec() [2/2]

BitVector & stabilizer::util::BitVector::ibvdec ( const BitVector bv)

Decrement (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the decrement for.
Returns
A reference to this bit-vector, overwritten with the result of the decrement of bv.

Definition at line 1041 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvdec().

◆ ibveq() [1/2]

BitVector & stabilizer::util::BitVector::ibveq ( const BitVector bv)

Equality (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the equality of this and the given bit-vector.

Definition at line 2688 of file bitvector.cpp.

References hash(), and ibveq().

◆ ibveq() [2/2]

BitVector & stabilizer::util::BitVector::ibveq ( const BitVector bv0,
const BitVector bv1 
)

Equality (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the equality.
bv1The second operand of the equality.
Returns
A reference to this bit-vector, overwritten with the result of the equality of the given bit-vectors.

Definition at line 1347 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bveq(), and ibveq().

◆ ibvextract() [1/2]

BitVector & stabilizer::util::BitVector::ibvextract ( const BitVector bv,
uint64_t  idx_hi,
uint64_t  idx_lo 
)

Extract a bit range from bit-vector bv (in-place).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to extract a bit range from.
idx_hiThe upper bit-index of the range (inclusive).
idx_loThe lower bit-index of the range (inclusive).
Returns
A reference to this bit-vector, overwritten with the extracted bit range.

Definition at line 2080 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_q_2exp_ull(), stabilizer::util::mpz_fdiv_r_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvextract(), and ibvextract().

◆ ibvextract() [2/2]

BitVector & stabilizer::util::BitVector::ibvextract ( uint64_t  idx_hi,
uint64_t  idx_lo 
)

Extract a bit range from this bit-vector (in-place).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
idx_hiThe upper bit-index of the range (inclusive).
idx_loThe lower bit-index of the range (inclusive).
Returns
A reference to this bit-vector, overwritten with the extracted bit range.

Definition at line 2838 of file bitvector.cpp.

References hash(), and ibvextract().

◆ ibvimplies() [1/2]

BitVector & stabilizer::util::BitVector::ibvimplies ( const BitVector bv)

Implication (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the implication of this and the given bit-vector.

Definition at line 2653 of file bitvector.cpp.

References hash(), and ibvimplies().

◆ ibvimplies() [2/2]

BitVector & stabilizer::util::BitVector::ibvimplies ( const BitVector bv0,
const BitVector bv1 
)

Implication (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the implication.
bv1The second operand of the implication.
Returns
A reference to this bit-vector, overwritten with the result of the implication of the given bit-vectors.

Definition at line 1203 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvimplies(), and ibvimplies().

◆ ibvinc() [1/2]

BitVector & stabilizer::util::BitVector::ibvinc ( )

Increment (in-place, chainable) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the increment of this bit-vector.

Definition at line 2613 of file bitvector.cpp.

References ibvinc().

Referenced by ibvinc().

◆ ibvinc() [2/2]

BitVector & stabilizer::util::BitVector::ibvinc ( const BitVector bv)

Increment (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the increment for.
Returns
A reference to this bit-vector, overwritten with the result of the increment of bv.

Definition at line 1019 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvinc().

◆ ibvite()

BitVector & stabilizer::util::BitVector::ibvite ( const BitVector c,
const BitVector t,
const BitVector e 
)

Create an if-then-else over the given bit-vectors (in-place).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
cA bit-vector representing the condition of the ite.
tA bit-vector representing the then branch of the ite.
eA bit-vector representing the else branch of the ite.
Returns
A reference to this bit-vector, overwritten with the ite.

Definition at line 2453 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), is_null(), and size().

◆ ibvmodinv() [1/2]

BitVector & stabilizer::util::BitVector::ibvmodinv ( )

Calculate modular inverse of this bit-vector by means of the Extended Euclidean Algorithm (in-place).

Note
This bit-vector must be odd. The greatest common divisor gcd (c, 2^bw) must be (and is, in this case) always 1.
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the modular inverse.

Definition at line 2878 of file bitvector.cpp.

References ibvmodinv().

Referenced by ibvmodinv().

◆ ibvmodinv() [2/2]

BitVector & stabilizer::util::BitVector::ibvmodinv ( const BitVector bv)

Calculate modular inverse of the given bit-vector by means of the Extended Euclidean Algorithm (in-place).

Note
Bit-vector bv must be odd. The greatest common divisor gcd (c, 2^bw) must be (and is, in this case) always 1.
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the modular inverse for.
Returns
A reference to this bit-vector, overwritten with the modular inverse.

Definition at line 2494 of file bitvector.cpp.

References bvudivurem(), d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), mk_one(), stabilizer::util::mpz_fdiv_r_2exp_ull(), s_native_size, and size().

Referenced by bvmodinv().

◆ ibvmul() [1/2]

BitVector & stabilizer::util::BitVector::ibvmul ( const BitVector bv)

Multiplication (in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the multiplication of this and the given bit-vector.

Definition at line 2768 of file bitvector.cpp.

References hash(), and ibvmul().

◆ ibvmul() [2/2]

BitVector & stabilizer::util::BitVector::ibvmul ( const BitVector bv0,
const BitVector bv1 
)

Multiplication (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the multiplication.
bv1The second operand of the multiplication.
Returns
A reference to this bit-vector, overwritten with the result of the multiplication of the given bit-vectors.

Definition at line 1717 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvmul(), stabilizer::parser::BitVectorUtils::bvMul(), ibvmul(), and is_smul_overflow().

◆ ibvnand() [1/2]

BitVector & stabilizer::util::BitVector::ibvnand ( const BitVector bv)

Bit-wise nand (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise nand of this and the given bit-vector.

Definition at line 2658 of file bitvector.cpp.

References hash(), and ibvnand().

◆ ibvnand() [2/2]

BitVector & stabilizer::util::BitVector::ibvnand ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise nand (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise nand.
bv1The second operand of the bit-wise nand.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise nand of the given bit-vectors.

Definition at line 1219 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvnand(), and ibvnand().

◆ ibvne() [1/2]

BitVector & stabilizer::util::BitVector::ibvne ( const BitVector bv)

Disequality (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the disequality of this and the given bit-vector.

Definition at line 2693 of file bitvector.cpp.

References hash(), and ibvne().

◆ ibvne() [2/2]

BitVector & stabilizer::util::BitVector::ibvne ( const BitVector bv0,
const BitVector bv1 
)

Disequality (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the disequality.
bv1The second operand of the disequality.
Returns
A reference to this bit-vector, overwritten with the result of the disequality of the given bit-vectors.

Definition at line 1367 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvne(), and ibvne().

◆ ibvneg() [1/2]

BitVector & stabilizer::util::BitVector::ibvneg ( )

Two's complement negation (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the two's complement of this bit-vector.

Definition at line 2603 of file bitvector.cpp.

References ibvneg().

Referenced by ibvneg(), ibvsdiv(), ibvsmod(), and ibvsrem().

◆ ibvneg() [2/2]

BitVector & stabilizer::util::BitVector::ibvneg ( const BitVector bv)

Two's complement negation (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the two's complement for.
Returns
A reference to this bit-vector, overwritten with the result of the two's complement of bv.

Definition at line 981 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvnot(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), and uint64_fdiv_r_2exp().

Referenced by bvneg(), stabilizer::parser::BitVectorUtils::bvNeg(), and ibvsrem().

◆ ibvnego() [1/2]

BitVector & stabilizer::util::BitVector::ibvnego ( )

Bit-vector negation overflow check (in-place, chainable) of this bit-vector.

Result is a bit-vector of size 1, representing the result of the overflow check of the given bit-vector (1 if an overflow occurs, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check of this bit-vector.

Definition at line 2638 of file bitvector.cpp.

References ibvnego().

Referenced by ibvnego().

◆ ibvnego() [2/2]

BitVector & stabilizer::util::BitVector::ibvnego ( const BitVector bv)

Bit-vector negation overflow check (in-place) of the given bit-vector.

Result is a bit-vector of size 1, representing the result of the overflow check of the given bit-vector (1 if an overflow occurs, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the overflow check for.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check of bv.

Definition at line 1119 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvnego().

◆ ibvnor() [1/2]

BitVector & stabilizer::util::BitVector::ibvnor ( const BitVector bv)

Bit-wise nor (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise nor of this and the given bit-vector.

Definition at line 2663 of file bitvector.cpp.

References hash(), and ibvnor().

◆ ibvnor() [2/2]

BitVector & stabilizer::util::BitVector::ibvnor ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise nor (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise nor.
bv1The second operand of the bit-wise nor.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise nor of the given bit-vectors.

Definition at line 1245 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvnor(), and ibvnor().

◆ ibvnot() [1/2]

BitVector & stabilizer::util::BitVector::ibvnot ( )

Bit-wise negation (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise negation of this bit-vector.

Definition at line 2608 of file bitvector.cpp.

References ibvnot().

Referenced by ibvashr(), ibvashr(), ibvneg(), and ibvnot().

◆ ibvnot() [2/2]

BitVector & stabilizer::util::BitVector::ibvnot ( const BitVector bv)

Bit-wise negation (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the bit-wise negation for.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise negation of bv.

Definition at line 997 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvnot(), and ibvashr().

◆ ibvor() [1/2]

BitVector & stabilizer::util::BitVector::ibvor ( const BitVector bv)

Bit-wise or (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise or of this and the given bit-vector.

Definition at line 2668 of file bitvector.cpp.

References hash(), and ibvor().

◆ ibvor() [2/2]

BitVector & stabilizer::util::BitVector::ibvor ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise or (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise or.
bv1The second operand of the bit-wise or.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise or of the given bit-vectors.

Definition at line 1271 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvor(), and ibvor().

◆ ibvpow() [1/2]

BitVector & stabilizer::util::BitVector::ibvpow ( const BitVector base,
const mpz_t  exp 
)

Calculate a bit-vector base exponentiated by exp (in-place).

Parameters
baseThe base bit-vector.
expThe exponent GMP value.
Returns
A bit-vector representing the result of the exponentiation.

Definition at line 2883 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_get_ull(), stabilizer::util::mpz_init_set_ull(), stabilizer::util::mpz_mul_2exp_ull(), and size().

Referenced by bvpow(), and ibvpow().

◆ ibvpow() [2/2]

BitVector & stabilizer::util::BitVector::ibvpow ( const mpz_t  exp)

Calculate a bit-vector representing this bit-vector exponentiated by exp (in-place).

Parameters
expThe exponent GMP value.
Returns
A bit-vector representing the result of the exponentiation.

Definition at line 2903 of file bitvector.cpp.

References ibvpow().

◆ ibvredand() [1/2]

BitVector & stabilizer::util::BitVector::ibvredand ( )

And reduction (in-place, chainable) of this bit-vector.

Result is a bit-vector of size 1, representing the result of the and reduction of this bit-vector (1 if all bits of this bit-vector are one, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the and reduction of this bit-vector.

Definition at line 2623 of file bitvector.cpp.

References ibvredand().

Referenced by ibvredand().

◆ ibvredand() [2/2]

BitVector & stabilizer::util::BitVector::ibvredand ( const BitVector bv)

And reduction (in-place) of the given bit-vector.

Result is a bit-vector of size 1, representing the result of the and reduction of the given bit-vector (1 if all bits of this bit-vector are one, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the and reduction for.
Returns
A reference to this bit-vector, overwritten with the result of the and reduction of bv.

Definition at line 1063 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvredand().

◆ ibvredor() [1/2]

BitVector & stabilizer::util::BitVector::ibvredor ( )

Or reduction (in-place, chainable) of this bit-vector.

Result is a bit-vector of size 1, representing the result of the or reduction of this bit-vector (1 if at least one bit of this bit-vector is one, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the or reduction of this bit-vector.

Definition at line 2628 of file bitvector.cpp.

References ibvredor().

Referenced by ibvredor().

◆ ibvredor() [2/2]

BitVector & stabilizer::util::BitVector::ibvredor ( const BitVector bv)

Or reduction (in-place) of the given bit-vector.

Result is a bit-vector of size 1, representing the result of the or reduction of the given bit-vector (1 if at least one bit of this bit-vector is one, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the or reduction for.
Returns
A reference to this bit-vector, overwritten with the result of the or reduction of bv.

Definition at line 1076 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvredor().

◆ ibvredxor() [1/2]

BitVector & stabilizer::util::BitVector::ibvredxor ( )

Xor reduction (in-place, chainable) of this bit-vector.

Result is a bit-vector of size 1, representing the result of the xor reduction of this bit-vector (1 if an uneven number of bits is set to 1, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the xor reduction of this bit-vector.

Definition at line 2633 of file bitvector.cpp.

References ibvredxor().

Referenced by ibvredxor().

◆ ibvredxor() [2/2]

BitVector & stabilizer::util::BitVector::ibvredxor ( const BitVector bv)

Xor reduction (in-place) of the given bit-vector.

Result is a bit-vector of size 1, representing the result of the xor reduction of the given bit-vector (1 if an uneven number of bits is set to 1, and 0 otherwise).

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to compute the xor reduction for.
Returns
A reference to this bit-vector, overwritten with the result of the xor reduction of bv.

Definition at line 1099 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvredxor().

◆ ibvrepeat() [1/2]

BitVector & stabilizer::util::BitVector::ibvrepeat ( const BitVector bv,
uint64_t  n 
)

Repeat (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to repeat.
nThe number of times to repeat bit-vector bv, must be > 0.
Returns
A reference to this bit-vector, overwritten with result of the repeat operation.

Definition at line 2266 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_mul_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvrepeat(), and ibvrepeat().

◆ ibvrepeat() [2/2]

BitVector & stabilizer::util::BitVector::ibvrepeat ( uint64_t  n)

Repeat (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of times to repeat this bit-vector, must be > 0.
Returns
A reference to this bit-vector, overwritten with the result of the repeat operation.

Definition at line 2853 of file bitvector.cpp.

References hash(), and ibvrepeat().

◆ ibvrol() [1/2]

BitVector & stabilizer::util::BitVector::ibvrol ( const BitVector bv,
const BitVector n 
)

Rotate left (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to rotate.
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate left operation.

Definition at line 2367 of file bitvector.cpp.

References bvurem(), d_size, from_ui(), hash(), ibvroli(), shift_is_uint64(), and size().

Referenced by bvrol(), and ibvrol().

◆ ibvrol() [2/2]

BitVector & stabilizer::util::BitVector::ibvrol ( const BitVector n)

Rotate left (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate left operation.

Definition at line 2863 of file bitvector.cpp.

References hash(), and ibvrol().

◆ ibvroli() [1/2]

BitVector & stabilizer::util::BitVector::ibvroli ( const BitVector bv,
uint64_t  n 
)

Rotate left (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to rotate.
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate left operation.

Definition at line 2319 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvadd(), is_gmp(), stabilizer::util::mpz_mul_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvroli(), ibvrol(), and ibvroli().

◆ ibvroli() [2/2]

BitVector & stabilizer::util::BitVector::ibvroli ( uint64_t  n)

Rotate left (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate left operation.

Definition at line 2858 of file bitvector.cpp.

References hash(), and ibvroli().

◆ ibvror() [1/2]

BitVector & stabilizer::util::BitVector::ibvror ( const BitVector bv,
const BitVector n 
)

Rotate right (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to rotate.
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate right operation.

Definition at line 2434 of file bitvector.cpp.

References bvurem(), d_size, from_ui(), hash(), ibvrori(), shift_is_uint64(), and size().

Referenced by bvror(), and ibvror().

◆ ibvror() [2/2]

BitVector & stabilizer::util::BitVector::ibvror ( const BitVector n)

Rotate right (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate right operation.

Definition at line 2873 of file bitvector.cpp.

References hash(), and ibvror().

◆ ibvrori() [1/2]

BitVector & stabilizer::util::BitVector::ibvrori ( const BitVector bv,
uint64_t  n 
)

Rotate right (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to rotate.
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate right operation.

Definition at line 2386 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvadd(), is_gmp(), stabilizer::util::mpz_fdiv_q_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvrori(), ibvror(), and ibvrori().

◆ ibvrori() [2/2]

BitVector & stabilizer::util::BitVector::ibvrori ( uint64_t  n)

Rotate right(in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to rotate bit-vector bv by.
Returns
A reference to this bit-vector, overwritten with result of the rotate right operation.

Definition at line 2868 of file bitvector.cpp.

References hash(), and ibvrori().

◆ ibvsaddo() [1/2]

BitVector & stabilizer::util::BitVector::ibvsaddo ( const BitVector bv)

Signed addition overflow check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2803 of file bitvector.cpp.

References hash(), and ibvsaddo().

◆ ibvsaddo() [2/2]

BitVector & stabilizer::util::BitVector::ibvsaddo ( const BitVector bv0,
const BitVector bv1 
)

Signed addition overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the addition.
bv1The second operand of the addition.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 1948 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvsaddo(), and ibvsaddo().

◆ ibvsdiv() [1/2]

BitVector & stabilizer::util::BitVector::ibvsdiv ( const BitVector bv)

Signed division (in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed division of this and the given bit-vector.

Definition at line 2783 of file bitvector.cpp.

References hash(), and ibvsdiv().

◆ ibvsdiv() [2/2]

BitVector & stabilizer::util::BitVector::ibvsdiv ( const BitVector bv0,
const BitVector bv1 
)

Signed division (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed division.
bv1The second operand of the signed division.
Returns
A reference to this bit-vector, overwritten with the result of the signed division of the given bit-vectors.

Definition at line 1813 of file bitvector.cpp.

References hash(), ibvneg(), and ibvudiv().

Referenced by bvsdiv(), stabilizer::parser::BitVectorUtils::bvSdiv(), and ibvsdiv().

◆ ibvsdivo() [1/2]

BitVector & stabilizer::util::BitVector::ibvsdivo ( const BitVector bv)

Signed overflow division check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2828 of file bitvector.cpp.

References hash(), and ibvsdivo().

◆ ibvsdivo() [2/2]

BitVector & stabilizer::util::BitVector::ibvsdivo ( const BitVector bv0,
const BitVector bv1 
)

Signed division overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the division.
bv1The second operand of the division.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2013 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvsdivo(), and ibvsdivo().

◆ ibvsext() [1/2]

BitVector & stabilizer::util::BitVector::ibvsext ( const BitVector bv,
uint64_t  n 
)

Sign extension (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to sign extend.
nThe number of bits to extend bit-vector bv with.
Returns
A reference to this bit-vector, overwritten with the sign extension.

Definition at line 2181 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvzext(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_mul_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvsext(), ibvsext(), and is_smul_overflow().

◆ ibvsext() [2/2]

BitVector & stabilizer::util::BitVector::ibvsext ( uint64_t  n)

Sign extension (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to extend bit-vector bv with.
Returns
A reference to this bit-vector, overwritten with the sign extension.

Definition at line 2848 of file bitvector.cpp.

References hash(), and ibvsext().

◆ ibvsge() [1/2]

BitVector & stabilizer::util::BitVector::ibvsge ( const BitVector bv)

Signed greater than or equal (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed greater than or equal of this and the given bit-vector.

Definition at line 2733 of file bitvector.cpp.

References hash(), and ibvsge().

◆ ibvsge() [2/2]

BitVector & stabilizer::util::BitVector::ibvsge ( const BitVector bv0,
const BitVector bv1 
)

Signed greater than or equal (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed greater than or equal.
bv1The second operand of the signed greater than or equal.
Returns
A reference to this bit-vector, overwritten with the result of the signed greater or equal of the given bit-vectors.

Definition at line 1539 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvuge(), and is_gmp().

Referenced by bvsge(), and ibvsge().

◆ ibvsgt() [1/2]

BitVector & stabilizer::util::BitVector::ibvsgt ( const BitVector bv)

Signed greater than (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed greater than of this and the given bit-vector.

Definition at line 2728 of file bitvector.cpp.

References hash(), and ibvsgt().

◆ ibvsgt() [2/2]

BitVector & stabilizer::util::BitVector::ibvsgt ( const BitVector bv0,
const BitVector bv1 
)

Signed greater than (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed greater than.
bv1The second operand of the signed greater than.
Returns
A reference to this bit-vector, overwritten with the result of the signed greater than of the given bit-vectors.

Definition at line 1515 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvugt(), and is_gmp().

Referenced by bvsgt(), and ibvsgt().

◆ ibvshl() [1/4]

BitVector & stabilizer::util::BitVector::ibvshl ( const BitVector bv)

Logical left shift (in-place) of this bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the left.
Returns
A reference to this bit-vector, overwritten with the result of the logical left shift.

Definition at line 2743 of file bitvector.cpp.

References hash(), and ibvshl().

◆ ibvshl() [2/4]

BitVector & stabilizer::util::BitVector::ibvshl ( const BitVector bv,
const BitVector shift 
)

Logical left shift (in-place) of the given bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftThe bit-vector representing the number of bits to shift bv.
Returns
A reference to this bit-vector, overwritten with the result of the logical left shift.

Definition at line 1595 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvshl(), is_gmp(), and size().

◆ ibvshl() [3/4]

BitVector & stabilizer::util::BitVector::ibvshl ( const BitVector bv,
uint64_t  shift 
)

Logical left shift (in-place) of the given bit-vector by the given unsigned integer value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the left.
Returns
A reference to this bit-vector, overwritten with the result of the logical left shift.

Definition at line 1563 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_mul_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvshl(), stabilizer::parser::BitVectorUtils::bvShl(), bvshl(), ibvshl(), ibvshl(), and ibvshl().

◆ ibvshl() [4/4]

BitVector & stabilizer::util::BitVector::ibvshl ( uint64_t  shift)

Logical left shift (in-place) of this bit-vector by the given unsigned integer value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the left.
Returns
A reference to this bit-vector, overwritten with the result of the logical left shift.

Definition at line 2738 of file bitvector.cpp.

References hash(), and ibvshl().

◆ ibvshr() [1/4]

BitVector & stabilizer::util::BitVector::ibvshr ( const BitVector bv)

Logical right shift (in-place) of this bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the right.
Returns
A reference to this bit-vector, overwritten with the result of the logical right shift.

Definition at line 2753 of file bitvector.cpp.

References hash(), and ibvshr().

◆ ibvshr() [2/4]

BitVector & stabilizer::util::BitVector::ibvshr ( const BitVector bv,
const BitVector shift 
)

Logical right shift (in-place) of the given bit-vector by the given bit-vector shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftThe bit-vector representing the number of bits to shift bv.
Returns
A reference to this bit-vector, overwritten with the result of the logical right shift.

Definition at line 1655 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvshr(), is_gmp(), and size().

◆ ibvshr() [3/4]

BitVector & stabilizer::util::BitVector::ibvshr ( const BitVector bv,
uint64_t  shift 
)

Logical right shift (in-place) of of the given bit-vector by the given unsigned integer shift value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to shift.
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the right.
Returns
A reference to this bit-vector, overwritten with the result of the logical right shift.

Definition at line 1624 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_q_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by stabilizer::parser::BitVectorUtils::bvLshr(), bvshr(), bvshr(), ibvashr(), ibvashr(), ibvshr(), ibvshr(), and ibvshr().

◆ ibvshr() [4/4]

BitVector & stabilizer::util::BitVector::ibvshr ( uint64_t  shift)

Logical right shift (in-place) of this bit-vector by the given unsigned integer value.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
shiftAn unsigned integer representing the number of bits to shift this bit-vector to the right.
Returns
A reference to this bit-vector, overwritten with the result of the logical right shift.

Definition at line 2748 of file bitvector.cpp.

References hash(), and ibvshr().

◆ ibvsle() [1/2]

BitVector & stabilizer::util::BitVector::ibvsle ( const BitVector bv)

Signed less than or equal (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed less than or equal of this and the given bit-vector.

Definition at line 2723 of file bitvector.cpp.

References hash(), and ibvsle().

◆ ibvsle() [2/2]

BitVector & stabilizer::util::BitVector::ibvsle ( const BitVector bv0,
const BitVector bv1 
)

Signed less than or equal (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned less than or equal.
bv1The second operand of the unsigned less than or equal.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned less or equal of the given bit-vectors.

Definition at line 1491 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvule(), and is_gmp().

Referenced by bvsle(), and ibvsle().

◆ ibvslt() [1/2]

BitVector & stabilizer::util::BitVector::ibvslt ( const BitVector bv)

Signed less than (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed less than or equal of this and the given bit-vector.

Definition at line 2718 of file bitvector.cpp.

References hash(), and ibvslt().

◆ ibvslt() [2/2]

BitVector & stabilizer::util::BitVector::ibvslt ( const BitVector bv0,
const BitVector bv1 
)

Signed less than (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed less than.
bv1The second operand of the signed less than.
Returns
A reference to this bit-vector, overwritten with the result of the signed less than of the given bit-vectors.

Definition at line 1467 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), ibvult(), and is_gmp().

Referenced by bvslt(), and ibvslt().

◆ ibvsmod() [1/2]

BitVector & stabilizer::util::BitVector::ibvsmod ( const BitVector bv)

Signed remainder (sign follows divisor, in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed remainder of this and the given bit-vector.

Definition at line 2793 of file bitvector.cpp.

References hash(), and ibvsmod().

◆ ibvsmod() [2/2]

BitVector & stabilizer::util::BitVector::ibvsmod ( const BitVector bv0,
const BitVector bv1 
)

Signed remainder (sign follows divisor, in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed remainder.
bv1The second operand of the signed remainder.
Returns
A reference to this bit-vector, overwritten with the result of the signed remainder of the given bit-vectors.

Definition at line 1886 of file bitvector.cpp.

References hash(), ibvadd(), ibvneg(), ibvurem(), and is_zero().

Referenced by bvsmod(), stabilizer::parser::BitVectorUtils::bvSmod(), and ibvsmod().

◆ ibvsmulo() [1/2]

BitVector & stabilizer::util::BitVector::ibvsmulo ( const BitVector bv)

Signed overflow multiplication check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2823 of file bitvector.cpp.

References hash(), and ibvsmulo().

◆ ibvsmulo() [2/2]

BitVector & stabilizer::util::BitVector::ibvsmulo ( const BitVector bv0,
const BitVector bv1 
)

Signed multiplication overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the multiplication.
bv1The second operand of the multiplication.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2000 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvsmulo(), and ibvsmulo().

◆ ibvsrem() [1/2]

BitVector & stabilizer::util::BitVector::ibvsrem ( const BitVector bv)

Signed remainder (sign follows divident, in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the signed remainder of this and the given bit-vector.

Definition at line 2788 of file bitvector.cpp.

References hash(), and ibvsrem().

◆ ibvsrem() [2/2]

BitVector & stabilizer::util::BitVector::ibvsrem ( const BitVector bv0,
const BitVector bv1 
)

Signed remainder (sign follows dividend, in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the signed remainder.
bv1The second operand of the signed remainder.
Returns
A reference to this bit-vector, overwritten with the result of the signed remainder of the given bit-vectors.

Definition at line 1850 of file bitvector.cpp.

References hash(), ibvneg(), ibvneg(), and ibvurem().

Referenced by bvsrem(), stabilizer::parser::BitVectorUtils::bvSrem(), and ibvsrem().

◆ ibvssubo() [1/2]

BitVector & stabilizer::util::BitVector::ibvssubo ( const BitVector bv)

Signed subtraction overflow check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2813 of file bitvector.cpp.

References hash(), and ibvssubo().

◆ ibvssubo() [2/2]

BitVector & stabilizer::util::BitVector::ibvssubo ( const BitVector bv0,
const BitVector bv1 
)

Signed subtraction overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the subtraction.
bv1The second operand of the subtraction.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 1974 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvssubo(), and ibvssubo().

◆ ibvsub() [1/2]

BitVector & stabilizer::util::BitVector::ibvsub ( const BitVector bv)

Subtraction (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the subtraction of this and the given bit-vector.

Definition at line 2673 of file bitvector.cpp.

References hash(), and ibvsub().

◆ ibvsub() [2/2]

BitVector & stabilizer::util::BitVector::ibvsub ( const BitVector bv0,
const BitVector bv1 
)

Subtraction (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the subtraction.
bv1The second operand of the subtraction.
Returns
A reference to this bit-vector, overwritten with the result of the subtraction of the given bit-vectors.

Definition at line 1153 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvsub(), stabilizer::parser::BitVectorUtils::bvSub(), and ibvsub().

◆ ibvuaddo() [1/2]

BitVector & stabilizer::util::BitVector::ibvuaddo ( const BitVector bv)

Unsigned addition overflow check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2798 of file bitvector.cpp.

References hash(), and ibvuaddo().

◆ ibvuaddo() [2/2]

BitVector & stabilizer::util::BitVector::ibvuaddo ( const BitVector bv0,
const BitVector bv1 
)

Unsigned addition overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the addition.
bv1The second operand of the addition.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 1935 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvuaddo(), and ibvuaddo().

◆ ibvudiv() [1/2]

BitVector & stabilizer::util::BitVector::ibvudiv ( const BitVector bv)

Unsigned division (in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned division of this and the given bit-vector.

Definition at line 2773 of file bitvector.cpp.

References hash(), and ibvudiv().

◆ ibvudiv() [2/2]

BitVector & stabilizer::util::BitVector::ibvudiv ( const BitVector bv0,
const BitVector bv1 
)

Unsigned division (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned division.
bv1The second operand of the unsigned division.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned division of the given bit-vectors.

Definition at line 1742 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_mul_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvudiv(), stabilizer::parser::BitVectorUtils::bvUdiv(), ibvsdiv(), and ibvudiv().

◆ ibvuge() [1/2]

BitVector & stabilizer::util::BitVector::ibvuge ( const BitVector bv)

Unsigned greater than or equal (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned greater than or equal of this and the given bit-vector.

Definition at line 2713 of file bitvector.cpp.

References hash(), and ibvuge().

◆ ibvuge() [2/2]

BitVector & stabilizer::util::BitVector::ibvuge ( const BitVector bv0,
const BitVector bv1 
)

Unsigned greater than or equal (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned greater than or equal.
bv1The second operand of the unsigned greater than or equal.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned greater or equal of the given bit-vectors.

Definition at line 1447 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvuge(), ibvsge(), and ibvuge().

◆ ibvugt() [1/2]

BitVector & stabilizer::util::BitVector::ibvugt ( const BitVector bv)

Unsigned greater than (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned greater than of this and the given bit-vector.

Definition at line 2708 of file bitvector.cpp.

References hash(), and ibvugt().

◆ ibvugt() [2/2]

BitVector & stabilizer::util::BitVector::ibvugt ( const BitVector bv0,
const BitVector bv1 
)

Unsigned greater than (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned greater than.
bv1The second operand of the unsigned greater than.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned greater than of the given bit-vectors.

Definition at line 1427 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvugt(), ibvsgt(), and ibvugt().

◆ ibvule() [1/2]

BitVector & stabilizer::util::BitVector::ibvule ( const BitVector bv)

Unsigned less than or equal (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned less than or equal of this and the given bit-vector.

Definition at line 2703 of file bitvector.cpp.

References hash(), and ibvule().

◆ ibvule() [2/2]

BitVector & stabilizer::util::BitVector::ibvule ( const BitVector bv0,
const BitVector bv1 
)

Unsigned less than or equal (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned less than or equal.
bv1The second operand of the unsigned less than or equal.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned less or equal of the given bit-vectors.

Definition at line 1407 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvule(), ibvsle(), and ibvule().

◆ ibvult() [1/2]

BitVector & stabilizer::util::BitVector::ibvult ( const BitVector bv)

Unsigned less than (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned less than of this and the given bit-vector.

Definition at line 2698 of file bitvector.cpp.

References hash(), and ibvult().

◆ ibvult() [2/2]

BitVector & stabilizer::util::BitVector::ibvult ( const BitVector bv0,
const BitVector bv1 
)

Unsigned less than (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned less than.
bv1The second operand of the unsigned less than.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned less than of the given bit-vectors.

Definition at line 1387 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvult(), ibvslt(), and ibvult().

◆ ibvumulo() [1/2]

BitVector & stabilizer::util::BitVector::ibvumulo ( const BitVector bv)

Unsigned multiplication overflow check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2818 of file bitvector.cpp.

References hash(), and ibvumulo().

◆ ibvumulo() [2/2]

BitVector & stabilizer::util::BitVector::ibvumulo ( const BitVector bv0,
const BitVector bv1 
)

Unsigned multiplication overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the multiplication.
bv1The second operand of the multiplication.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 1987 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvumulo(), and ibvumulo().

◆ ibvurem() [1/2]

BitVector & stabilizer::util::BitVector::ibvurem ( const BitVector bv)

Unsigned division (in-place) of this bit-vector by the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned remainder of this and the given bit-vector.

Definition at line 2778 of file bitvector.cpp.

References hash(), and ibvurem().

◆ ibvurem() [2/2]

BitVector & stabilizer::util::BitVector::ibvurem ( const BitVector bv0,
const BitVector bv1 
)

Unsigned remainder (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the unsigned remainder.
bv1The second operand of the unsigned remainder.
Returns
A reference to this bit-vector, overwritten with the result of the unsigned remainder of the given bit-vectors.

Definition at line 1778 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvurem(), stabilizer::parser::BitVectorUtils::bvUrem(), ibvsmod(), ibvsrem(), and ibvurem().

◆ ibvusubo() [1/2]

BitVector & stabilizer::util::BitVector::ibvusubo ( const BitVector bv)

Unsigned subtraction overflow check (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 2808 of file bitvector.cpp.

References hash(), and ibvusubo().

◆ ibvusubo() [2/2]

BitVector & stabilizer::util::BitVector::ibvusubo ( const BitVector bv0,
const BitVector bv1 
)

Unsigned subtraction overflow check (in-place) of given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the subtraction.
bv1The second operand of the subtraction.
Returns
A reference to this bit-vector, overwritten with the result of the overflow check.

Definition at line 1961 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

Referenced by bvusubo(), and ibvusubo().

◆ ibvxnor() [1/2]

BitVector & stabilizer::util::BitVector::ibvxnor ( const BitVector bv)

Bit-wise xnor (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise xnor of this and the given bit-vector.

Definition at line 2678 of file bitvector.cpp.

References hash(), and ibvxnor().

◆ ibvxnor() [2/2]

BitVector & stabilizer::util::BitVector::ibvxnor ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise xnor (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise xnor.
bv1The second operand of the bit-wise xnor.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise xnor of the given bit-vectors.

Definition at line 1296 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvxnor(), and ibvxnor().

◆ ibvxor() [1/2]

BitVector & stabilizer::util::BitVector::ibvxor ( const BitVector bv)

Bit-wise xor (in-place) of this bit-vector and the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe other bit-vector.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise xor of this and the given bit-vector.

Definition at line 2683 of file bitvector.cpp.

References hash(), and ibvxor().

◆ ibvxor() [2/2]

BitVector & stabilizer::util::BitVector::ibvxor ( const BitVector bv0,
const BitVector bv1 
)

Bit-wise xor (in-place) of the given bit-vectors bv0 and bv1.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bv0The first operand of the bit-wise xor.
bv1The second operand of the bit-wise xor.
Returns
A reference to this bit-vector, overwritten with the result of the bit-wise xor of the given bit-vectors.

Definition at line 1322 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), stabilizer::util::mpz_fdiv_r_2exp_ull(), size(), and uint64_fdiv_r_2exp().

Referenced by bvxor(), and ibvxor().

◆ ibvzext() [1/2]

BitVector & stabilizer::util::BitVector::ibvzext ( const BitVector bv,
uint64_t  n 
)

Zero extension (in-place) of the given bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
bvThe bit-vector to zero extend.
nThe number of bits to extend bit-vector bv with.
Returns
A reference to this bit-vector, overwritten with the zero extension.

Definition at line 2132 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), s_native_size, and size().

Referenced by bvzext(), ibvsext(), and ibvzext().

◆ ibvzext() [2/2]

BitVector & stabilizer::util::BitVector::ibvzext ( uint64_t  n)

Zero extension (in-place) of this bit-vector.

Note
The result of this operation is stored in-place, in this bit-vector.
Parameters
nThe number of bits to extend bit-vector bv with.
Returns
A reference to this bit-vector, overwritten with the zero extension.

Definition at line 2843 of file bitvector.cpp.

References hash(), and ibvzext().

◆ is_false()

bool stabilizer::util::BitVector::is_false ( ) const
Returns
True if this bit-vector is zero and of size 1.

Definition at line 529 of file bitvector.cpp.

References bit(), d_size, and is_null().

◆ is_gmp()

bool stabilizer::util::BitVector::is_gmp ( ) const
inlineprivate

◆ is_max_signed()

bool stabilizer::util::BitVector::is_max_signed ( ) const
Returns
True if this bit-vector is the maximum signed value.

Definition at line 596 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

◆ is_min_signed()

bool stabilizer::util::BitVector::is_min_signed ( ) const
Returns
True if this bit-vector is the minimum signed value.

Definition at line 581 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by is_neg_overflow(), and is_sdiv_overflow().

◆ is_neg_overflow()

bool stabilizer::util::BitVector::is_neg_overflow ( ) const

Determine if the negation of this bit-vector produces an overflow.

Returns
True if it produces an overflow.

Definition at line 617 of file bitvector.cpp.

References is_min_signed(), and is_null().

◆ is_null()

◆ is_one()

bool stabilizer::util::BitVector::is_one ( ) const
Returns
True if this bit-vector is one.

Definition at line 573 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by is_smul_overflow().

◆ is_ones()

bool stabilizer::util::BitVector::is_ones ( ) const
Returns
True if this bit-vector is ones (a bit-vector of all 1 bits).

Definition at line 544 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), is_null(), and uint64_fdiv_r_2exp().

◆ is_power_of_two()

bool stabilizer::util::BitVector::is_power_of_two ( ) const
Returns
True if this bit-vector is a power of two.

Definition at line 612 of file bitvector.cpp.

References bvdec(), ibvand(), is_null(), and is_zero().

◆ is_sadd_overflow()

bool stabilizer::util::BitVector::is_sadd_overflow ( const BitVector bv) const

Determine if the (signed) addition of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to add to this bit-vector.
Returns
True if it produces an overflow.

Definition at line 640 of file bitvector.cpp.

References bvadd(), d_size, hash(), is_null(), and msb().

◆ is_sdiv_overflow()

bool stabilizer::util::BitVector::is_sdiv_overflow ( const BitVector bv) const

Determine if the (signed) division of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to divide this bit-vector by.
Returns
True if it produces an overflow.

Definition at line 709 of file bitvector.cpp.

References d_size, hash(), is_min_signed(), and is_null().

◆ is_smul_overflow()

bool stabilizer::util::BitVector::is_smul_overflow ( const BitVector bv) const

Determine if the (signed) multiplication of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to multiply this bit-vector with.
Returns
True if it produces an overflow.

Definition at line 693 of file bitvector.cpp.

References bvsext(), d_size, hash(), ibvmul(), ibvsext(), is_null(), is_one(), mk_max_signed(), mk_min_signed(), and signed_compare().

◆ is_ssub_overflow()

bool stabilizer::util::BitVector::is_ssub_overflow ( const BitVector bv) const

Determine if the (signed) subtraction of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to add to this bit-vector.
Returns
True if it produces an overflow.

Definition at line 659 of file bitvector.cpp.

References bvsub(), d_size, hash(), is_null(), and msb().

◆ is_true()

bool stabilizer::util::BitVector::is_true ( ) const
Returns
True if this bit-vector is one and of size 1.

Definition at line 522 of file bitvector.cpp.

References bit(), d_size, and is_null().

◆ is_uadd_overflow()

bool stabilizer::util::BitVector::is_uadd_overflow ( const BitVector bv) const
Parameters
bvA bit-vector representing the number of bits to shift this bit-vector to the left.
bvThe bit-vector to add to this bit-vector.
Returns
True if it produces an overflow.

Definition at line 622 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), is_null(), and stabilizer::util::mpz_fdiv_q_2exp_ull().

◆ is_umul_overflow()

bool stabilizer::util::BitVector::is_umul_overflow ( const BitVector bv) const

Determine if the (unsigned) multiplication of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to multiply this bit-vector with.
Returns
True if it produces an overflow.

Definition at line 672 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), is_null(), and stabilizer::util::mpz_fdiv_q_2exp_ull().

◆ is_usub_overflow()

bool stabilizer::util::BitVector::is_usub_overflow ( const BitVector bv) const

Determine if the (unsigned) subtraction of this and the given bit-vector produces an overflow.

Parameters
bvThe bit-vector to add to this bit-vector.
Returns
True if it produces an overflow.

Definition at line 653 of file bitvector.cpp.

References compare(), d_size, hash(), and is_null().

◆ is_zero()

bool stabilizer::util::BitVector::is_zero ( ) const
Returns
True if this bit-vector is zero.

Definition at line 536 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by ibvsmod(), and is_power_of_two().

◆ iset() [1/2]

void stabilizer::util::BitVector::iset ( const BitVector bv)

Set the value of this bit-vector to the value of bv (in-place).

Parameters
bvA bit-vector representing the value this bit-vector is to between set to.

Definition at line 363 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

◆ iset() [2/2]

void stabilizer::util::BitVector::iset ( uint64_t  value)

Set the value of this bit-vector to the given unsigned (in-place).

Parameters
valueThe value to set.

Definition at line 351 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, is_gmp(), is_null(), stabilizer::util::mpz_fdiv_r_2exp_ull(), stabilizer::util::mpz_set_ull(), and uint64_fdiv_r_2exp().

◆ lsb()

bool stabilizer::util::BitVector::lsb ( ) const
Returns
True if the lsb (index 0) is 1, and false otherwise.

Definition at line 512 of file bitvector.cpp.

References bit(), and is_null().

◆ mk_false()

BitVector stabilizer::util::BitVector::mk_false ( )
static

Create a false bit-vector (value 0 of size 1).

Returns
A bit-vector representing False.

Definition at line 122 of file bitvector.cpp.

References mk_zero().

◆ mk_max_signed()

BitVector stabilizer::util::BitVector::mk_max_signed ( uint64_t  size)
static

Create a maximum signed value (01..1) bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
Returns
A bit-vector representing the maximum signed value of given size.

Definition at line 147 of file bitvector.cpp.

References hash(), mk_ones(), and size().

Referenced by is_smul_overflow().

◆ mk_min_signed()

BitVector stabilizer::util::BitVector::mk_min_signed ( uint64_t  size)
static

Create a minimum signed value (10..0) bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
Returns
A bit-vector representing the minimum signed value of given size.

Definition at line 141 of file bitvector.cpp.

References hash(), mk_zero(), and size().

Referenced by fits_in_size(), and is_smul_overflow().

◆ mk_one()

BitVector stabilizer::util::BitVector::mk_one ( uint64_t  size)
static

Create a one bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
Returns
A bit-vector representing one of given size.

Definition at line 126 of file bitvector.cpp.

References from_ui(), and size().

Referenced by ibvmodinv(), and mk_true().

◆ mk_ones()

BitVector stabilizer::util::BitVector::mk_ones ( uint64_t  size)
static

Create a ones bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
Returns
A bit-vector representing ones of given size.

Definition at line 128 of file bitvector.cpp.

References hash(), stabilizer::util::mpz_mul_2exp_ull(), s_native_size, size(), and uint64_fdiv_r_2exp().

Referenced by bvudivurem(), fits_in_size(), and mk_max_signed().

◆ mk_true()

BitVector stabilizer::util::BitVector::mk_true ( )
static

Create a true bit-vector (value 1 of size 1).

Returns
A bit-vector representing True.

Definition at line 120 of file bitvector.cpp.

References mk_one().

◆ mk_zero()

BitVector stabilizer::util::BitVector::mk_zero ( uint64_t  size)
static

Create a zero bit-vector of given size.

Parameters
sizeThe size of the bit-vector.
Returns
A bit-vector representing zero of given size..

Definition at line 124 of file bitvector.cpp.

References BitVector(), and size().

Referenced by bvudivurem(), mk_false(), and mk_min_signed().

◆ msb()

bool stabilizer::util::BitVector::msb ( ) const
Returns
True if the msb (index size - 1) is 1, and false otherwise.

Definition at line 517 of file bitvector.cpp.

References bit(), d_size, and is_null().

Referenced by is_sadd_overflow(), is_ssub_overflow(), and signed_compare().

◆ operator!=()

bool stabilizer::util::BitVector::operator!= ( const BitVector bv) const

Disequality comparison operator.

Parameters
bvThe bit-vector to compare this bit-vector to.

Definition at line 381 of file bitvector.cpp.

References compare(), hash(), and is_null().

◆ operator=()

Copy assignment operator.

Definition at line 293 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), and is_gmp().

◆ operator==()

Equality comparison operator.

Parameters
bvThe bit-vector to compare this bit-vector to.

Definition at line 375 of file bitvector.cpp.

References compare(), hash(), and is_null().

◆ set_bit()

void stabilizer::util::BitVector::set_bit ( uint64_t  idx,
bool  value 
)

Set the bit at given index to the given value.

Parameters
idxThe index of the bit.
valueThe value.

Definition at line 481 of file bitvector.cpp.

References d_size, d_val_gmp, d_val_uint64, hash(), is_gmp(), and is_null().

Referenced by flip_bit().

◆ shift_is_uint64()

bool stabilizer::util::BitVector::shift_is_uint64 ( uint64_t res) const
private

Determine if this bit-vector can be represented with a uint64_t.

Parameters
resIf true, uint64_t representation is stored in res.
Returns
True if it can.

Definition at line 3084 of file bitvector.cpp.

References bvextract(), count_leading_zeros(), d_size, hash(), and to_uint64().

Referenced by ibvrol(), and ibvror().

◆ signed_compare()

int32_t stabilizer::util::BitVector::signed_compare ( const BitVector bv) const

Compare this bit-vector with given bit-vector (signed).

Parameters
bvThe bit-vector to compare this bit-vector with.
Returns
0 if the bit-vectors are equal, -1 if their sizes don't match or if this is signed less than bv, and 1 if this is signed greater than bv.

Definition at line 452 of file bitvector.cpp.

References compare(), d_size, hash(), is_null(), and msb().

Referenced by is_smul_overflow().

◆ size()

◆ str()

◆ to_mpz()

mpz_class stabilizer::util::BitVector::to_mpz ( ) const

Convert bit-vector to mpz_class.

Definition at line 2962 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, hash(), is_gmp(), and stabilizer::util::uint64_to_mpz_class().

◆ to_uint64()

uint64_t stabilizer::util::BitVector::to_uint64 ( bool  truncate = false) const

Get the uint64_t representation of this bit-vector.

Parameters
sizeThe size of this bit-vector, must be <= 64.
truncateTrue to allow truncating the value if it is not representable with 64 bits.
Returns
The uint64_t representation.

Definition at line 420 of file bitvector.cpp.

References d_val_gmp, d_val_uint64, fits_in_size(), hash(), is_gmp(), is_null(), and stabilizer::util::mpz_get_ull().

Referenced by shift_is_uint64().

◆ uint64_fdiv_r_2exp()

uint64_t stabilizer::util::BitVector::uint64_fdiv_r_2exp ( uint64_t  size,
uint64_t  val 
)
staticprivate

Normalize uint64_t value for a given bit-width. The equivalent of mpz_fdiv_r_2exp for uint64_t values. Compute the remainder of the division of val by 2^size, implemented with shifts and a bit mask.

Parameters
sizeThe bit-width.
valThe value.
Returns
The normalized value.

Definition at line 2973 of file bitvector.cpp.

References hash(), and size().

Referenced by BitVector(), from_si(), from_ui(), ibvadd(), ibvand(), ibvconcat(), ibvdec(), ibvextract(), ibvinc(), ibvmul(), ibvnand(), ibvneg(), ibvnor(), ibvnot(), ibvor(), ibvrepeat(), ibvroli(), ibvrori(), ibvsext(), ibvshl(), ibvshr(), ibvsub(), ibvudiv(), ibvurem(), ibvxnor(), ibvxor(), is_ones(), iset(), and mk_ones().

Member Data Documentation

◆ [union]

The bit-vector value.

Note: We use a union instead of std::variant here in order to avoid the overhead of the latter, since we already have a "tracking variable" (the size of the bit-vector, d_size). Further, we do not use a unique_ptr for d_val_gmp because we don't gain anything if it is in a union – we have to manually destruct it anyways.

◆ d_size

uint64_t stabilizer::util::BitVector::d_size = 0
private

The size of this bit-vector.

Definition at line 2198 of file bitvector.h.

Referenced by BitVector(), BitVector(), bvadd(), bvand(), bvashr(), bvashr(), bvconcat(), bvdec(), bvextract(), bvinc(), bvite(), bvmodinv(), bvmul(), bvnand(), bvneg(), bvnor(), bvnot(), bvor(), bvpow(), bvrepeat(), bvrol(), bvroli(), bvror(), bvrori(), bvsaddo(), bvsdiv(), bvsdivo(), bvsext(), bvshl(), bvshl(), bvshr(), bvshr(), bvsmod(), bvsmulo(), bvsrem(), bvssubo(), bvsub(), bvuaddo(), bvudiv(), bvudivurem(), bvumulo(), bvurem(), bvusubo(), bvxnor(), bvxor(), bvzext(), compare(), count_leading(), count_trailing_ones(), count_trailing_zeros(), get_limb(), hash(), ibvadd(), ibvand(), ibvconcat(), ibvdec(), ibveq(), ibvextract(), ibvimplies(), ibvinc(), ibvite(), ibvmodinv(), ibvmul(), ibvnand(), ibvne(), ibvneg(), ibvnego(), ibvnor(), ibvnot(), ibvor(), ibvredand(), ibvredor(), ibvredxor(), ibvrepeat(), ibvrol(), ibvroli(), ibvror(), ibvrori(), ibvsaddo(), ibvsdivo(), ibvsext(), ibvsge(), ibvsgt(), ibvshl(), ibvshl(), ibvshr(), ibvshr(), ibvsle(), ibvslt(), ibvsmulo(), ibvssubo(), ibvsub(), ibvuaddo(), ibvudiv(), ibvuge(), ibvugt(), ibvule(), ibvult(), ibvumulo(), ibvurem(), ibvusubo(), ibvxnor(), ibvxor(), ibvzext(), is_false(), is_gmp(), is_max_signed(), is_min_signed(), is_null(), is_ones(), is_sadd_overflow(), is_sdiv_overflow(), is_smul_overflow(), is_ssub_overflow(), is_true(), is_uadd_overflow(), is_umul_overflow(), is_usub_overflow(), iset(), iset(), msb(), operator=(), set_bit(), shift_is_uint64(), signed_compare(), size(), and str().

◆ d_val_gmp

◆ d_val_uint64

◆ s_native_size

constexpr size_t stabilizer::util::BitVector::s_native_size = sizeof(unsigned long) * 8
staticconstexpr

The documentation for this class was generated from the following files: