10 #ifndef CPROVER_UTIL_C_TYPES_H
11 #define CPROVER_UTIL_C_TYPES_H
69 return type.
id() == ID_c_bit_field;
117 return type.
id() == ID_c_bool;
163 std::optional<std::pair<struct_union_typet::componentt, mp_integer>>
173 return type.
id() == ID_union;
213 return type.
id() == ID_union_tag;
251 return get(ID_value);
255 set(ID_value, value);
259 return get(ID_identifier);
263 set(ID_identifier, identifier);
267 return get(ID_base_name);
271 set(ID_base_name, base_name);
280 members() = std::move(enum_members);
302 set(ID_incomplete,
true);
324 return type.
id() == ID_c_enum;
366 return type.
id() == ID_c_enum_tag;
398 :
code_typet(std::move(_parameters), std::move(_return_type))
410 return static_cast<const exprt &
>(
find(ID_C_spec_assigns)).operands();
415 return static_cast<exprt &
>(
add(ID_C_spec_assigns)).operands();
420 return static_cast<const exprt &
>(
find(ID_C_spec_frees)).operands();
425 return static_cast<exprt &
>(
add(ID_C_spec_frees)).operands();
430 return static_cast<const exprt &
>(
find(ID_C_spec_requires)).operands();
435 return static_cast<exprt &
>(
add(ID_C_spec_requires)).operands();
440 return static_cast<const exprt &
>(
find(ID_C_spec_ensures)).operands();
445 return static_cast<exprt &
>(
add(ID_C_spec_ensures)).operands();
455 return type.
id() == ID_code;
floatbv_typet float_type()
signedbv_typet signed_long_int_type()
signedbv_typet signed_char_type()
bool can_cast_type< c_bit_field_typet >(const typet &type)
Check whether a reference to a typet is a c_bit_field_typet.
unsignedbv_typet unsigned_int_type()
unsignedbv_typet unsigned_long_long_int_type()
bool can_cast_type< c_bool_typet >(const typet &type)
Check whether a reference to a typet is a c_bool_typet.
unsignedbv_typet char32_t_type()
bool can_cast_type< union_typet >(const typet &type)
Check whether a reference to a typet is a union_typet.
unsignedbv_typet unsigned_long_int_type()
bool can_cast_type< c_enum_tag_typet >(const typet &type)
Check whether a reference to a typet is a c_enum_tag_typet.
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a typet to a c_enum_typet.
bool can_cast_type< c_enum_typet >(const typet &type)
Check whether a reference to a typet is a c_enum_typet.
unsignedbv_typet size_type()
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const c_bit_field_typet & to_c_bit_field_type(const typet &type)
Cast a typet to a c_bit_field_typet.
signedbv_typet signed_int_type()
const code_with_contract_typet & to_code_with_contract_type(const typet &type)
Cast a typet to a code_with_contract_typet.
signedbv_typet pointer_diff_type()
unsignedbv_typet unsigned_char_type()
signedbv_typet signed_size_type()
const union_typet & to_union_type(const typet &type)
Cast a typet to a union_typet.
bitvector_typet char_type()
signedbv_typet signed_long_long_int_type()
pointer_typet pointer_type(const typet &)
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
bitvector_typet wchar_t_type()
floatbv_typet long_double_type()
bool can_cast_type< union_tag_typet >(const typet &type)
Check whether a reference to a typet is a union_tag_typet.
bitvector_typet c_index_type()
reference_typet reference_type(const typet &)
floatbv_typet double_type()
bool can_cast_type< code_with_contract_typet >(const typet &type)
Check whether a reference to a typet is a code_typet.
signedbv_typet signed_short_int_type()
unsignedbv_typet unsigned_short_int_type()
const c_bool_typet & to_c_bool_type(const typet &type)
Cast a typet to a c_bool_typet.
unsignedbv_typet char16_t_type()
std::string c_type_as_string(const irep_idt &)
Base class of fixed-width bit-vector types.
std::size_t width() const
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
Type for C bit fields These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (...
c_bit_field_typet(typet _subtype, std::size_t width)
typet & underlying_type()
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
const typet & subtype() const
const typet & underlying_type() const
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
c_bool_typet(std::size_t width)
C enum tag type, i.e., c_enum_typet with an identifier.
c_enum_tag_typet(const irep_idt &identifier)
void set_identifier(const irep_idt &identifier)
void set_value(const irep_idt &value)
irep_idt get_identifier() const
irep_idt get_base_name() const
void set_base_name(const irep_idt &base_name)
irep_idt get_value() const
c_enum_typet(typet _subtype, memberst enum_members)
typet & underlying_type()
const memberst & members() const
void make_incomplete()
enum types may be incomplete
const typet & underlying_type() const
std::vector< c_enum_membert > memberst
c_enum_typet(typet _subtype)
bool is_incomplete() const
enum types may be incomplete
std::vector< parametert > parameterst
const exprt::operandst & c_assigns() const
const exprt::operandst & c_requires() const
exprt::operandst & c_assigns()
const exprt::operandst & c_frees() const
exprt::operandst & c_ensures()
exprt::operandst & c_frees()
exprt::operandst & c_requires()
const exprt::operandst & c_ensures() const
bool has_contract() const
code_with_contract_typet(parameterst _parameters, typet _return_type)
Constructs a new 'code with contract' type, i.e., a function type decorated with a function contract.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
Fixed-width bit-vector with IEEE floating-point interpretation.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool get_bool(const irep_idt &name) const
const irept & find(const irep_idt &name) const
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
Fixed-width bit-vector with two's complement interpretation.
A struct or union tag type.
Base type for structs and unions.
std::vector< componentt > componentst
A tag-based type, i.e., typet with an identifier.
Type with a single subtype.
const typet & subtype() const
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
The type of an expression, extends irept.
static void check(const typet &, const validation_modet=validation_modet::INVARIANT)
Check that the type is well-formed (shallow checks only, i.e., subtypes are not checked)
A union tag type, i.e., union_typet with an identifier.
union_tag_typet(const irep_idt &identifier)
union_typet(componentst _components)
std::optional< std::pair< struct_union_typet::componentt, mp_integer > > find_widest_union_component(const namespacet &ns) const
Determine the member of maximum bit width in a union type.
Fixed-width bit-vector with unsigned binary interpretation.
API to expression classes for Pointers.
#define PRECONDITION(CONDITION)
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...