@@ -144,8 +144,14 @@ std::string graphml_witnesst::convert_assign_rec(
144
144
exprt clean_lhs = assign.lhs ();
145
145
remove_l0_l1 (clean_lhs);
146
146
std::string lhs = expr_to_string (ns, identifier, clean_lhs);
147
- if (lhs.find (' $' )!=std::string::npos)
147
+
148
+ if (
149
+ lhs.find (" #return_value" ) != std::string::npos ||
150
+ (lhs.find (' $' ) != std::string::npos &&
151
+ has_prefix (lhs, " return_value___VERIFIER_nondet_" )))
152
+ {
148
153
lhs=" \\ result" ;
154
+ }
149
155
150
156
result = lhs + " = " + expr_to_string (ns, identifier, clean_rhs) + " ;" ;
151
157
}
@@ -300,13 +306,23 @@ void graphml_witnesst::operator()(const goto_tracet &goto_trace)
300
306
{
301
307
xmlt &val=edge.new_element (" data" );
302
308
val.set_attribute (" key" , " assumption" );
303
- val.data = expr_to_string (ns, it->function_id , it->full_lhs ) + " = " +
304
- expr_to_string (ns, it->function_id , it->full_lhs_value ) +
305
- " ;" ;
309
+
310
+ code_assignt assign{it->full_lhs , it->full_lhs_value };
311
+ irep_idt identifier = irep_idt ();
312
+ if (const auto object = it->get_lhs_object ())
313
+ identifier = object->get_identifier ();
314
+ val.data = convert_assign_rec (identifier, assign);
306
315
307
316
xmlt &val_s=edge.new_element (" data" );
308
317
val_s.set_attribute (" key" , " assumption.scope" );
309
318
val_s.data = id2string (it->function_id );
319
+
320
+ if (has_prefix (val.data , " \\ result =" ))
321
+ {
322
+ xmlt &val_f = edge.new_element (" data" );
323
+ val_f.set_attribute (" key" , " assumption.resultfunction" );
324
+ val_f.data = id2string (it->function_id );
325
+ }
310
326
}
311
327
else if (it->type ==goto_trace_stept::typet::GOTO &&
312
328
it->pc ->is_goto ())
0 commit comments