30 if(type_id==ID_pointer)
38 else if(type_id==ID_integer ||
44 else if(type_id==ID_unsignedbv)
49 else if(type_id==ID_signedbv)
54 else if(type_id==ID_c_bool)
59 else if(type_id==ID_c_enum)
62 if(subtype.
id()==ID_signedbv)
67 else if(subtype.
id()==ID_unsignedbv)
73 else if(type_id==ID_c_bit_field)
76 if(subtype.
id()==ID_signedbv)
81 else if(subtype.
id()==ID_unsignedbv)
114 if(type_id==ID_integer)
120 else if(type_id==ID_natural)
132 else if(type_id==ID_unsignedbv)
139 else if(type_id==ID_bv)
146 else if(type_id==ID_signedbv)
153 else if(type_id==ID_c_enum)
155 const std::size_t width =
161 else if(type_id==ID_c_bool)
168 else if(type_id==ID_bool)
172 else if(int_value==1)
175 else if(type_id==ID_pointer)
180 else if(type_id==ID_c_bit_field)
187 else if(type_id==ID_fixedbv)
194 else if(type_id==ID_floatbv)
216 std::size_t result = 1;
218 for(
mp_integer x = 2; x < size; ++result, x *= 2) {}
220 INVARIANT(
power(2, result) >= size,
"address_bits(size) >= log2(size)");
237 if(base.is_long() && exponent.is_long())
239 switch(base.to_long())
244 result.setPower2(exponent.to_ulong());
261 if(exponent.is_odd())
The type of an expression.
const std::string & id2string(const irep_idt &d)
const mp_integer string2integer(const std::string &n, unsigned base)
const std::string integer2string(const mp_integer &n, unsigned base)
const signedbv_typet & to_signedbv_type(const typet &type)
Cast a generic typet to a signedbv_typet.
constant_exprt to_expr() const
const irep_idt & get_value() const
The null pointer constant.
const mp_integer binary2integer(const std::string &n, bool is_signed)
convert binary string representation to mp_integer
A constant literal expression.
#define INVARIANT(CONDITION, REASON)
const c_bool_typet & to_c_bool_type(const typet &type)
Cast a generic typet to a c_bool_typet.
const irep_idt & id() const
void set_value(const irep_idt &value)
The boolean constant true.
void from_integer(const mp_integer &i)
API to expression classes.
#define PRECONDITION(CONDITION)
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
constant_exprt to_expr() const
const constant_exprt & to_constant_expr(const exprt &expr)
Cast a generic exprt to a constant_exprt.
const bv_typet & to_bv_type(const typet &type)
Cast a generic typet to a bv_typet.
The boolean constant false.
std::size_t get_width() const
unsigned integer2unsigned(const mp_integer &n)
const unsignedbv_typet & to_unsignedbv_type(const typet &type)
Cast a generic typet to an unsignedbv_typet.
const floatbv_typet & to_floatbv_type(const typet &type)
Cast a generic typet to a floatbv_typet.
const fixedbv_typet & to_fixedbv_type(const typet &type)
Cast a generic typet to a fixedbv_typet.
Base class for all expressions.
const std::string integer2binary(const mp_integer &n, std::size_t width)
void from_integer(const mp_integer &i)
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a generic typet to a c_bit_field_typet.
const pointer_typet & to_pointer_type(const typet &type)
Cast a generic typet to a pointer_typet.
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a generic typet to a c_enum_typet.
const typet & subtype() const
std::size_t get_size_t(const irep_namet &name) const