|
cprover
|
#include <bv_utils.h>
Public Types | |
| enum class | representationt { SIGNED , UNSIGNED } |
| enum class | shiftt { SHIFT_LEFT , SHIFT_LRIGHT , SHIFT_ARIGHT , ROTATE_LEFT , ROTATE_RIGHT } |
Public Member Functions | |
| bv_utilst (propt &_prop) | |
| bvt | incrementer (const bvt &op, literalt carry_in) |
| bvt | inc (const bvt &op) |
| void | incrementer (bvt &op, literalt carry_in, literalt &carry_out) |
| bvt | negate (const bvt &op) |
| bvt | negate_no_overflow (const bvt &op) |
| bvt | absolute_value (const bvt &op) |
| literalt | overflow_negate (const bvt &op) |
| literalt | full_adder (const literalt a, const literalt b, const literalt carry_in, literalt &carry_out) |
| literalt | carry (literalt a, literalt b, literalt c) |
| bvt | add_sub (const bvt &op0, const bvt &op1, bool subtract) |
| bvt | add_sub (const bvt &op0, const bvt &op1, literalt subtract) |
| bvt | add_sub_no_overflow (const bvt &op0, const bvt &op1, bool subtract, representationt rep) |
| bvt | saturating_add_sub (const bvt &op0, const bvt &op1, bool subtract, representationt rep) |
| bvt | add (const bvt &op0, const bvt &op1) |
| bvt | sub (const bvt &op0, const bvt &op1) |
| literalt | overflow_add (const bvt &op0, const bvt &op1, representationt rep) |
| literalt | overflow_sub (const bvt &op0, const bvt &op1, representationt rep) |
| literalt | carry_out (const bvt &op0, const bvt &op1, literalt carry_in) |
| bvt | shift (const bvt &op, const shiftt shift, const bvt &distance) |
| bvt | unsigned_multiplier (const bvt &op0, const bvt &op1) |
| bvt | signed_multiplier (const bvt &op0, const bvt &op1) |
| bvt | multiplier (const bvt &op0, const bvt &op1, representationt rep) |
| bvt | multiplier_no_overflow (const bvt &op0, const bvt &op1, representationt rep) |
| bvt | divider (const bvt &op0, const bvt &op1, representationt rep) |
| bvt | remainder (const bvt &op0, const bvt &op1, representationt rep) |
| void | divider (const bvt &op0, const bvt &op1, bvt &res, bvt &rem, representationt rep) |
| void | signed_divider (const bvt &op0, const bvt &op1, bvt &res, bvt &rem) |
| void | unsigned_divider (const bvt &op0, const bvt &op1, bvt &res, bvt &rem) |
| literalt | equal (const bvt &op0, const bvt &op1) |
| Bit-blasting ID_equal and use in other encodings. | |
| literalt | is_zero (const bvt &op) |
| literalt | is_not_zero (const bvt &op) |
| literalt | is_int_min (const bvt &op) |
| literalt | is_one (const bvt &op) |
| literalt | is_all_ones (const bvt &op) |
| literalt | lt_or_le (bool or_equal, const bvt &bv0, const bvt &bv1, representationt rep) |
| literalt | rel (const bvt &bv0, irep_idt id, const bvt &bv1, representationt rep) |
| literalt | unsigned_less_than (const bvt &bv0, const bvt &bv1) |
| literalt | signed_less_than (const bvt &bv0, const bvt &bv1) |
| void | set_equal (const bvt &a, const bvt &b) |
| void | cond_implies_equal (literalt cond, const bvt &a, const bvt &b) |
| bvt | cond_negate (const bvt &bv, const literalt cond) |
| bvt | select (literalt s, const bvt &a, const bvt &b) |
| If s is true, selects a otherwise selects b. | |
| literalt | verilog_bv_has_x_or_z (const bvt &) |
| bvt | popcount (const bvt &bv) |
| Symbolic implementation of popcount (count of 1 bits in a bit vector) Based on the pop0 algorithm from Hacker's Delight. | |
Static Public Member Functions | |
| static bvt | build_constant (const mp_integer &i, std::size_t width) |
| static bvt | inverted (const bvt &op) |
| static bvt | shift (const bvt &op, const shiftt shift, std::size_t distance) |
| static literalt | sign_bit (const bvt &op) |
| static bool | is_constant (const bvt &bv) |
| static bvt | extension (const bvt &bv, std::size_t new_size, representationt rep) |
| static bvt | sign_extension (const bvt &bv, std::size_t new_size) |
| static bvt | zero_extension (const bvt &bv, std::size_t new_size) |
| static bvt | zeros (std::size_t new_size) |
| static bvt | extract (const bvt &a, std::size_t first, std::size_t last) |
| static bvt | extract_msb (const bvt &a, std::size_t n) |
| static bvt | extract_lsb (const bvt &a, std::size_t n) |
| static bvt | concatenate (const bvt &a, const bvt &b) |
| static bvt | verilog_bv_normal_bits (const bvt &) |
Protected Member Functions | |
| std::pair< bvt, literalt > | adder (const bvt &op0, const bvt &op1, literalt carry_in) |
Return the sum and carry-out when adding op0 and op1 under initial carry carry_in. | |
| bvt | adder_no_overflow (const bvt &op0, const bvt &op1, bool subtract, representationt rep) |
| bvt | adder_no_overflow (const bvt &op0, const bvt &op1) |
| bvt | unsigned_multiplier_no_overflow (const bvt &op0, const bvt &op1) |
| bvt | signed_multiplier_no_overflow (const bvt &op0, const bvt &op1) |
| bvt | cond_negate_no_overflow (const bvt &bv, const literalt cond) |
| bvt | wallace_tree (const std::vector< bvt > &pps) |
| bvt | dadda_tree (const std::vector< bvt > &pps) |
Protected Attributes | |
| propt & | prop |
Definition at line 23 of file bv_utils.h.
|
strong |
| Enumerator | |
|---|---|
| SIGNED | |
| UNSIGNED | |
Definition at line 28 of file bv_utils.h.
|
strong |
| Enumerator | |
|---|---|
| SHIFT_LEFT | |
| SHIFT_LRIGHT | |
| SHIFT_ARIGHT | |
| ROTATE_LEFT | |
| ROTATE_RIGHT | |
Definition at line 73 of file bv_utils.h.
|
inlineexplicit |
Definition at line 26 of file bv_utils.h.
Definition at line 1035 of file bv_utils.cpp.
Definition at line 66 of file bv_utils.h.
Definition at line 339 of file bv_utils.cpp.
Definition at line 351 of file bv_utils.cpp.
| bvt bv_utilst::add_sub_no_overflow | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| bool | subtract, | ||
| representationt | rep ) |
Definition at line 330 of file bv_utils.cpp.
|
nodiscardprotected |
Return the sum and carry-out when adding op0 and op1 under initial carry carry_in.
Definition at line 299 of file bv_utils.cpp.
Definition at line 512 of file bv_utils.cpp.
|
nodiscardprotected |
Definition at line 477 of file bv_utils.cpp.
|
static |
Definition at line 16 of file bv_utils.cpp.
Definition at line 232 of file bv_utils.cpp.
Definition at line 315 of file bv_utils.cpp.
Definition at line 81 of file bv_utils.cpp.
Definition at line 1646 of file bv_utils.cpp.
Definition at line 1022 of file bv_utils.cpp.
Definition at line 1041 of file bv_utils.cpp.
Definition at line 693 of file bv_utils.cpp.
| void bv_utilst::divider | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| bvt & | res, | ||
| bvt & | rem, | ||
| representationt | rep ) |
Definition at line 1140 of file bv_utils.cpp.
|
inline |
Definition at line 89 of file bv_utils.h.
Bit-blasting ID_equal and use in other encodings.
| op0 | Lhs bitvector to compare |
| op1 | Rhs bitvector to compare |
Definition at line 1370 of file bv_utils.cpp.
|
static |
Definition at line 110 of file bv_utils.cpp.
Definition at line 43 of file bv_utils.cpp.
Definition at line 71 of file bv_utils.cpp.
Definition at line 59 of file bv_utils.cpp.
| literalt bv_utilst::full_adder | ( | const literalt | a, |
| const literalt | b, | ||
| const literalt | carry_in, | ||
| literalt & | carry_out ) |
Definition at line 141 of file bv_utils.cpp.
Definition at line 33 of file bv_utils.h.
Definition at line 615 of file bv_utils.cpp.
Definition at line 630 of file bv_utils.cpp.
Definition at line 638 of file bv_utils.cpp.
Definition at line 158 of file bv_utils.h.
|
static |
Definition at line 1635 of file bv_utils.cpp.
Definition at line 149 of file bv_utils.h.
Definition at line 146 of file bv_utils.h.
Definition at line 27 of file bv_utils.cpp.
Definition at line 143 of file bv_utils.h.
| literalt bv_utilst::lt_or_le | ( | bool | or_equal, |
| const bvt & | bv0, | ||
| const bvt & | bv1, | ||
| representationt | rep ) |
Definition at line 1405 of file bv_utils.cpp.
| bvt bv_utilst::multiplier | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| representationt | rep ) |
Definition at line 1070 of file bv_utils.cpp.
| bvt bv_utilst::multiplier_no_overflow | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| representationt | rep ) |
Definition at line 1089 of file bv_utils.cpp.
Definition at line 590 of file bv_utils.cpp.
Definition at line 598 of file bv_utils.cpp.
| literalt bv_utilst::overflow_add | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| representationt | rep ) |
Definition at line 429 of file bv_utils.cpp.
Definition at line 604 of file bv_utils.cpp.
| literalt bv_utilst::overflow_sub | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| representationt | rep ) |
Definition at line 452 of file bv_utils.cpp.
Symbolic implementation of popcount (count of 1 bits in a bit vector) Based on the pop0 algorithm from Hacker's Delight.
| bv | The bit vector to count 1s in |
Definition at line 1703 of file bv_utils.cpp.
| literalt bv_utilst::rel | ( | const bvt & | bv0, |
| irep_idt | id, | ||
| const bvt & | bv1, | ||
| representationt | rep ) |
Definition at line 1613 of file bv_utils.cpp.
|
inline |
Definition at line 96 of file bv_utils.h.
| bvt bv_utilst::saturating_add_sub | ( | const bvt & | op0, |
| const bvt & | op1, | ||
| bool | subtract, | ||
| representationt | rep ) |
Definition at line 360 of file bv_utils.cpp.
If s is true, selects a otherwise selects b.
Definition at line 97 of file bv_utils.cpp.
Definition at line 36 of file bv_utils.cpp.
Definition at line 517 of file bv_utils.cpp.
Definition at line 538 of file bv_utils.cpp.
Definition at line 138 of file bv_utils.h.
Definition at line 182 of file bv_utils.h.
Definition at line 1105 of file bv_utils.cpp.
Definition at line 1606 of file bv_utils.cpp.
Definition at line 1004 of file bv_utils.cpp.
Definition at line 1048 of file bv_utils.cpp.
Definition at line 67 of file bv_utils.h.
Definition at line 1158 of file bv_utils.cpp.
Definition at line 1599 of file bv_utils.cpp.
Definition at line 920 of file bv_utils.cpp.
Definition at line 965 of file bv_utils.cpp.
Definition at line 1669 of file bv_utils.cpp.
Definition at line 1684 of file bv_utils.cpp.
Definition at line 646 of file bv_utils.cpp.
Definition at line 187 of file bv_utils.h.
|
inlinestatic |
Definition at line 192 of file bv_utils.h.
|
protected |
Definition at line 228 of file bv_utils.h.