@@ -283,107 +283,6 @@ static void substitute_function_applications_in_equations(
283
283
eq.rhs () = substitute_function_applications (eq.rhs (), generator);
284
284
}
285
285
286
- // / For now, any unsigned bitvector type of width smaller or equal to 16 is
287
- // / considered a character.
288
- // / \note type that are not characters maybe detected as characters (for
289
- // / instance unsigned char in C), this will make dec_solve do unnecessary
290
- // / steps for these, but should not affect correctness.
291
- // / \param type: a type
292
- // / \return true if the given type represents characters
293
- bool is_char_type (const typet &type)
294
- {
295
- return type.id () == ID_unsignedbv &&
296
- to_unsignedbv_type (type).get_width () <= 16 ;
297
- }
298
-
299
- // / Distinguish char array from other types.
300
- // / For now, any unsigned bitvector type is considered a character.
301
- // / \param type: a type
302
- // / \param ns: namespace
303
- // / \return true if the given type is an array of characters
304
- bool is_char_array_type (const typet &type, const namespacet &ns)
305
- {
306
- if (type.id ()==ID_symbol)
307
- return is_char_array_type (ns.follow (type), ns);
308
- return type.id () == ID_array && is_char_type (type.subtype ());
309
- }
310
-
311
- // / For now, any unsigned bitvector type is considered a character.
312
- // / \param type: a type
313
- // / \return true if the given type represents a pointer to characters
314
- bool is_char_pointer_type (const typet &type)
315
- {
316
- return type.id () == ID_pointer && is_char_type (type.subtype ());
317
- }
318
-
319
- // / \param type: a type
320
- // / \param pred: a predicate
321
- // / \return true if one of the subtype of `type` satisfies predicate `pred`.
322
- // / The meaning of "subtype" is in the algebraic datatype sense:
323
- // / for example, the subtypes of a struct are the types of its
324
- // / components, the subtype of a pointer is the type it points to,
325
- // / etc...
326
- // / For instance in the type `t` defined by
327
- // / `{ int a; char[] b; double * c; { bool d} e}`, `int`, `char`,
328
- // / `double` and `bool` are subtypes of `t`.
329
- bool has_subtype (
330
- const typet &type,
331
- const std::function<bool (const typet &)> &pred)
332
- {
333
- if (pred (type))
334
- return true ;
335
-
336
- if (type.id () == ID_struct || type.id () == ID_union)
337
- {
338
- const struct_union_typet &struct_type = to_struct_union_type (type);
339
- return std::any_of (
340
- struct_type.components ().begin (),
341
- struct_type.components ().end (), // NOLINTNEXTLINE
342
- [&](const struct_union_typet::componentt &comp) {
343
- return has_subtype (comp.type (), pred);
344
- });
345
- }
346
-
347
- return std::any_of ( // NOLINTNEXTLINE
348
- type.subtypes ().begin (), type.subtypes ().end (), [&](const typet &t) {
349
- return has_subtype (t, pred);
350
- });
351
- }
352
-
353
- // / \param type: a type
354
- // / \return true if a subtype of `type` is an pointer of characters.
355
- // / The meaning of "subtype" is in the algebraic datatype sense:
356
- // / for example, the subtypes of a struct are the types of its
357
- // / components, the subtype of a pointer is the type it points to,
358
- // / etc...
359
- static bool has_char_pointer_subtype (const typet &type)
360
- {
361
- return has_subtype (type, is_char_pointer_type);
362
- }
363
-
364
- // / \param type: a type
365
- // / \return true if a subtype of `type` is string_typet.
366
- // / The meaning of "subtype" is in the algebraic datatype sense:
367
- // / for example, the subtypes of a struct are the types of its
368
- // / components, the subtype of a pointer is the type it points to,
369
- // / etc...
370
- static bool has_string_subtype (const typet &type)
371
- {
372
- // NOLINTNEXTLINE
373
- return has_subtype (
374
- type, [](const typet &subtype) { return subtype == string_typet (); });
375
- }
376
-
377
- // / \param expr: an expression
378
- // / \param ns: namespace
379
- // / \return true if a subexpression of `expr` is an array of characters
380
- static bool has_char_array_subexpr (const exprt &expr, const namespacet &ns)
381
- {
382
- for (auto it = expr.depth_begin (); it != expr.depth_end (); ++it)
383
- if (is_char_array_type (it->type (), ns))
384
- return true ;
385
- return false ;
386
- }
387
286
388
287
void replace_symbols_in_equations (
389
288
const union_find_replacet &symbol_resolve,
0 commit comments