Go to the documentation of this file.
30 bool _assume_non_null,
41 const typet &expected_type,
46 unsigned insert_before_index,
48 bool update_in_place);
82 const typet &expected_type,
87 const unsigned insert_before_index,
89 const bool update_in_place)
96 expected_type.
id() == ID_pointer,
97 "Nondet initializer result type: expected a pointer",
102 const auto &expected_base =
104 if(expected_base.id() != ID_struct)
107 const exprt cast_ptr =
110 exprt to_init = cast_ptr;
138 auto insert_position = parent_block.
statements().begin();
139 std::advance(insert_position, insert_before_index);
161 for(
auto ¶meter : required_type.
parameters())
163 if(parameter.get_identifier().empty())
168 synthesized_source_location,
172 parameter.set_base_name(parameter_symbol.
base_name);
173 parameter.set_identifier(parameter_symbol.
name);
183 const auto &this_argument = required_type.
parameters()[0];
184 const typet &this_type = this_argument.type();
188 synthesized_source_location,
193 init_symbol_expression,
194 symbol_exprt(this_argument.get_identifier(), this_type));
196 new_instructions.
add(get_argument);
199 init_symbol_expression,
200 synthesized_source_location,
213 required_return_type,
215 synthesized_source_location,
219 if(to_return_symbol.
type.
id() != ID_pointer)
238 required_return_type,
240 synthesized_source_location,
250 symbol.
value = new_instructions;
260 sym.
type.
id() == ID_code &&
267 "java::java.lang.Object.monitorenter:(Ljava/lang/Object;)V" &&
269 "java::java.lang.Object.monitorexit:(Ljava/lang/Object;)V")
278 bool assume_non_null,
283 symbol_table, assume_non_null, object_factory_parameters, message_handler);
299 bool assume_non_null,
309 std::vector<irep_idt> identifiers;
310 identifiers.reserve(symbol_table.
symbols.size());
311 for(
const auto &symbol : symbol_table)
312 identifiers.push_back(symbol.first);
315 symbol_table, assume_non_null, object_factory_parameters, message_handler);
317 for(
const auto &identifier : identifiers)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A codet representing sequential composition of program statements.
const symbolt & lookup_ref(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
message_handlert & message_handler
void set_function(const irep_idt &function)
@ AUTOMATIC_LOCAL
Allocate local objects with automatic lifetime.
The type of an expression, extends irept.
typet type
Type of symbol.
Operator to dereference a pointer.
irep_idt function_id
Function id, used as a prefix for identifiers of temporaries.
void java_generate_simple_method_stubs(symbol_table_baset &symbol_table, bool assume_non_null, const java_object_factory_parameterst &object_factory_parameters, message_handlert &message_handler)
Generates function stubs for most undefined functions in the symbol table, except as forbidden in jav...
void check_method_stub(const irep_idt &)
Replaces sym with a function stub per the function above if it is of suitable type.
Base class for all expressions.
exprt make_clean_pointer_cast(const exprt &rawptr, const pointer_typet &target_type, const namespacet &ns)
irep_idt base_name
Base (non-scoped) name.
Expression to hold a symbol (variable)
bool get_is_constructor() const
java_simple_method_stubst(symbol_table_baset &_symbol_table, bool _assume_non_null, const java_object_factory_parameterst &_object_factory_parameters, message_handlert &_message_handler)
code_operandst & statements()
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
void create_method_stub_at(const typet &expected_type, const exprt &ptr, const source_locationt &loc, const irep_idt &function_id, code_blockt &parent_block, unsigned insert_before_index, bool is_constructor, bool update_in_place)
Nondet-initialize an object, including allocating referees for reference fields and nondet-initialisi...
static std::unordered_set< irep_idt > init_symbol(const symbolt &sym, code_blockt &code_block, symbol_table_baset &symbol_table, const source_locationt &source_location, bool assume_init_pointers_not_null, const java_object_factory_parameterst &object_factory_parameters, const select_pointer_typet &pointer_type_selector, bool string_refinement_enabled, message_handlert &message_handler)
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
The symbol table base class interface.
void create_method_stub(symbolt &symbol)
Replaces sym's value with an opaque method stub.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
A codet representing an assignment in the program.
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...
const irep_idt & id() const
void add(const codet &code)
const parameterst & parameters() const
symbolt & fresh_java_symbol(const typet &type, const std::string &basename_prefix, const source_locationt &source_location, const irep_idt &function_name, symbol_table_baset &symbol_table)
size_t min_null_tree_depth
To force a certain depth of non-null objects.
codet representation of a "return from a function" statement.
exprt value
Initial value of symbol.
void java_generate_simple_method_stub(const irep_idt &function_name, symbol_table_baset &symbol_table, bool assume_non_null, const java_object_factory_parameterst &object_factory_parameters, message_handlert &message_handler)
symbol_table_baset & symbol_table
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
@ DYNAMIC
Allocate dynamic objects (using ALLOCATE)
const typet & return_type() const
source_locationt & add_source_location()
const java_method_typet & to_java_method_type(const typet &type)
empty_typet java_void_type()
static bool is_constructor(const irep_idt &method_name)
irep_idt name
The unique identifier.
const java_object_factory_parameterst & object_factory_parameters
#define INVARIANT_WITH_IREP(CONDITION, DESCRIPTION, IREP)
Equivalent to INVARIANT_STRUCTURED(CONDITION, invariant_failedt, pretty_print_invariant_with_irep(IRE...