@@ -12,9 +12,9 @@ Author: Michael Tautschnig
12
12
#include < util/byte_operators.h>
13
13
#include < util/c_types.h>
14
14
#include < util/pointer_offset_size.h>
15
- #include < util/simplify_expr.h>
16
15
17
16
#include " goto_symex_state.h"
17
+ #include " simplify_expr_with_value_set.h"
18
18
#include " symex_target.h"
19
19
20
20
#define ENABLE_ARRAY_FIELD_SENSITIVITY
@@ -51,14 +51,14 @@ exprt field_sensitivityt::apply(
51
51
!write && expr.id () == ID_member &&
52
52
to_member_expr (expr).struct_op ().id () == ID_struct)
53
53
{
54
- return simplify_opt (std::move (expr), ns);
54
+ return simplify_opt (std::move (expr), state. value_set , ns);
55
55
}
56
56
#ifdef ENABLE_ARRAY_FIELD_SENSITIVITY
57
57
else if (
58
58
!write && expr.id () == ID_index &&
59
59
to_index_expr (expr).array ().id () == ID_array)
60
60
{
61
- return simplify_opt (std::move (expr), ns);
61
+ return simplify_opt (std::move (expr), state. value_set , ns);
62
62
}
63
63
#endif // ENABLE_ARRAY_FIELD_SENSITIVITY
64
64
else if (expr.id () == ID_member)
@@ -151,7 +151,10 @@ exprt field_sensitivityt::apply(
151
151
// than only the full array
152
152
index_exprt &index = to_index_expr (expr);
153
153
if (should_simplify)
154
- simplify (index.index (), ns);
154
+ {
155
+ simplify_expr_with_value_sett{state.value_set , language_mode, ns}
156
+ .simplify (index.index ());
157
+ }
155
158
156
159
if (
157
160
is_ssa_expr (index.array ()) && index.array ().type ().id () == ID_array &&
@@ -162,7 +165,10 @@ exprt field_sensitivityt::apply(
162
165
ssa_exprt tmp = to_ssa_expr (index.array ());
163
166
auto l2_index = state.rename (index.index (), ns).get ();
164
167
if (should_simplify)
165
- simplify (l2_index, ns);
168
+ {
169
+ simplify_expr_with_value_sett{state.value_set , language_mode, ns}
170
+ .simplify (l2_index);
171
+ }
166
172
bool was_l2 = !tmp.get_level_2 ().empty ();
167
173
exprt l2_size =
168
174
state.rename (to_array_type (index.array ().type ()).size (), ns).get ();
@@ -393,7 +399,10 @@ void field_sensitivityt::field_assignments_rec(
393
399
const exprt member_rhs = apply (
394
400
ns,
395
401
state,
396
- simplify_opt (member_exprt{ssa_rhs, comp.get_name (), comp.type ()}, ns),
402
+ simplify_opt (
403
+ member_exprt{ssa_rhs, comp.get_name (), comp.type ()},
404
+ state.value_set ,
405
+ ns),
397
406
false );
398
407
399
408
const exprt &member_lhs = *fs_it;
@@ -437,6 +446,7 @@ void field_sensitivityt::field_assignments_rec(
437
446
simplify_opt (
438
447
make_byte_extract (
439
448
ssa_rhs, from_integer (0 , c_index_type ()), comp.type ()),
449
+ state.value_set ,
440
450
ns),
441
451
false );
442
452
@@ -476,7 +486,9 @@ void field_sensitivityt::field_assignments_rec(
476
486
ns,
477
487
state,
478
488
simplify_opt (
479
- index_exprt{ssa_rhs, from_integer (i, type->index_type ())}, ns),
489
+ index_exprt{ssa_rhs, from_integer (i, type->index_type ())},
490
+ state.value_set ,
491
+ ns),
480
492
false );
481
493
482
494
const exprt &index_lhs = *fs_it;
@@ -558,10 +570,14 @@ bool field_sensitivityt::is_divisible(
558
570
return false ;
559
571
}
560
572
561
- exprt field_sensitivityt::simplify_opt (exprt e, const namespacet &ns) const
573
+ exprt field_sensitivityt::simplify_opt (
574
+ exprt e,
575
+ const value_sett &value_set,
576
+ const namespacet &ns) const
562
577
{
563
578
if (!should_simplify)
564
579
return e;
565
580
566
- return simplify_expr (std::move (e), ns);
581
+ simplify_expr_with_value_sett{value_set, language_mode, ns}.simplify (e);
582
+ return e;
567
583
}
0 commit comments