Skip to content

Commit 70fc569

Browse files
committed
Remove handling of bool and char to string from the string solver
1 parent b32de0a commit 70fc569

File tree

4 files changed

+0
-64
lines changed

4 files changed

+0
-64
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 string_constraint_generatort::add_axioms_from_float_scientific_notation
501501
\link string_constraint_generatort::add_axioms_from_float_scientific_notation More... \endlink
502-
* `cprover_string_of_char` :
503-
\copybrief string_constraint_generatort::add_axioms_from_char(const function_application_exprt &f)
504-
\link string_constraint_generatort::add_axioms_from_char(const function_application_exprt &f) More... \endlink
505502
* `cprover_string_parse_int` :
506503
\copybrief string_constraint_generatort::add_axioms_for_parse_int
507504
\link string_constraint_generatort::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
@@ -273,10 +273,6 @@ string_constraint_generatort::add_axioms_for_function_application(
273273
return add_axioms_from_double(expr);
274274
else if(id == ID_cprover_string_of_long_func)
275275
return add_axioms_from_long(expr);
276-
else if(id == ID_cprover_string_of_bool_func)
277-
return add_axioms_from_bool(expr);
278-
else if(id == ID_cprover_string_of_char_func)
279-
return add_axioms_from_char(expr);
280276
else if(id == ID_cprover_string_set_length_func)
281277
return add_axioms_for_set_length(expr);
282278
else if(id == ID_cprover_string_delete_func)

src/solvers/strings/string_constraint_generator_valueof.cpp

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,6 @@ string_constraint_generatort::add_axioms_from_long(
5555
return add_axioms_for_string_of_int(res, f.arguments()[2], 0);
5656
}
5757

58-
/// Add axioms corresponding to the String.valueOf(Z) java function.
59-
/// \deprecated This is Java specific and should be implemented in Java instead
60-
/// \param f: function application with a Boolean argument
61-
/// \return a new string expression
62-
DEPRECATED(SINCE(2017, 10, 5, "Java specific, should be implemented in Java"))
63-
std::pair<exprt, string_constraintst>
64-
string_constraint_generatort::add_axioms_from_bool(
65-
const function_application_exprt &f)
66-
{
67-
PRECONDITION(f.arguments().size() == 3);
68-
const array_string_exprt res =
69-
array_pool.find(f.arguments()[1], f.arguments()[0]);
70-
return add_axioms_from_bool(res, f.arguments()[2]);
71-
}
72-
7358
/// Add axioms stating that the returned string equals "true" when the Boolean
7459
/// expression is true and "false" when it is false.
7560
/// \deprecated This is Java specific and should be implemented in Java instead
@@ -281,44 +266,6 @@ string_constraint_generatort::add_axioms_from_int_hex(
281266
return add_axioms_from_int_hex(res, f.arguments()[2]);
282267
}
283268

284-
/// Conversion from char to string
285-
///
286-
// NOLINTNEXTLINE
287-
/// \copybrief add_axioms_from_char(const array_string_exprt &res, const exprt &c)
288-
// NOLINTNEXTLINE
289-
/// \link add_axioms_from_char(const array_string_exprt &res, const exprt &c)
290-
/// (More...) \endlink
291-
/// \param f: function application with arguments integer `|res|`, character
292-
/// pointer `&res[0]` and character `c`
293-
/// \return code 0 on success
294-
std::pair<exprt, string_constraintst>
295-
string_constraint_generatort::add_axioms_from_char(
296-
const function_application_exprt &f)
297-
{
298-
PRECONDITION(f.arguments().size() == 3);
299-
const array_string_exprt res =
300-
array_pool.find(f.arguments()[1], f.arguments()[0]);
301-
return add_axioms_from_char(res, f.arguments()[2]);
302-
}
303-
304-
/// Add axiom stating that string `res` has length 1 and the character
305-
/// it contains equals `c`.
306-
///
307-
/// This axiom is: \f$ |{\tt res}| = 1 \land {\tt res}[0] = {\tt c} \f$.
308-
/// \param res: array of characters expression
309-
/// \param c: character expression
310-
/// \return code 0 on success
311-
std::pair<exprt, string_constraintst>
312-
string_constraint_generatort::add_axioms_from_char(
313-
const array_string_exprt &res,
314-
const exprt &c)
315-
{
316-
string_constraintst constraints;
317-
constraints.existential = {and_exprt(
318-
equal_exprt(res[0], c), equal_to(array_pool.get_or_create_length(res), 1))};
319-
return {from_integer(0, get_return_code_type()), std::move(constraints)};
320-
}
321-
322269
/// Add axioms making the return value true if the given string is a correct
323270
/// number in the given radix
324271
/// \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)