@@ -250,41 +250,6 @@ void string_dependenciest::add_dependency(
250
250
string_node.dependencies .push_back (builtin_function_node);
251
251
}
252
252
253
- void string_dependenciest::add_unknown_dependency (const array_string_exprt &e)
254
- {
255
- if (e.id () == ID_if)
256
- {
257
- const auto if_expr = to_if_expr (e);
258
- const auto &true_case = to_array_string_expr (if_expr.true_case ());
259
- const auto &false_case = to_array_string_expr (if_expr.false_case ());
260
- add_unknown_dependency (true_case);
261
- add_unknown_dependency (false_case);
262
- return ;
263
- }
264
- string_nodet &string_node = get_node (e);
265
- string_node.depends_on_unknown_builtin_function = true ;
266
- }
267
-
268
- static void add_unknown_dependency_to_string_subexprs (
269
- string_dependenciest &dependencies,
270
- const function_application_exprt &fun_app,
271
- array_poolt &array_pool)
272
- {
273
- for (const auto &expr : fun_app.arguments ())
274
- {
275
- std::for_each (
276
- expr.depth_begin (), expr.depth_end (), [&](const exprt &e) { // NOLINT
277
- if (is_refined_string_type (e.type ()))
278
- {
279
- const auto &string_struct = expr_checked_cast<struct_exprt>(e);
280
- const array_string_exprt string =
281
- array_pool.find (string_struct.op1 (), string_struct.op0 ());
282
- dependencies.add_unknown_dependency (string);
283
- }
284
- });
285
- }
286
- }
287
-
288
253
static void add_dependency_to_string_subexprs (
289
254
string_dependenciest &dependencies,
290
255
const function_application_exprt &fun_app,
@@ -331,9 +296,7 @@ optionalt<exprt> string_dependenciest::eval(
331
296
332
297
const auto node = string_nodes[it->second ];
333
298
const auto &f = node.result_from ;
334
- if (
335
- f && node.dependencies .size () == 1 &&
336
- !node.depends_on_unknown_builtin_function )
299
+ if (f && node.dependencies .size () == 1 )
337
300
{
338
301
const auto value_opt = get_builtin_function (*f).eval (get_value);
339
302
eval_string_cache[it->second ] = value_opt;
@@ -360,14 +323,7 @@ bool add_node(
360
323
return false ;
361
324
362
325
auto builtin_function = to_string_builtin_function (*fun_app, array_pool);
363
-
364
- if (!builtin_function)
365
- {
366
- add_unknown_dependency_to_string_subexprs (
367
- dependencies, *fun_app, array_pool);
368
- return true ;
369
- }
370
-
326
+ CHECK_RETURN (builtin_function != nullptr );
371
327
const auto &builtin_function_node = dependencies.make_node (builtin_function);
372
328
// Warning: `builtin_function` has been emptied and should not be used anymore
373
329
0 commit comments