#include "java_object_factory.h"#include <util/arith_tools.h>#include <util/array_element_from_pointer.h>#include <util/expr_initializer.h>#include <util/fresh_symbol.h>#include <util/interval_constraint.h>#include <util/message.h>#include <util/nondet_bool.h>#include <util/symbol_table_base.h>#include <goto-programs/class_identifier.h>#include <goto-programs/goto_functions.h>#include "generic_parameter_specialization_map_keys.h"#include "java_object_factory_parameters.h"#include "java_static_initializers.h"#include "java_string_library_preprocess.h"#include "java_string_literals.h"#include "java_utils.h"#include "select_pointer_type.h"Go to the source code of this file.
string_input_values (or more precisely the literal symbol corresponding to the string) to expr. lhs the address of the new array. expr. gen_nondet_init below, but instead of allocating and non-deterministically initializing the the argument expr passed to that function, we create a static global object of type type and non-deterministically initialize it. expr, allocating child objects as necessary and nondet-initializing their members, or if MAY_ or MUST_UPDATE_IN_PLACE is set, re-initializing already-allocated objects. Allocates a fresh array and emits an assignment writing to lhs the address of the new array.
Single-use at the moment, but useful to keep as a separate function for downstream branches.
Definition at line 1138 of file java_object_factory.cpp.
Create code to nondeterministically initialize each element of an array in a loop.
The code produced is of the form (supposing an array of type OBJ):
expr from scratch MAY_UPDATE_IN_PLACE: generate a runtime nondet branch between the NO_ and MUST_ cases. MUST_UPDATE_IN_PLACE: reinitialize an existing object Definition at line 1326 of file java_object_factory.cpp.
Create code to nondeterministically initialize arrays of primitive type.
The code produced is of the form (for an array of type TYPE):
Definition at line 1182 of file java_object_factory.cpp.
Definition at line 1517 of file java_object_factory.cpp.
Generate code block that verifies that an expression of type float or double has integral value.
For example, for a float expression floatVal we generate: int assume_integral_tmp; assume_integral_tmp = NONDET(int); ASSUME FLOAT_TYPECAST(assume_integral_tmp, float, __CPROVER_rounding_mode) == floatVal
Definition at line 937 of file java_object_factory.cpp.
Synthesize GOTO for generating a array of nondet length to be stored in the expr.
Definition at line 1372 of file java_object_factory.cpp.
Initializes a primitive-typed or reference-typed object tree rooted at expr, allocating child objects as necessary and nondet-initializing their members, or if MAY_ or MUST_UPDATE_IN_PLACE is set, re-initializing already-allocated objects.
expr and child objects it refers to. init_code will be inserted to. This includes any necessary temporaries, and if create_dyn_objs is false, any allocated objects. @class_identifier. expr from scratch MAY_UPDATE_IN_PLACE: generate a runtime nondet branch between the NO_ and MUST_ cases. MUST_UPDATE_IN_PLACE: reinitialize an existing object Definition at line 1621 of file java_object_factory.cpp.
Call gen_nondet_init() above with a default (identity) pointer_type_selector.
Definition at line 1678 of file java_object_factory.cpp.
Creates an alternate_casest vector in which each item contains an assignment of a string from string_input_values (or more precisely the literal symbol corresponding to the string) to expr.
Definition at line 725 of file java_object_factory.cpp.
Initialise length and data fields for a nondeterministic String structure.
If the structure is not a nondeterministic structure, the call results in a precondition violation.
The code produced is of the form:
Unit tests in unit/java_bytecode/java_object_factory/ ensure it is the case.
Definition at line 362 of file java_object_factory.cpp.
Converts and integer_intervalt to a a string of the for [lower]-[upper].
Definition at line 314 of file java_object_factory.cpp.
Call object_factory() above with a default (identity) pointer_type_selector.
Definition at line 1654 of file java_object_factory.cpp.
Similar to gen_nondet_init below, but instead of allocating and non-deterministically initializing the the argument expr passed to that function, we create a static global object of type type and non-deterministically initialize it.
See gen_nondet_init for a description of the parameters. The only new one is type, which is the type of the object to create.
symbol_table gains any new symbols created, and init_code gains any instructions required to initialize either the returned value or its child objects Definition at line 1544 of file java_object_factory.cpp.
Interval that represents the printable character range range U+0020-U+007E, i.e.
' ' to '~'