CBMC
java_object_factory.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
70 
71 #ifndef CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
72 #define CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
73 
74 #include "nondet.h"
75 
77 
78 #include <util/std_code.h>
79 
80 class message_handlert;
82 class symbol_tablet;
84 
86  const typet &type,
87  const irep_idt base_name,
88  code_blockt &init_code,
89  symbol_table_baset &symbol_table,
91  lifetimet lifetime,
92  const source_locationt &location,
93  const select_pointer_typet &pointer_type_selector,
94  message_handlert &log);
95 
97  const typet &type,
98  const irep_idt base_name,
99  code_blockt &init_code,
100  symbol_tablet &symbol_table,
101  const java_object_factory_parameterst &object_factory_parameters,
102  lifetimet lifetime,
103  const source_locationt &location,
104  message_handlert &log);
105 
107 {
111 };
112 
113 void gen_nondet_init(
114  const exprt &expr,
115  code_blockt &init_code,
116  symbol_table_baset &symbol_table,
117  const source_locationt &loc,
118  bool skip_classid,
119  lifetimet lifetime,
120  const java_object_factory_parameterst &object_factory_parameters,
121  const select_pointer_typet &pointer_type_selector,
122  update_in_placet update_in_place,
123  message_handlert &log);
124 
125 void gen_nondet_init(
126  const exprt &expr,
127  code_blockt &init_code,
128  symbol_table_baset &symbol_table,
129  const source_locationt &loc,
130  bool skip_classid,
131  lifetimet lifetime,
132  const java_object_factory_parameterst &object_factory_parameters,
133  update_in_placet update_in_place,
134  message_handlert &log);
135 
136 using array_element_generatort = std::function<
137  code_blockt(const exprt &element_at_counter, const typet &element_type)>;
138 
162  const exprt &expr,
163  update_in_placet update_in_place,
164  const source_locationt &location,
165  const array_element_generatort &element_generator,
166  const allocate_local_symbolt &allocate_local_symbol,
167  const symbol_tablet &symbol_table,
168  size_t max_nondet_array_length);
169 
170 #endif // CPROVER_JAVA_BYTECODE_JAVA_OBJECT_FACTORY_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
code_blockt
A codet representing sequential composition of program statements.
Definition: std_code.h:129
symbol_tablet
The symbol table.
Definition: symbol_table.h:13
update_in_placet::MAY_UPDATE_IN_PLACE
@ MAY_UPDATE_IN_PLACE
typet
The type of an expression, extends irept.
Definition: type.h:28
exprt
Base class for all expressions.
Definition: expr.h:55
update_in_placet
update_in_placet
Definition: java_object_factory.h:106
update_in_placet::MUST_UPDATE_IN_PLACE
@ MUST_UPDATE_IN_PLACE
gen_nondet_init
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...
Definition: java_object_factory.cpp:1624
gen_nondet_array_init
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_tablet &symbol_table, size_t max_nondet_array_length)
Synthesize GOTO for generating a array of nondet length to be stored in the expr.
Definition: java_object_factory.cpp:1376
object_factory
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 &location, 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...
Definition: java_object_factory.cpp:1547
symbol_table_baset
The symbol table base class interface.
Definition: symbol_table_base.h:21
select_pointer_typet
Definition: select_pointer_type.h:22
message_handlert
Definition: message.h:27
std_code.h
lifetimet
lifetimet
Selects the kind of objects allocated.
Definition: allocate_objects.h:16
source_locationt
Definition: source_location.h:18
allocate_local_symbolt
std::function< symbol_exprt(const typet &type, std::string)> allocate_local_symbolt
Definition: nondet.h:18
nondet.h
update_in_placet::NO_UPDATE_IN_PLACE
@ NO_UPDATE_IN_PLACE
array_element_generatort
std::function< code_blockt(const exprt &element_at_counter, const typet &element_type)> array_element_generatort
Definition: java_object_factory.h:137
allocate_objects.h
java_object_factory_parameterst
Definition: java_object_factory_parameters.h:15