Skip to content

Commit c8ff278

Browse files
Remove solver handling of cprover_string_insert_*
These can no longer be produced by the java preprocessing, we can thus drop the functions that where handling it.
1 parent 03d7262 commit c8ff278

File tree

5 files changed

+1
-171
lines changed

5 files changed

+1
-171
lines changed

src/solvers/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,7 @@ This is described in more detail \link string_builtin_functiont here. \endlink
514514
* `cprover_string_offset_by_code_point`, `cprover_string_concat_char`,
515515
`cprover_string_concat_int`, `cprover_string_concat_long`,
516516
`cprover_string_concat_bool`, `cprover_string_concat_double`,
517-
`cprover_string_concat_float`, `cprover_string_insert_int`,
518-
`cprover_string_insert_long`, `cprover_string_insert_bool`,
519-
`cprover_string_insert_char`, `cprover_string_insert_double`,
520-
`cprover_string_insert_float` :
517+
`cprover_string_concat_float` :
521518
Should be done in two steps: conversion from primitive type and call
522519
to the string primitive.
523520
* `cprover_string_array_of_char_pointer`, `cprover_string_to_char_array` :

src/solvers/strings/string_constraint_generator.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -211,29 +211,6 @@ std::pair<exprt, string_constraintst> add_axioms_for_insert(
211211
symbol_generatort &fresh_symbol,
212212
const function_application_exprt &f,
213213
array_poolt &array_pool);
214-
std::pair<exprt, string_constraintst> add_axioms_for_insert_int(
215-
symbol_generatort &fresh_symbol,
216-
const function_application_exprt &f,
217-
array_poolt &array_pool,
218-
const namespacet &ns);
219-
std::pair<exprt, string_constraintst> add_axioms_for_insert_bool(
220-
symbol_generatort &fresh_symbol,
221-
const function_application_exprt &f,
222-
array_poolt &array_pool);
223-
std::pair<exprt, string_constraintst> add_axioms_for_insert_char(
224-
symbol_generatort &fresh_symbol,
225-
const function_application_exprt &f,
226-
array_poolt &array_pool);
227-
std::pair<exprt, string_constraintst> add_axioms_for_insert_float(
228-
symbol_generatort &fresh_symbol,
229-
const function_application_exprt &f,
230-
array_poolt &array_pool,
231-
const namespacet &ns);
232-
std::pair<exprt, string_constraintst> add_axioms_for_insert_double(
233-
symbol_generatort &fresh_symbol,
234-
const function_application_exprt &f,
235-
array_poolt &array_pool,
236-
const namespacet &ns);
237214

