@@ -65,7 +65,29 @@ std::string graphml_witnesst::convert_assign_rec(
65
65
66
66
std::string result;
67
67
68
- if (assign.rhs ().id ()==ID_array)
68
+ if (assign.rhs ().id ()==" array-list" )
69
+ {
70
+ const array_typet &type=
71
+ to_array_type (ns.follow (assign.rhs ().type ()));
72
+
73
+ const auto ops=assign.rhs ().operands ();
74
+ DATA_INVARIANT (
75
+ ops.size ()%2 ==0 ,
76
+ " array-list has odd number of operands" );
77
+
78
+ for (size_t listidx=0 ; listidx!=ops.size (); listidx+=2 )
79
+ {
80
+ index_exprt index (
81
+ assign.lhs (),
82
+ ops[listidx],
83
+ type.subtype ());
84
+ if (!result.empty ())
85
+ result+=' ' ;
86
+ result+=
87
+ convert_assign_rec (identifier, code_assignt (index , ops[listidx+1 ]));
88
+ }
89
+ }
90
+ else if (assign.rhs ().id ()==ID_array)
69
91
{
70
92
const array_typet &type=
71
93
to_array_type (ns.follow (assign.rhs ().type ()));
@@ -148,7 +170,6 @@ std::string graphml_witnesst::convert_assign_rec(
148
170
149
171
result=lhs+" = " +from_expr (ns, identifier, clean_rhs)+" ;" ;
150
172
}
151
-
152
173
cache.insert ({{identifier.get_no (), &assign.read ()}, result});
153
174
return result;
154
175
}
@@ -188,6 +209,21 @@ static bool filter_out(
188
209
return false ;
189
210
}
190
211
212
+ static bool contains_symbol_prefix (const exprt &expr, const std::string &prefix){
213
+ if (expr.id ()==ID_symbol &&
214
+ has_prefix (id2string (to_symbol_expr (expr).get_identifier ()), prefix))
215
+ {
216
+ return true ;
217
+ }
218
+
219
+ forall_operands (it, expr)
220
+ {
221
+ if (contains_symbol_prefix (*it, prefix))
222
+ return true ;
223
+ }
224
+ return false ;
225
+ }
226
+
191
227
// / counterexample witness
192
228
void graphml_witnesst::operator ()(const goto_tracet &goto_trace)
193
229
{
@@ -308,16 +344,21 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
308
344
data_t .set_attribute (" key" , " createThread" );
309
345
data_t .data =std::to_string (++thread_id);
310
346
}
311
- else if (id2string (it->lhs_object .get_identifier ())
312
- .find (" #return_value" )==std::string::npos &&
313
- id2string (it->lhs_object .get_identifier ())
314
- .find (" thread" )==std::string::npos &&
315
- id2string (it->lhs_object .get_identifier ())
316
- .find (" mutex" )==std::string::npos &&
317
- (!it->lhs_object_value .is_constant () ||
318
- !it->lhs_object_value .has_operands () ||
319
- !has_prefix (id2string (it->lhs_object_value .op0 ().get (ID_value)),
320
- " INVALID-" )))
347
+ else if (
348
+ id2string (it->lhs_object .get_identifier ())
349
+ .find (" #return_value" )==std::string::npos &&
350
+ !contains_symbol_prefix (
351
+ it->lhs_object_value , " symex_dynamic::dynamic_object" ) &&
352
+ !contains_symbol_prefix (
353
+ it->lhs_object , " symex_dynamic::dynamic_object" ) &&
354
+ id2string (it->lhs_object .get_identifier ())
355
+ .find (" thread" )==std::string::npos &&
356
+ id2string (it->lhs_object .get_identifier ())
357
+ .find (" mutex" )==std::string::npos &&
358
+ (!it->lhs_object_value .is_constant () ||
359
+ !it->lhs_object_value .has_operands () ||
360
+ !has_prefix (id2string (it->lhs_object_value .op0 ().get (ID_value)),
361
+ " INVALID-" )))
321
362
{
322
363
xmlt &val=edge.new_element (" data" );
323
364
val.set_attribute (" key" , " assumption" );
0 commit comments