@@ -15,6 +15,7 @@ Author: Daniel Kroening
15
15
#include < util/byte_operators.h>
16
16
#include < util/c_types.h>
17
17
#include < util/cprover_prefix.h>
18
+ #include < util/pointer_predicates.h>
18
19
#include < util/prefix.h>
19
20
#include < util/ssa_expr.h>
20
21
@@ -216,6 +217,23 @@ static bool filter_out(
216
217
return false ;
217
218
}
218
219
220
+ static bool contains_symbol_prefix (const exprt &expr, const std::string &prefix)
221
+ {
222
+ if (
223
+ expr.id () == ID_symbol &&
224
+ has_prefix (id2string (to_symbol_expr (expr).get_identifier ()), prefix))
225
+ {
226
+ return true ;
227
+ }
228
+
229
+ forall_operands (it, expr)
230
+ {
231
+ if (contains_symbol_prefix (*it, prefix))
232
+ return true ;
233
+ }
234
+ return false ;
235
+ }
236
+
219
237
// / counterexample witness
220
238
void graphml_witnesst::operator ()(const goto_tracet &goto_trace)
221
239
{
@@ -322,28 +340,38 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
322
340
data_l.data =id2string (graphml[from].line );
323
341
}
324
342
325
- if (it->type ==goto_trace_stept::typet::ASSIGNMENT &&
326
- it->full_lhs_value .is_not_nil () &&
327
- it->full_lhs .is_not_nil ())
343
+ const auto lhs_object = it->get_lhs_object ();
344
+ if (
345
+ it->type == goto_trace_stept::typet::ASSIGNMENT &&
346
+ lhs_object.has_value ())
328
347
{
329
- xmlt &val=edge.new_element (" data" );
330
- val.set_attribute (" key" , " assumption" );
331
-
332
- code_assignt assign{it->full_lhs , it->full_lhs_value };
333
- irep_idt identifier = irep_idt ();
334
- if (const auto object = it->get_lhs_object ())
335
- identifier = object->get_identifier ();
336
- val.data = convert_assign_rec (identifier, assign);
337
-
338
- xmlt &val_s=edge.new_element (" data" );
339
- val_s.set_attribute (" key" , " assumption.scope" );
340
- val_s.data = id2string (it->function_id );
341
-
342
- if (has_prefix (val.data , " \\ result =" ))
348
+ const std::string &lhs_id = id2string (lhs_object->get_identifier ());
349
+ if (
350
+ !contains_symbol_prefix (
351
+ it->full_lhs_value , SYMEX_DYNAMIC_PREFIX " dynamic_object" ) &&
352
+ !contains_symbol_prefix (
353
+ it->full_lhs , SYMEX_DYNAMIC_PREFIX " dynamic_object" ) &&
354
+ (!it->full_lhs_value .is_constant () ||
355
+ !it->full_lhs_value .has_operands () ||
356
+ !has_prefix (
357
+ id2string (it->full_lhs_value .op0 ().get (ID_value)), " INVALID-" )))
343
358
{
344
- xmlt &val_f = edge.new_element (" data" );
345
- val_f.set_attribute (" key" , " assumption.resultfunction" );
346
- val_f.data = id2string (it->function_id );
359
+ xmlt &val = edge.new_element (" data" );
360
+ val.set_attribute (" key" , " assumption" );
361
+
362
+ code_assignt assign{it->full_lhs , it->full_lhs_value };
363
+ val.data = convert_assign_rec (lhs_id, assign);
364
+
365
+ xmlt &val_s = edge.new_element (" data" );
366
+ val_s.set_attribute (" key" , " assumption.scope" );
367
+ val_s.data = id2string (it->function_id );
368
+
369
+ if (has_prefix (val.data , " \\ result =" ))
370
+ {
371
+ xmlt &val_f = edge.new_element (" data" );
372
+ val_f.set_attribute (" key" , " assumption.resultfunction" );
373
+ val_f.data = id2string (it->function_id );
374
+ }
347
375
}
348
376
}
349
377
else if (it->type ==goto_trace_stept::typet::GOTO &&
0 commit comments