14 #ifndef CPROVER_SOLVERS_STRINGS_ARRAY_POOL_H
15 #define CPROVER_SOLVERS_STRINGS_ARRAY_POOL_H
36 std::vector<symbol_exprt> created_symbols;
49 const std::unordered_map<exprt, array_string_exprt, irep_hash> &
78 const std::unordered_map<array_string_exprt, exprt, irep_hash> &
104 const exprt &char_pointer,
105 const typet &char_array_type);
array_string_exprt of_argument(array_poolt &array_pool, const exprt &arg)
Converts a struct containing a length and pointer to an array.
array_string_exprt get_string_expr(array_poolt &array_pool, const exprt &expr)
Fetch the string_exprt corresponding to the given refined_string_exprt.
bitvector_typet char_type()
Correspondance between arrays and pointers string representations.
std::unordered_map< exprt, array_string_exprt, irep_hash > arrays_of_pointers
Associate arrays to char pointers Invariant: Each array_string_exprt in this map has a corresponding ...
const std::unordered_map< exprt, array_string_exprt, irep_hash > & get_arrays_of_pointers() const
array_poolt(symbol_generatort &symbol_generator)
std::optional< exprt > get_length_if_exists(const array_string_exprt &s) const
As opposed to get_length(), do not create a new symbol if the length of the array_string_exprt does n...
std::unordered_map< array_string_exprt, exprt, irep_hash > length_of_array
Associate length to arrays of infinite size.
array_string_exprt make_char_array_for_char_pointer(const exprt &char_pointer, const typet &char_array_type)
Helper function for find.
exprt get_or_create_length(const array_string_exprt &s)
Get the length of an array_string_exprt from the array_pool.
void insert(const exprt &pointer_expr, const array_string_exprt &array)
array_string_exprt fresh_string(const typet &index_type, const typet &char_type)
Construct a string expression whose length and content are new variables.
array_string_exprt find(const exprt &pointer, const exprt &length)
Creates a new array if the pointer is not pointing to an array.
symbol_generatort & fresh_symbol
Generate fresh symbols.
const std::unordered_map< array_string_exprt, exprt, irep_hash > & created_strings() const
Return a map mapping all array_string_exprt of the array_pool to their length.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
Expression to hold a symbol (variable)
Generation of fresh symbols of a given type.
symbol_exprt operator()(const irep_idt &prefix, const typet &type=bool_typet())
Generate a new symbol expression of the given type with some prefix.
The type of an expression, extends irept.
API to expression classes.
String expressions for the string solver.