Skip to content

Commit aecb7cd

Browse files
committed
Remove handling of bool and char to string from the string solver
1 parent bcc5f8c commit aecb7cd

File tree

4 files changed

+0
-67
lines changed

4 files changed

+0
-67
lines changed

src/solvers/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,6 @@ This is described in more detail \link string_builtin_functiont here. \endlink
499499
* `cprover_string_of_float_scientific_notation` :
500500
\copybrief add_axioms_from_float_scientific_notation
501501
\link add_axioms_from_float_scientific_notation More... \endlink
502-
* `cprover_string_of_char` :
503-
\copybrief add_axioms_from_char(const function_application_exprt &f, array_poolt &array_pool)
504-
\link add_axioms_from_char(const function_application_exprt &f, array_poolt &array_pool) More... \endlink
505502
* `cprover_string_parse_int` :
506503
\copybrief add_axioms_for_parse_int
507504
\link add_axioms_for_parse_int More... \endlink
@@ -530,8 +527,6 @@ This is described in more detail \link string_builtin_functiont here. \endlink
530527
* `cprover_string_delete_char_at` : A call to
531528
`cprover_string_delete_char_at(s, i)` would be the same thing as
532529
`cprover_string_delete(s, i, i+1)`.
533-
* `cprover_string_of_bool` :
534-
Language dependent, should be implemented in the models.
535530
* `cprover_string_copy` : Same as `cprover_string_substring(s, 0)`.
536531
* `cprover_string_of_int_hex` : Same as `cprover_string_of_int(s, 16)`.
537532
* `cprover_string_of_double` : Same as `cprover_string_of_float`.

src/solvers/strings/string_constraint_generator_main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,6 @@ string_constraint_generatort::add_axioms_for_function_application(
281281
return add_axioms_from_double(fresh_symbol, expr, array_pool, ns);
282282
else if(id == ID_cprover_string_of_long_func)
283283
return add_axioms_from_long(expr, array_pool, ns);
284-
else if(id == ID_cprover_string_of_bool_func)
285-
return add_axioms_from_bool(expr, array_pool);
286-
else if(id == ID_cprover_string_of_char_func)
287-
return add_axioms_from_char(expr, array_pool);
288284
else if(id == ID_cprover_string_set_length_func)
289285
return add_axioms_for_set_length(fresh_symbol, expr, array_pool);
290286
else if(id == ID_cprover_string_delete_func)

src/solvers/strings/string_constraint_generator_valueof.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,6 @@ std::pair<exprt, string_constraintst> add_axioms_from_long(
5959
res, f.arguments()[2], 0, ns, array_pool);
6060
}
6161

62-
/// Add axioms corresponding to the String.valueOf(Z) java function.
63-
/// \deprecated This is Java specific and should be implemented in Java instead
64-
/// \param f: function application with a Boolean argument
65-
/// \param array_pool: pool of arrays representing strings
66-
/// \return a new string expression
67-
DEPRECATED(SINCE(2017, 10, 5, "Java specific, should be implemented in Java"))
68-
std::pair<exprt, string_constraintst> add_axioms_from_bool(
69-
const function_application_exprt &f,
70-
array_poolt &array_pool)
71-
{
72-
PRECONDITION(f.arguments().size() == 3);
73-
const array_string_exprt res =
74-
array_pool.find(f.arguments()[1], f.arguments()[0]);
75-
return add_axioms_from_bool(res, f.arguments()[2], array_pool);
76-
}
77-
7862
/// Add axioms stating that the returned string equals "true" when the Boolean
7963
/// expression is true and "false" when it is false.
8064
/// \deprecated This is Java specific and should be implemented in Java instead
@@ -296,46 +280,6 @@ std::pair<exprt, string_constraintst> add_axioms_from_int_hex(
296280
return add_axioms_from_int_hex(res, f.arguments()[2], array_pool);
297281
}
298282

299-
/// Conversion from char to string
300-
///
301-
// NOLINTNEXTLINE
302-
/// \copybrief add_axioms_from_char(const array_string_exprt &res, const exprt &c, array_poolt &)
303-
// NOLINTNEXTLINE
304-
/// \link add_axioms_from_char(const array_string_exprt &res, const exprt &c, array_poolt &)
305-
/// (More...) \endlink
306-
/// \param f: function application with arguments integer `|res|`, character
307-
/// pointer `&res[0]` and character `c`
308-
/// \param array_pool: pool of arrays representing strings
309-
/// \return code 0 on success
310-
std::pair<exprt, string_constraintst> add_axioms_from_char(
311-
const function_application_exprt &f,
312-
array_poolt &array_pool)
313-
{
314-
PRECONDITION(f.arguments().size() == 3);
315-
const array_string_exprt res =
316-
array_pool.find(f.arguments()[1], f.arguments()[0]);
317-
return add_axioms_from_char(res, f.arguments()[2], array_pool);
318-
}
319-
320-
/// Add axiom stating that string `res` has length 1 and the character
321-
/// it contains equals `c`.
322-
///
323-
/// This axiom is: \f$ |{\tt res}| = 1 \land {\tt res}[0] = {\tt c} \f$.
324-
/// \param res: array of characters expression
325-
/// \param c: character expression
326-
/// \param array_pool: pool of arrays representing strings
327-
/// \return code 0 on success
328-
std::pair<exprt, string_constraintst> add_axioms_from_char(
329-
const array_string_exprt &res,
330-
const exprt &c,
331-
array_poolt &array_pool)
332-
{
333-
string_constraintst constraints;
334-
constraints.existential = {and_exprt(
335-
equal_exprt(res[0], c), equal_to(array_pool.get_or_create_length(res), 1))};
336-
return {from_integer(0, get_return_code_type()), std::move(constraints)};
337-
}
338-
339283
/// Add axioms making the return value true if the given string is a correct
340284
/// number in the given radix
341285
/// \param str: string expression

src/util/irep_ids.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,9 @@ IREP_ID_ONE(cprover_string_length_func)
619619
IREP_ID_ONE(cprover_string_of_int_func)
620620
IREP_ID_ONE(cprover_string_of_int_hex_func)
621621
IREP_ID_ONE(cprover_string_of_long_func)
622-
IREP_ID_ONE(cprover_string_of_bool_func)
623622
IREP_ID_ONE(cprover_string_of_float_func)
624623
IREP_ID_ONE(cprover_string_of_float_scientific_notation_func)
625624
IREP_ID_ONE(cprover_string_of_double_func)
626-
IREP_ID_ONE(cprover_string_of_char_func)
627625
IREP_ID_ONE(cprover_string_parse_int_func)
628626
IREP_ID_ONE(cprover_string_replace_func)
629627
IREP_ID_ONE(cprover_string_set_length_func)

0 commit comments

Comments
 (0)