@@ -117,154 +117,12 @@ std::pair<exprt, string_constraintst> add_axioms_for_insert(
117
117
symbol_generatort &fresh_symbol,
118
118
const function_application_exprt &f,
119
119
array_poolt &array_pool)
120
- {
121
- PRECONDITION (f.arguments ().size () == 5 || f.arguments ().size () == 7 );
122
- array_string_exprt s1 = get_string_expr (array_pool, f.arguments ()[2 ]);
123
- array_string_exprt s2 = get_string_expr (array_pool, f.arguments ()[4 ]);
124
- array_string_exprt res = array_pool.find (f.arguments ()[1 ], f.arguments ()[0 ]);
125
- const exprt &offset = f.arguments ()[3 ];
126
- if (f.arguments ().size () == 7 )
127
- {
128
- const exprt &start = f.arguments ()[5 ];
129
- const exprt &end = f.arguments ()[6 ];
130
- const typet &char_type = s1.content ().type ().subtype ();
131
- const typet &index_type = s1.length_type ();
132
- const array_string_exprt substring =
133
- array_pool.fresh_string (index_type, char_type);
134
- return combine_results (
135
- add_axioms_for_substring (
136
- fresh_symbol, substring, s2, start, end, array_pool),
137
- add_axioms_for_insert (
138
- fresh_symbol, res, s1, substring, offset, array_pool));
139
- }
140
- else // 5 arguments
141
- {
142
- return add_axioms_for_insert (fresh_symbol, res, s1, s2, offset, array_pool);
143
- }
144
- }
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
120
{
212
121
PRECONDITION (f.arguments ().size () == 5 );
213
- const array_string_exprt res =
214
- array_pool.find (f.arguments ()[1 ], f.arguments ()[0 ]);
215
122
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 );
123
+ const array_string_exprt s2 = get_string_expr (array_pool, f.arguments ()[4 ]);
241
124
const array_string_exprt res =
242
125
array_pool.find (f.arguments ()[1 ], f.arguments ()[0 ]);
243
- const array_string_exprt s1 = get_string_expr (array_pool, f.arguments ()[2 ]);
244
126
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);
127
+ return add_axioms_for_insert (fresh_symbol, res, s1, s2, offset, array_pool);
270
128
}
0 commit comments