238215
std::pair<exprt, string_constraintst> add_axioms_for_cprover_string(
239216
symbol_generatort &fresh_symbol,

src/solvers/strings/string_constraint_generator_insert.cpp

Lines changed: 0 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -142,129 +142,3 @@ std::pair<exprt, string_constraintst> add_axioms_for_insert(
142142
return add_axioms_for_insert(fresh_symbol, res, s1, s2, offset, array_pool);
143143
}
144144
}
145-
146-
/// add axioms corresponding to the StringBuilder.insert(I) java function
147-
/// \deprecated should convert the value to string and call insert
148-
/// \param fresh_symbol: generator of fresh symbols
149-
/// \param f: function application with three arguments: a string, an
150-
/// integer offset, and an integer
151-
/// \param array_pool: pool of arrays representing strings
152-
/// \param ns: namespace
153-
/// \return an expression
154-
DEPRECATED(SINCE(2017, 10, 5, "convert the value to string and call insert"))
155-
std::pair<exprt, string_constraintst> add_axioms_for_insert_int(
156-
symbol_generatort &fresh_symbol,
157-
const function_application_exprt &f,
158-
array_poolt &array_pool,
159-
const namespacet &ns)
160-
{
161-
PRECONDITION(f.arguments().size() == 5);
162-
const array_string_exprt s1 = get_string_expr(array_pool, f.arguments()[2]);
163-
const array_string_exprt res =
164-
array_pool.find(f.arguments()[1], f.arguments()[0]);
165-
const exprt &offset = f.arguments()[3];
166-
const typet &index_type = s1.length_type();
167-
const typet &char_type = s1.content().type().subtype();
168-
const array_string_exprt s2 = array_pool.fresh_string(index_type, char_type);
169-
return combine_results(
170-
add_axioms_for_string_of_int(s2, f.arguments()[4], 0, ns, array_pool),
171-
add_axioms_for_insert(fresh_symbol, res, s1, s2, offset, array_pool));
172-
}
173-
174-
/// add axioms corresponding to the StringBuilder.insert(Z) java function
175-
/// \deprecated should convert the value to string and call insert
176-
/// \param fresh_symbol: generator of fresh symbols
177-
/// \param f: function application with three arguments: a string, an
178-
/// integer offset, and a Boolean
179-
/// \param array_pool: pool of arrays representing strings
180-
/// \return a new string expression
181-
DEPRECATED(SINCE(2017, 10, 5, "convert the value to string and call insert"))
182-
std::pair<exprt, string_constraintst> add_axioms_for_insert_bool(
183-
symbol_generatort &fresh_symbol,
184-
const function_application_exprt &f,
185-
array_poolt &array_pool)
186-
{
187-
PRECONDITION(f.arguments().size() == 5);
188-
const array_string_exprt s1 = get_string_expr(array_pool, f.arguments()[0]);
189-
const array_string_exprt res =
190-
array_pool.find(f.arguments()[1], f.arguments()[0]);
191-
const exprt &offset = f.arguments()[3];
192-
const typet &index_type = s1.length_type();
193-
const typet &char_type = s1.content().type().subtype();
194-
const array_string_exprt s2 = array_pool.fresh_string(index_type, char_type);
195-
return combine_results(
196-
add_axioms_from_bool(s2, f.arguments()[4], array_pool),
197-
add_axioms_for_insert(fresh_symbol, res, s1, s2, offset, array_pool));
198-
}
199-
200-
/// Add axioms corresponding to the StringBuilder.insert(C) java function
201-
/// \todo This should be merged with add_axioms_for_insert.
202-
/// \param fresh_symbol: generator of fresh symbols
203-
/// \param f: function application with three arguments: a string, an
204-
/// integer offset, and a character
205-
/// \param array_pool: pool of arrays representing strings
206-
/// \return an expression
207-
std::pair<exprt, string_constraintst> add_axioms_for_insert_char(
208-
symbol_generatort &fresh_symbol,
209-
const function_application_exprt &f,
210-
array_poolt &array_pool)
211-
{
212-
PRECONDITION(f.arguments().size() == 5);
213-
const array_string_exprt res =
214-
array_pool.find(f.arguments()[1], f.arguments()[0]);
215-
const array_string_exprt s1 = get_string_expr(array_pool, f.arguments()[2]);
216-
const exprt &offset = f.arguments()[3];
217-
const typet &index_type = s1.length_type();
218-
const typet &char_type = s1.content().type().subtype();
219-
const array_string_exprt s2 = array_pool.fresh_string(index_type, char_type);
220-
return combine_results(
221-
add_axioms_from_char(s2, f.arguments()[4], array_pool),
222-
add_axioms_for_insert(fresh_symbol, res, s1, s2, offset, array_pool));
223-
}
224-
225-
/// add axioms corresponding to the StringBuilder.insert(D) java function
226-
/// \deprecated should convert the value to string and call insert
227-
/// \param fresh_symbol: generator of fresh symbols
228-
/// \param f: function application with three arguments: a string, an
229-
/// integer offset, and a double
230-
/// \param array_pool: pool of arrays representing strings
231-
/// \param ns: namespace
232-
/// \return a string expression
233-
DEPRECATED(SINCE(2017, 10, 5, "convert the value to string and call insert"))
234-
std::pair<exprt, string_constraintst> add_axioms_for_insert_double(
235-
symbol_generatort &fresh_symbol,
236-
const function_application_exprt &f,
237-
array_poolt &array_pool,
238-
const namespacet &ns)
239-
{
240-
PRECONDITION(f.arguments().size() == 5);
241-
const array_string_exprt res =
242-
array_pool.find(f.arguments()[1], f.arguments()[0]);
243-
const array_string_exprt s1 = get_string_expr(array_pool, f.arguments()[2]);
244-
const exprt &offset = f.arguments()[3];
245-
const typet &index_type = s1.length_type();
246-
const typet &char_type = s1.content().type().subtype();
247-
const array_string_exprt s2 = array_pool.fresh_string(index_type, char_type);
248-
return combine_results(
249-
add_axioms_for_string_of_float(
250-
fresh_symbol, s2, f.arguments()[4], array_pool, ns),
251-
add_axioms_for_insert(fresh_symbol, res, s1, s2, offset, array_pool));
252-
}
253-
254-
/// Add axioms corresponding to the StringBuilder.insert(F) java function
255-
/// \deprecated should convert the value to string and call insert
256-
/// \param fresh_symbol: generator of fresh symbols
257-
/// \param f: function application with three arguments: a string, an
258-
/// integer offset, and a float
259-
/// \param array_pool: pool of arrays representing strings
260-
/// \param ns: namespace
261-
/// \return a new string expression
262-
DEPRECATED(SINCE(2017, 10, 5, "convert the value to string and call insert"))
263-
std::pair<exprt, string_constraintst> add_axioms_for_insert_float(
264-
symbol_generatort &fresh_symbol,
265-
const function_application_exprt &f,
266-
array_poolt &array_pool,
267-
const namespacet &ns)
268-
{
269-
return add_axioms_for_insert_double(fresh_symbol, f, array_pool, ns);
270-
}

