1/*******************************************************************\
5Author: Daniel Kroening, kroening@kroening.com
7\*******************************************************************/
67 const typet &target_type,
140 const exprt &element,
142 const typet &element_type,
192 const typet &target_type,
229 // obtain a target pointer to initialize; if in MUST_UPDATE_IN_PLACE mode we
230 // initialize the fields of the object pointed by `expr`; if in
231 // NO_UPDATE_IN_PLACE then we allocate a new object, get a pointer to it
232 // (return value of `allocate_object`), emit a statement of the form
233 // `<expr> := address-of(<new-object>)` and recursively initialize such new
239 assignments, expr, target_type, lifetime,
"tmp_object_factory");
255 false,
// skip_classid
257 {},
// no override type
302 // We added something, so erase it when this is destroyed:
365 const std::size_t &min_nondet_string_length,
366 const std::size_t &max_nondet_string_length,
378 // We allow type StringBuffer and StringBuilder to be initialized
379 // in the same way has String, because they have the same structure and
380 // are treated in the same way by CBMC.
382 // Note that CharSequence cannot be used as classid because it's abstract,
383 // so it is replaced by String.
384 // \todo allow StringBuffer and StringBuilder as classid for Charsequence
385 if(
struct_type.get_tag() ==
"java.lang.CharSequence")
391 // OK, this is a String type with the expected fields -- add code to `code`
392 // to set up pre-requisite variables and assign them in `struct_expr`.
395 // length_expr = nondet(int);
402 // assume (length_expr >= min_nondet_string_length);
407 // assume (length_expr <= max_input_length)
409 max_nondet_string_length <=
433 // Printable ASCII characters are between ' ' and '~'.
486 // If we are changing the pointer, we generate code for creating a pointer
487 // to the substituted type instead
488 // TODO if we are comparing array types we need to compare their element
489 // types. this is for now done by implementing equality function especially
490 // for java types, technical debt TG-2707
493 // update generic_parameter_specialization_map for the new pointer
504 // Having created a pointer to object of type replacement_pointer_type
505 // we now assign it back to the original pointer with a cast
506 // from pointer_type to replacement_pointer_type
512 // This deletes the recursion set entry on leaving this function scope,
513 // if one is set below.
516 // We need to prevent the possibility of this code to loop infinitely when
517 // initializing a data structure with recursive types or unbounded depth. We
518 // implement two mechanisms here. We keep a set of 'types seen', and
519 // detect when we perform a 2nd visit to the same type. We also detect the
520 // depth in the chain of (recursive) calls to the methods of this class.
521 // The depth counter is incremented only when a pointer is deferenced,
522 // including pointers to arrays.
524 // When we visit for 2nd time a type AND the maximum depth is exceeded, we set
525 // the pointer to NULL instead of recursively initializing the struct to which
532 // If this is a recursive type of some kind AND the depth is exceeded, set
533 // the pointer to null.
543 // Otherwise leave it as it is.
547 // If we may be about to initialize a non-null enum type, always run the
548 // clinit_wrapper of its class first.
549 // TODO: TG-4689 we may want to do this for all types, not just enums, as
550 // described in the Java language specification:
551 // https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.7
552 // https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.4.1
553 // But we would have to put this behavior behind an option as it would have an
554 // impact on running times.
555 // Note that it would be more consistent with the behaviour of the JVM to only
556 // run clinit_wrapper if we are about to initialize an object of which we know
557 // for sure that it is not null on any following branch. However, adding this
558 // case in gen_nondet_struct_init would slow symex down too much, so if we
559 // decide to do this for all types, we should do it here.
560 // Note also that this logic is mirrored in
561 // ci_lazy_methodst::initialize_instantiated_classes.
566 if(
class_type->get_base(
"java::java.lang.Enum"))
578 // if the initialization mode is MAY_UPDATE or MUST_UPDATE in place, then we
579 // emit to `update_in_place_assignments` code for in-place initialization of
580 // the object pointed by `expr`, assuming that such object is of type
594 // if we MUST_UPDATE_IN_PLACE, then the job is done, we copy the code emitted
595 // above to `assignments` and return
602 // if the mode is NO_UPDATE or MAY_UPDATE in place, then we need to emit a
603 // vector of assignments that create a new object (recursively initializes it)
604 // and asign to `expr` the address of such object
623 // Add the following code to assignments:
631 // <expr> = <null pointer>
635 // <code from recursive call to gen_nondet_init() with
636 // tmp$<temporary_counter>>
646 // Similarly to above, maybe use a conditional if both the
647 // allocate-fresh and update-in-place cases are allowed:
655 "No-update and must-update should have already been resolved");
700 // Generate a new object into this new symbol
705 false,
// skip_classid
707 {},
// no override_type
727 const std::list<std::string> &string_input_values,
731 for(
const auto &
val : string_input_values)
778 const componentst &components=
struct_type.components();
780 // Should we write the whole object?
781 // * Not if this is a sub-structure (a superclass object), as our caller will
782 // have done this already
783 // * Not if the object has already been initialised by our caller, in which
784 // case they will set `skip_classid`
785 // * Not if we're re-initializing an existing object (i.e. update_in_place)
786 // * Always if it has a string type. Strings should not be partially updated,
787 // and the `length` and `data` components of string types need to be
788 // generated differently from object fields in the general case, see
789 // \ref java_object_factoryt::initialize_nondet_string_fields.
797 {
// We're dealing with a string and we should set fixed input values.
798 // We create a switch statement where each case is an assignment
799 // of one of the fixed input strings to the input variable in question
815 // Add an initial all-zero write. Most of the fields of this will be
816 // overwritten, but it helps to have a whole-structure write that analysis
817 // passes can easily recognise leaves no uninitialised state behind.
819 // This code mirrors the `remove_java_new` pass:
827 // If the initialised type is a special-cased String type (one with length
828 // and data fields introduced by string-library preprocessing), initialise
829 // those fields with nondet values
831 {
// We're dealing with a string
858 else if(name ==
"cproverMonitorCount")
860 // Zero-initialize 'cproverMonitorCount' field as it is not meant to be
861 // nondet. This field is only present when the java core models are
862 // included in the class-path. It is used to implement a critical section,
863 // which is necessary to support concurrency.
868 assignments.
add(code);
873 // In this case these were set up above.
878 INVARIANT(!name.
empty(),
"Each component of a struct must have a name");
882 // MUST_UPDATE_IN_PLACE only applies to this object.
883 // If this is a pointer to another object, offer the chance
884 // to leave it alone by setting MAY_UPDATE_IN_PLACE instead.
893 false,
// skip_classid
895 {},
// no override_type
902 // If cproverNondetInitialize() can be found in the symbol table as a method
903 // on this class or any parent, we add a call:
904 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
905 // expr.cproverNondetInitialize();
906 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
909 std::optional<resolve_inherited_componentt::inherited_componentt>
1011 // dereferenced type
1014 // If we are about to initialize a generic pointer type, add its concrete
1015 // types to the map and delete them on leaving this function scope.
1036 // If we are about to initialize a generic class (as a superclass object
1037 // for a different object), add its concrete types to the map and delete
1038 // them on leaving this function scope.
1044 const typet &symbol =
1064 // types different from pointer or structure:
1065 // bool, int, float, byte, char, ...
1072 assignments.
add(assign);
1078 // add assumes to obey numerical restrictions
1082 if(
auto singleton =
interval.as_singleton())
1142 const typet &element_type,
1149 "nondet_array_length",
1162 assignments.
add(assign);
1185 const typet &element_type,
1192 // TYPE (*array_data_init)[max_length_expr];
1196 // array_data_init = ALLOCATE(TYPE [max_length_expr], max_length_expr, false);
1201 assignments.
statements().back().add_source_location() = location;
1203 // *array_data_init = NONDET(TYPE [max_length_expr]);
1208 assignments.
statements().back().add_source_location() = location;
1210 // init_array_expr = *array_data_init;
1215 assignments.
statements().back().add_source_location() = location;
1228 const exprt &element,
1230 const typet &element_type,
1237 // Use a temporary to initialise a new, or update an existing, non-primitive.
1238 // This makes it clearer that in a sequence like
1239 // `new_array_item->x = y; new_array_item->z = w;` that all the
1240 // `new_array_item` references must alias, cf. the harder-to-analyse
1241 // `some_expr[idx]->x = y; some_expr[idx]->z = w;`
1250 element.
type(),
"new_array_item");
1252 // If we're updating an existing array item, read the existing object that
1258 // MUST_UPDATE_IN_PLACE only applies to this object.
1259 // If this is a pointer to another object, offer the chance
1260 // to leave it alone by setting MAY_UPDATE_IN_PLACE instead.
1269 false,
// skip_classid
1270 // These are variable in number, so use dynamic allocator:
1272 element_type,
// override
1279 // We used a temporary variable to update or initialise an array item;
1280 // now write it into the array:
1330 const typet &element_type,
1351 // Add a redundant if(counter == max_length) break
1352 // that is easier for the unwinder to understand.
1379 const size_t max_nondet_array_length)
1390 const typet &element_type =
static_cast<const typet &
>(
1395 // In NO_UPDATE_IN_PLACE mode we allocate a new array and recursively
1396 // initialize its elements
1408 // Otherwise we're updating the array in place, and use the
1409 // existing array allocation and length.
1413 "Java struct array does not conform to expectations");
1426 // For arrays of non-primitive type, nondeterministically initialize each
1427 // element of the array
1442 // Arrays of primitive type can be initialized with a single instruction.
1443 // We don't do this for arrays of primitive booleans, because booleans are
1444 // represented as unsigned bytes, so each cell must be initialized as
1445 // 0 or 1 (see gen_nondet_init).
1481 <<
" is missing, so the corresponding Enum "
1482 "type will nondet initialised"
1490 // Access members (length and data) of $VALUES array
1519 // In future we'll be able to use codet::validate for this;
1520 // at present that only verifies `lhs.type base_type_eq right.type`,
1521 // whereas we want to check exact equality.
1522 for(
const auto &code : assignments.
statements())
1528 assignment.lhs().type() == assignment.rhs().type(),
1529 "object factory should produce type-consistent assignments");
1568 loc, parameters, symbol_table, pointer_type_selector,
log);
1574 false,
// skip_classid
1576 {},
// no override_type
1634 loc, object_factory_parameters, symbol_table, pointer_type_selector,
log);
1642 {},
// no override_type
1670 object_factory_parameters,
1673 pointer_type_selector,
1697 object_factory_parameters,
1698 pointer_type_selector,
code_frontend_assignt make_allocate_code(const symbol_exprt &lhs, const exprt &size)
Create code allocating an object of size size and assigning it to lhs
lifetimet
Selects the kind of objects allocated.
@ DYNAMIC
Allocate dynamic objects (using ALLOCATE)
dereference_exprt array_element_from_pointer(const exprt &pointer, const exprt &index)
Generate statement using pointer arithmetic to access the element at the given index of a pointer arr...
static std::pair< symbol_exprt, code_with_references_listt > nondet_length(allocate_objectst &allocate, source_locationt loc)
Declare a non-deterministic length expression.
const integer_bitvector_typet & to_integer_bitvector_type(const typet &type)
Cast a typet to an integer_bitvector_typet.
pointer_typet pointer_type(const typet &subtype)
void set_class_identifier(struct_exprt &expr, const namespacet &ns, const struct_tag_typet &class_type)
If expr has its components filled in then sets the @class_identifier member of the struct.
Extract class identifier.
#define JAVA_CLASS_IDENTIFIER_FIELD_NAME
Operator to return the address of an object.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
void add_created_symbol(const symbolt &symbol)
Add a pointer to a symbol to the list of pointers to symbols created so far.
exprt allocate_object(code_blockt &assignments, const exprt &target_expr, const typet &allocate_type, const lifetimet lifetime, const irep_idt &basename_prefix="tmp")
Allocates a new object, either by creating a local variable with automatic lifetime,...
exprt allocate_automatic_local_object(code_blockt &assignments, const exprt &target_expr, const typet &allocate_type, const irep_idt &basename_prefix="tmp")
Creates a local variable with automatic lifetime.
void declare_created_symbols(code_blockt &init_code)
Adds declarations for all non-static symbols created.
A base class for relations, i.e., binary predicates whose two operands have the same type.
An assumption, which must hold in subsequent code.
A codet representing sequential composition of program statements.
code_operandst & statements()
void append(const code_blockt &extra_block)
Add all the codets from extra_block to the current code_blockt.
void add(const codet &code)
codet representation of a break statement (within a for or while loop).
A goto_instruction_codet representing the declaration of a local variable.
static code_fort from_index_bounds(exprt start_index, exprt end_index, symbol_exprt loop_index, codet body, source_locationt location)
Produce a code_fort representing:
A codet representing an assignment in the program.
goto_instruction_codet representation of a function call statement.
codet representation of an if-then-else statement.
Operator to dereference a pointer.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
const source_locationt & source_location() const
source_locationt & add_source_location()
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
const irep_idt & id() const
void gen_nondet_init(code_blockt &assignments, const exprt &expr, bool is_sub, bool skip_classid, lifetimet lifetime, const std::optional< typet > &override_type, size_t depth, update_in_placet, const source_locationt &location)
Initializes a primitive-typed or reference-typed object tree rooted at expr, allocating child objects...
generic_parameter_specialization_mapt generic_parameter_specialization_map
Every time the non-det generator visits a type and the type is generic (either a struct or a pointer)...
const java_object_factory_parameterst object_factory_parameters
allocate_objectst allocate_objects
void add_created_symbol(const symbolt &symbol)
std::unordered_set< irep_idt > recursion_set
This is employed in conjunction with the depth above.
const select_pointer_typet & pointer_type_selector
Resolves pointer types potentially using some heuristics, for example to replace pointers to interfac...
messaget log
Log for reporting warnings and errors in object creation.
symbol_table_baset & symbol_table
The symbol table.
symbol_exprt gen_nondet_subtype_pointer_init(code_blockt &assignments, lifetimet lifetime, const pointer_typet &substitute_pointer_type, size_t depth, const source_locationt &location)
Generate codet assignments to initalize the selected concrete type.
void declare_created_symbols(code_blockt &init_code)
void gen_pointer_target_init(code_blockt &assignments, const exprt &expr, const typet &target_type, lifetimet lifetime, size_t depth, update_in_placet update_in_place, const source_locationt &location)
Initializes the pointer-typed lvalue expression expr to point to an object of type target_type,...
bool gen_nondet_enum_init(code_blockt &assignments, const exprt &expr, const java_class_typet &java_class_type, const source_locationt &location)
We nondet-initialize enums to be equal to one of the constants defined for their type: int i = nondet...
java_object_factoryt(const source_locationt &loc, const java_object_factory_parameterst _object_factory_parameters, symbol_table_baset &_symbol_table, const select_pointer_typet &pointer_type_selector, message_handlert &log)
void gen_nondet_struct_init(code_blockt &assignments, const exprt &expr, bool is_sub, bool skip_classid, lifetimet lifetime, const struct_typet &struct_type, size_t depth, const update_in_placet &update_in_place, const source_locationt &location)
Initializes an object tree rooted at expr, allocating child objects as necessary and nondet-initializ...
void gen_nondet_pointer_init(code_blockt &assignments, const exprt &expr, lifetimet lifetime, const pointer_typet &pointer_type, size_t depth, const update_in_placet &update_in_place, const source_locationt &location)
Initializes a pointer expr of type pointer_type to a primitive-typed value or an object tree.
code_blockt assign_element(const exprt &element, update_in_placet update_in_place, const typet &element_type, size_t depth, const source_locationt &location)
Generate codet for assigning an individual element inside the array.
Extract member of struct or union.
Class that provides messages with a built-in verbosity 'level'.
mstreamt & warning() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
The null pointer constant.
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
const typet & base_type() const
The type of the data what we point to.
Recursion-set entry owner class.
recursion_set_entryt(const recursion_set_entryt &)=delete
recursion_set_entryt(std::unordered_set< irep_idt > &_recursion_set)
Initialize a recursion-set entry owner operating on a given set.
recursion_set_entryt & operator=(const recursion_set_entryt &)=delete
bool insert_entry(const irep_idt &entry)
Try to add an entry to the controlled set.
~recursion_set_entryt()
Removes erase_entry (if set) from the controlled set.
std::unordered_set< irep_idt > & recursion_set
Recursion set to modify.
irep_idt erase_entry
Entry to erase on destruction, if non-empty.
A side_effect_exprt that returns a non-deterministically chosen value.
An expression containing a side effect.
Struct constructor from list of elements.
A struct tag type, i.e., struct_typet with an identifier.
Structure type, corresponds to C style structs.
std::vector< componentt > componentst
Expression to hold a symbol (variable)
The symbol table base class interface.
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
bool has_symbol(const irep_idt &name) const
Check whether a symbol exists in the symbol table.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
Semantic type conversion.
The type of an expression, extends irept.
std::optional< exprt > zero_initializer(const typet &type, const source_locationt &source_location, const namespacet &ns)
Create the equivalent of zero for type type.
Expression Initialization.
symbolt & get_fresh_aux_symbol(const typet &type, const std::string &name_prefix, const std::string &basename_prefix, const source_locationt &source_location, const irep_idt &symbol_mode, const namespacet &ns, symbol_table_baset &symbol_table)
Installs a fresh-named symbol with respect to the given namespace ns with the requested name pattern ...
Fresh auxiliary symbol creation.
Goto Programs with Functions.
exprt interval_constraint(const exprt &expr, const integer_intervalt &interval)
Given an exprt and an integer interval return an exprt that represents restricting the expression to ...
const std::string & id2string(const irep_idt &d)
static void assert_type_consistency(const code_blockt &assignments)
void initialize_nondet_string_fields(struct_exprt &struct_expr, code_blockt &code, const std::size_t &min_nondet_string_length, const std::size_t &max_nondet_string_length, const source_locationt &loc, const irep_idt &function_id, symbol_table_baset &symbol_table, bool printable, allocate_objectst &allocate_objects)
Initialise length and data fields for a nondeterministic String structure.
void gen_nondet_init(const exprt &expr, code_blockt &init_code, symbol_table_baset &symbol_table, const source_locationt &loc, bool skip_classid, lifetimet lifetime, const java_object_factory_parameterst &object_factory_parameters, const select_pointer_typet &pointer_type_selector, update_in_placet update_in_place, message_handlert &log)
Initializes a primitive-typed or reference-typed object tree rooted at expr, allocating child objects...
exprt object_factory(const typet &type, const irep_idt base_name, code_blockt &init_code, symbol_table_baset &symbol_table, java_object_factory_parameterst parameters, lifetimet lifetime, const source_locationt &loc, const select_pointer_typet &pointer_type_selector, message_handlert &log)
Similar to gen_nondet_init below, but instead of allocating and non-deterministically initializing th...
static void array_primitive_init_code(code_blockt &assignments, const exprt &init_array_expr, const typet &element_type, const exprt &max_length_expr, const source_locationt &location, const allocate_local_symbolt &allocate_local_symbol)
Create code to nondeterministically initialize arrays of primitive type.
static void allocate_nondet_length_array(code_blockt &assignments, const exprt &lhs, const exprt &max_length_expr, const typet &element_type, const allocate_local_symbolt &allocate_local_symbol, const source_locationt &location)
Allocates a fresh array and emits an assignment writing to lhs the address of the new array.
static irep_idt integer_interval_to_string(const integer_intervalt &interval)
Converts and integer_intervalt to a a string of the for [lower]-[upper].
static code_blockt assume_expr_integral(const exprt &expr, const typet &type, const source_locationt &location, const allocate_local_symbolt &allocate_local_symbol)
Generate code block that verifies that an expression of type float or double has integral value.
const integer_intervalt printable_char_range(' ', '~')
Interval that represents the printable character range range U+0020-U+007E, i.e.
static void array_loop_init_code(code_blockt &assignments, const exprt &init_array_expr, const exprt &length_expr, const typet &element_type, const exprt &max_length_expr, update_in_placet update_in_place, const source_locationt &location, const array_element_generatort &element_generator, const allocate_local_symbolt &allocate_local_symbol, const symbol_table_baset &symbol_table)
Create code to nondeterministically initialize each element of an array in a loop.
code_blockt gen_nondet_array_init(const exprt &expr, update_in_placet update_in_place, const source_locationt &location, const array_element_generatort &element_generator, const allocate_local_symbolt &allocate_local_symbol, const symbol_table_baset &symbol_table, const size_t max_nondet_array_length)
Synthesize GOTO for generating a array of nondet length to be stored in the expr.
alternate_casest get_string_input_values_code(const exprt &expr, const std::list< std::string > &string_input_values, symbol_table_baset &symbol_table)
Creates an alternate_casest vector in which each item contains an assignment of a string from string_...
This module is responsible for the synthesis of code (in the form of a sequence of codet statements) ...
std::function< code_blockt(const exprt &element_at_counter, const typet &element_type)> array_element_generatort
irep_idt clinit_wrapper_name(const irep_idt &class_name)
Get the Java static initializer wrapper name for a given class (the wrapper checks if static initiali...
void add_character_set_constraint(const exprt &pointer, const exprt &length, const irep_idt &char_range, symbol_table_baset &symbol_table, const source_locationt &loc, const irep_idt &function_id, code_blockt &code)
Add a call to a primitive of the string solver which ensures all characters belong to the character s...
void add_array_to_length_association(const exprt &array, const exprt &length, symbol_table_baset &symbol_table, const source_locationt &loc, const irep_idt &function_id, code_blockt &code)
Add a call to a primitive of the string solver, letting it know that the actual length of array is le...
exprt make_nondet_infinite_char_array(symbol_table_baset &symbol_table, const source_locationt &loc, const irep_idt &function_id, code_blockt &code)
Declare a fresh symbol of type array of character with infinite size.
void add_pointer_to_array_association(const exprt &pointer, const exprt &array, symbol_table_baset &symbol_table, const source_locationt &loc, const irep_idt &function_id, code_blockt &code)
Add a call to a primitive of the string solver, letting it know that pointer points to the first char...
Produce code for simple implementation of String Java libraries.
symbol_exprt get_or_create_string_literal_symbol(const java_string_literal_exprt &string_expr, symbol_table_baset &symbol_table, bool string_refinement_enabled)
Creates or gets an existing constant global symbol for a given string literal.
signedbv_typet java_int_type()
bool is_valid_java_array(const struct_typet &type)
Programmatic documentation of the structure of a Java array (of either primitives or references) type...
bool equal_java_types(const typet &type1, const typet &type2)
Compares the types, including checking element types if both types are arrays.
floatbv_typet java_double_type()
floatbv_typet java_float_type()
c_bool_typet java_boolean_type()
unsignedbv_typet java_char_type()
const java_class_typet & to_java_class_type(const typet &type)
bool is_java_string_type(const struct_typet &struct_type)
Returns true iff the argument represents a string type (CharSequence, StringBuilder,...
code_blockt generate_nondet_switch(const irep_idt &name_prefix, const alternate_casest &switch_cases, const typet &int_type, const irep_idt &mode, const source_locationt &source_location, symbol_table_baset &symbol_table)
Pick nondeterministically between imperative actions 'switch_cases'.
symbol_exprt generate_nondet_int(const exprt &min_value_expr, const exprt &max_value_expr, const std::string &basename_prefix, const source_locationt &source_location, allocate_objectst &allocate_objects, code_blockt &instructions)
Same as generate_nondet_int( const mp_integer &min_value, const mp_integer &max_value,...
std::vector< codet > alternate_casest
std::function< symbol_exprt(const typet &type, std::string)> allocate_local_symbolt
Nondeterministic boolean helper.
exprt get_nondet_bool(const typet &type, const source_locationt &source_location)
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
Handle selection of correct pointer type (for example changing abstract classes to concrete versions)...
exprt deref_expr(const exprt &expr)
Wraps a given expression into a dereference_exprt unless it is an address_of_exprt in which case it j...
#define CHECK_RETURN(CONDITION)
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
const code_frontend_assignt & to_code_frontend_assign(const codet &code)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const struct_exprt & to_struct_expr(const exprt &expr)
Cast an exprt to a struct_exprt.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
irep_idt function_id
Function id, used as a prefix for identifiers of temporaries.
const type_with_subtypet & to_type_with_subtype(const typet &type)