38 std::pair<exprt, string_constraintst>
48 const typet &index_type =
s1.length_type();
95 std::pair<exprt, string_constraintst>
103 const exprt &i = args[3];
123 std::pair<exprt, string_constraintst>
182 std::pair<exprt, string_constraintst>
252 str[index_before], ID_gt, space_char);
279 (expr1.
type().
id() == ID_unsignedbv || expr1.
type().
id() == ID_char) &&
280 (expr2.
type().
id() == ID_char || expr2.
type().
id() == ID_unsignedbv))
281 return std::make_pair(expr1, expr2);
284 const auto expr1_length =
286 const auto expr2_length =
288 if(expr1_length && expr2_length && *expr1_length == 1 && *expr2_length == 1)
289 return std::make_pair(
exprt(expr1_str[0]),
exprt(expr2_str[0]));
312 std::pair<exprt, string_constraintst>
324 [&](
const exprt &e) { return get_string_expr(array_pool, e); },
327 const auto old_char = maybe_chars->first;
328 const auto new_char = maybe_chars->second;
355 std::pair<exprt, string_constraintst>
382 std::pair<exprt, string_constraintst>
417 std::pair<exprt, string_constraintst>
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.
exprt get_or_create_length(const array_string_exprt &s)
Get the length of an array_string_exprt from the array_pool.
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.
const typet & length_type() const
A base class for relations, i.e., binary predicates whose two operands have the same type.
Base class for all expressions.
typet & type()
Return the type of the expression.
Application of (mathematical) function.
exprt::operandst argumentst
const irep_idt & id() const
The plus expression Associativity is not specified.
std::pair< exprt, string_constraintst > add_axioms_for_delete(const array_string_exprt &res, const array_string_exprt &str, const exprt &start, const exprt &end)
Add axioms stating that res corresponds to the input str where we removed characters between the posi...
std::pair< exprt, string_constraintst > add_axioms_for_substring(const array_string_exprt &res, const array_string_exprt &str, const exprt &start, const exprt &end)
Add axioms ensuring that res corresponds to the substring of str between indexes ‘start’ = max(start,...
std::pair< exprt, string_constraintst > add_axioms_for_concat(const array_string_exprt &res, const array_string_exprt &s1, const array_string_exprt &s2)
Add axioms enforcing that res is equal to the concatenation of s1 and s2.
message_handlert & message_handler
std::pair< exprt, string_constraintst > add_axioms_for_set_length(const function_application_exprt &f)
Reduce or extend a string to have the given length.
std::pair< exprt, string_constraintst > add_axioms_for_trim(const function_application_exprt &f)
Remove leading and trailing whitespaces.
std::pair< exprt, string_constraintst > add_axioms_for_replace(const function_application_exprt &f)
Replace a character by another in a string.
symbol_generatort fresh_symbol
std::pair< exprt, string_constraintst > add_axioms_for_delete_char_at(const function_application_exprt &expr)
add axioms corresponding to the StringBuilder.deleteCharAt java function
std::pair< exprt, string_constraintst > combine_results(std::pair< exprt, string_constraintst > result1, std::pair< exprt, string_constraintst > result2)
Combine the results of two add_axioms function by taking the maximum of the return codes and merging ...
Expression to hold a symbol (variable)
const typet & subtype() const
The type of an expression, extends irept.
API to expression classes for 'mathematical' expressions.
#define PRECONDITION(CONDITION)
Generates string constraints to link results from string functions with their arguments.
exprt maximum(const exprt &a, const exprt &b)
exprt minimum(const exprt &a, const exprt &b)
exprt zero_if_negative(const exprt &expr)
Returns a non-negative version of the argument.
signedbv_typet get_return_code_type()
binary_relation_exprt less_than_or_equal_to(exprt lhs, exprt rhs)
binary_relation_exprt greater_or_equal_to(exprt lhs, exprt rhs)
equal_exprt equal_to(exprt lhs, exprt rhs)
Collection of constraints of different types: existential formulas, universal formulas,...
std::vector< exprt > existential
std::vector< string_constraintt > universal
const type_with_subtypet & to_type_with_subtype(const typet &type)