37
37
class goto_statet
38
38
{
39
39
public:
40
+ // / Distance from entry
40
41
unsigned depth = 0 ;
42
+
41
43
symex_level2t level2;
44
+
45
+ // / Uses level 1 names, and is used to do dereferencing
42
46
value_sett value_set;
47
+
48
+ // A guard is a particular condition that has to pass for an instruction
49
+ // to be executed. The easiest example is an if/else: each instruction along
50
+ // the if branch will be guarded by the condition of the if (and if there
51
+ // is an else branch then instructions on it will be guarded by the negation
52
+ // of the condition of the if).
43
53
guardt guard{true_exprt{}};
54
+
44
55
symex_targett::sourcet source;
56
+
57
+ // Map L1 names to (L2) constants. Values will be evicted from this map
58
+ // when they become non-constant. This is used to propagate values that have
59
+ // been worked out to only have one possible value.
60
+ //
61
+ // "constants" can include symbols, but only in the context of an address-of
62
+ // op (i.e. &x can be propagated), and an address-taken thing should only be
63
+ // L1.
45
64
std::map<irep_idt, exprt> propagation;
65
+
66
+ void output_propagation_map (std::ostream &);
67
+
68
+ // / Threads
46
69
unsigned atomic_section_id = 0 ;
70
+
47
71
std::unordered_map<irep_idt, local_safe_pointerst> safe_pointers;
48
72
unsigned total_vccs = 0 ;
49
73
unsigned remaining_vccs = 0 ;
50
74
51
- goto_statet (const class goto_symex_statet &s);
75
+ explicit goto_statet (const class goto_symex_statet &s);
76
+ goto_statet () = default ;
52
77
};
53
78
54
79
// stack frames -- these are used for function calls and
@@ -96,7 +121,7 @@ struct framet
96
121
// / state will be copied into a \ref goto_statet, stored in a map for later
97
122
// / reference and then merged again (via merge_goto) once it reaches a
98
123
// / control-flow graph convergence.
99
- class goto_symex_statet final
124
+ class goto_symex_statet final : public goto_statet
100
125
{
101
126
public:
102
127
goto_symex_statet ();
@@ -116,15 +141,6 @@ class goto_symex_statet final
116
141
// / for error traces even after symbolic execution has finished.
117
142
symbol_tablet symbol_table;
118
143
119
- // / distance from entry
120
- unsigned depth;
121
-
122
- // A guard is a particular condition that has to pass for an instruction
123
- // to be executed. The easiest example is an if/else: each instruction along
124
- // the if branch will be guarded by the condition of the if (and if there
125
- // is an else branch then instructions on it will be guarded by the negation
126
- // of the condition of the if).
127
- guardt guard{true_exprt{}};
128
144
symex_targett::sourcet source;
129
145
symex_target_equationt *symex_target;
130
146
@@ -133,17 +149,6 @@ class goto_symex_statet final
133
149
134
150
symex_level0t level0;
135
151
symex_level1t level1;
136
- symex_level2t level2;
137
-
138
- // Map L1 names to (L2) constants. Values will be evicted from this map
139
- // when they become non-constant. This is used to propagate values that have
140
- // been worked out to only have one possible value.
141
- //
142
- // "constants" can include symbols, but only in the context of an address-of
143
- // op (i.e. &x can be propagated), and an address-taken thing should only be
144
- // L1.
145
- std::map<irep_idt, exprt> propagation;
146
- void output_propagation_map (std::ostream &);
147
152
148
153
// Symex renaming levels.
149
154
enum levelt { L0=0 , L1=1 , L2=2 };
@@ -204,24 +209,8 @@ class goto_symex_statet final
204
209
l1_typest l1_types;
205
210
206
211
public:
207
- std::unordered_map<irep_idt, local_safe_pointerst> safe_pointers;
208
-
209
- // uses level 1 names, and is used to
210
- // do dereferencing
211
- value_sett value_set;
212
-
213
- explicit goto_symex_statet (const goto_statet &s)
214
- : depth(s.depth),
215
- guard(s.guard),
216
- source(s.source),
217
- propagation(s.propagation),
218
- safe_pointers(s.safe_pointers),
219
- value_set(s.value_set),
220
- atomic_section_id(s.atomic_section_id),
221
- total_vccs(s.total_vccs),
222
- remaining_vccs(s.remaining_vccs)
212
+ explicit goto_symex_statet (const goto_statet &s) : goto_statet(s)
223
213
{
224
- level2.current_names = s.level2 .current_names ;
225
214
}
226
215
227
216
// gotos
@@ -273,15 +262,12 @@ class goto_symex_statet final
273
262
void print_backtrace (std::ostream &) const ;
274
263
275
264
// threads
276
- unsigned atomic_section_id;
277
265
typedef std::pair<unsigned , std::list<guardt> > a_s_r_entryt;
278
266
typedef std::list<guardt> a_s_w_entryt;
279
267
std::unordered_map<ssa_exprt, a_s_r_entryt, irep_hash> read_in_atomic_section;
280
268
std::unordered_map<ssa_exprt, a_s_w_entryt, irep_hash>
281
269
written_in_atomic_section;
282
270
283
- unsigned total_vccs, remaining_vccs;
284
-
285
271
struct threadt
286
272
{
287
273
goto_programt::const_targett pc;
0 commit comments