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