13 #ifndef CPROVER_UTIL_TYPE_H
14 #define CPROVER_UTIL_TYPE_H
36 #if !defined(__GLIBCXX__) || __GLIBCXX__ >= 20181026
38 :
irept(std::move(_id), {}, {std::move(_subtype)})
58 return static_cast<typet &
>(sub.front());
86 if(location.is_not_nil())
88 return std::move(*
this);
94 if(location.is_not_nil())
110 if(location.is_not_nil())
117 return static_cast<typet &
>(
add(name));
122 return static_cast<const typet &
>(
find(name));
170 const typet &subtype =
static_cast<const typet &
>(sub);
183 :
typet(std::move(_id), std::move(_subtype))
204 vm, type.
get_sub().size() == 1,
"type must have one type parameter");
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
const irept & find(const irep_idt &name) 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...
Type with multiple subtypes.
type_with_subtypest(const irep_idt &_id, const subtypest &_subtypes)
void move_to_subtypes(typet &type)
Move the provided type to the subtypes of this type.
std::vector< typet > subtypest
type_with_subtypest(const irep_idt &_id, subtypest &&_subtypes)
void copy_to_subtypes(const typet &type)
Copy the provided type to the subtypes of this type.
const subtypest & subtypes() const
Type with a single subtype.
const typet & subtype() const
static void check(const typet &type, const validation_modet vm=validation_modet::INVARIANT)
type_with_subtypet(irep_idt _id, typet _subtype)
The type of an expression, extends irept.
const source_locationt & source_location() const
typet & with_source_location(const typet &type) &
This is a 'fluent style' method for adding a source location.
typet(irep_idt _id, typet _subtype)
typet(const irep_idt &_id)
typet & add_type(const irep_idt &name)
static void validate_full(const typet &type, const namespacet &ns, const validation_modet vm=validation_modet::INVARIANT)
Check that the type is well-formed (full check, including checks of subtypes)
bool has_subtypes() const
const typet & find_type(const irep_idt &name) const
typet && with_source_location(source_locationt location) &&
This is a 'fluent style' method for creating a new type with an added-on source location.
typet && with_source_location(const typet &type) &&
This is a 'fluent style' method for creating a new type with an added-on source location.
typet & with_source_location(source_locationt location) &
This is a 'fluent style' method for adding a source location.
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)
static void validate(const typet &type, const namespacet &, const validation_modet vm=validation_modet::INVARIANT)
Check that the type is well-formed, assuming that its subtypes have already been checked for well-for...
source_locationt & add_source_location()
const type_with_subtypest & to_type_with_subtypes(const typet &type)
const type_with_subtypet & to_type_with_subtype(const typet &type)
typet remove_const(typet type)
Remove const qualifier from type (if any).
#define DATA_CHECK(vm, condition, message)
This macro takes a condition which denotes a well-formedness criterion on goto programs,...
void check_type(const typet &type, const validation_modet vm)
Check that the given type is well-formed (shallow checks only, i.e., subtypes are not checked)
void validate_type(const typet &type, const namespacet &ns, const validation_modet vm)
Check that the given type is well-formed, assuming that its subtypes have already been checked for we...
void validate_full_type(const typet &type, const namespacet &ns, const validation_modet vm)
Check that the given type is well-formed (full check, including checks of subtypes)