src/solvers/strings/string_constraint_generator_main.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,6 @@ string_constraint_generatort::add_axioms_for_function_application(
264264
return add_axioms_for_concat_code_point(fresh_symbol, expr, array_pool);
265265
else if(id == ID_cprover_string_insert_func)
266266
return add_axioms_for_insert(fresh_symbol, expr, array_pool);
267-
else if(id == ID_cprover_string_insert_int_func)
268-
return add_axioms_for_insert_int(fresh_symbol, expr, array_pool, ns);
269-
else if(id == ID_cprover_string_insert_long_func)
270-
return add_axioms_for_insert_int(fresh_symbol, expr, array_pool, ns);
271-
else if(id == ID_cprover_string_insert_bool_func)
272-
return add_axioms_for_insert_bool(fresh_symbol, expr, array_pool);
273-
else if(id == ID_cprover_string_insert_char_func)
274-
return add_axioms_for_insert_char(fresh_symbol, expr, array_pool);
275-
else if(id == ID_cprover_string_insert_double_func)
276-
return add_axioms_for_insert_double(fresh_symbol, expr, array_pool, ns);
277-
else if(id == ID_cprover_string_insert_float_func)
278-
return add_axioms_for_insert_float(fresh_symbol, expr, array_pool, ns);
279267
else if(id == ID_cprover_string_substring_func)
280268
return add_axioms_for_substring(fresh_symbol, expr, array_pool);
281269
else if(id == ID_cprover_string_trim_func)

src/util/irep_ids.def

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,6 @@ IREP_ID_ONE(cprover_string_endswith_func)
611611
IREP_ID_ONE(cprover_string_format_func)
612612
IREP_ID_ONE(cprover_string_index_of_func)
613613
IREP_ID_ONE(cprover_string_insert_func)
614-
IREP_ID_ONE(cprover_string_insert_int_func)
615-
IREP_ID_ONE(cprover_string_insert_long_func)
616-
IREP_ID_ONE(cprover_string_insert_bool_func)
617-
IREP_ID_ONE(cprover_string_insert_char_func)
618-
IREP_ID_ONE(cprover_string_insert_float_func)
619-
IREP_ID_ONE(cprover_string_insert_double_func)
620614
IREP_ID_ONE(cprover_string_is_prefix_func)
621615
IREP_ID_ONE(cprover_string_is_suffix_func)
622616
IREP_ID_ONE(cprover_string_is_empty_func)

0 commit comments

Comments
 (0)