cprover
mp_arith.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_UTIL_MP_ARITH_H
11 #define CPROVER_UTIL_MP_ARITH_H
12 
13 #include <iosfwd>
14 #include <string>
15 
16 #include "big-int/bigint.hh"
17 
18 // NOLINTNEXTLINE(readability/identifiers)
19 typedef BigInt mp_integer;
20 
21 std::ostream &operator<<(std::ostream &, const mp_integer &);
22 mp_integer operator>>(const mp_integer &, const mp_integer &);
23 mp_integer operator<<(const mp_integer &, const mp_integer &);
24 mp_integer bitwise_or(const mp_integer &, const mp_integer &);
27 
29  const mp_integer &, const mp_integer &, std::size_t true_size);
30 
32  const mp_integer &, const mp_integer &, std::size_t true_size);
33 
35  const mp_integer &, const mp_integer &, std::size_t true_size);
36 
38  const mp_integer &, const mp_integer &, std::size_t true_size);
39 
41  const mp_integer &, const mp_integer &, std::size_t true_size);
42 
44  const mp_integer &, const mp_integer &, std::size_t true_size);
45 
46 const std::string integer2string(const mp_integer &, unsigned base=10);
47 const mp_integer string2integer(const std::string &, unsigned base=10);
48 const std::string integer2binary(const mp_integer &, std::size_t width);
49 const mp_integer binary2integer(const std::string &, bool is_signed);
50 
51 #endif // CPROVER_UTIL_MP_ARITH_H
rotate_left
mp_integer rotate_left(const mp_integer &, const mp_integer &, std::size_t true_size)
rotate left (LSB=MSB) bitwise operations only make sense on native objects, hence the largest object ...
Definition: mp_arith.cpp:358
string2integer
const mp_integer string2integer(const std::string &, unsigned base=10)
Definition: mp_arith.cpp:57
mp_integer
BigInt mp_integer
Definition: mp_arith.h:19
is_signed
bool is_signed(const typet &t)
Convenience function – is the type signed?
Definition: util.cpp:45
arith_left_shift
mp_integer arith_left_shift(const mp_integer &, const mp_integer &, std::size_t true_size)
arithmetic left shift bitwise operations only make sense on native objects, hence the largest object ...
Definition: mp_arith.cpp:256
bitwise_or
mp_integer bitwise_or(const mp_integer &, const mp_integer &)
bitwise 'or' of two nonnegative integers
Definition: mp_arith.cpp:218
rotate_right
mp_integer rotate_right(const mp_integer &, const mp_integer &, std::size_t true_size)
rotates right (MSB=LSB) bitwise operations only make sense on native objects, hence the largest objec...
Definition: mp_arith.cpp:338
binary2integer
const mp_integer binary2integer(const std::string &, bool is_signed)
convert binary string representation to mp_integer
Definition: mp_arith.cpp:120
operator>>
mp_integer operator>>(const mp_integer &, const mp_integer &)
Definition: mp_arith.cpp:25
bitwise_xor
mp_integer bitwise_xor(const mp_integer &, const mp_integer &)
bitwise 'xor' of two nonnegative integers
Definition: mp_arith.cpp:242
operator<<
std::ostream & operator<<(std::ostream &, const mp_integer &)
Definition: mp_arith.cpp:48
integer2string
const std::string integer2string(const mp_integer &, unsigned base=10)
Definition: mp_arith.cpp:106
logic_right_shift
mp_integer logic_right_shift(const mp_integer &, const mp_integer &, std::size_t true_size)
logic right shift (loads 0 on MSB) bitwise operations only make sense on native objects,...
Definition: mp_arith.cpp:322
integer2binary
const std::string integer2binary(const mp_integer &, std::size_t width)
Definition: mp_arith.cpp:67
logic_left_shift
mp_integer logic_left_shift(const mp_integer &, const mp_integer &, std::size_t true_size)
logic left shift bitwise operations only make sense on native objects, hence the largest object size ...
Definition: mp_arith.cpp:296
arith_right_shift
mp_integer arith_right_shift(const mp_integer &, const mp_integer &, std::size_t true_size)
arithmetic right shift (loads sign on MSB) bitwise operations only make sense on native objects,...
Definition: mp_arith.cpp:277
bitwise_and
mp_integer bitwise_and(const mp_integer &, const mp_integer &)
bitwise 'and' of two nonnegative integers
Definition: mp_arith.cpp:230