@@ -82,7 +82,7 @@ void goto_trace_stept::output(
82
82
}
83
83
84
84
if (is_assert () || is_assume () || is_goto ())
85
- out << " (" << cond_value << " ) " ;
85
+ out << " (" << cond_value << ' ) ' ;
86
86
else if (is_function_call () || is_function_return ())
87
87
out << ' ' << function_identifier;
88
88
@@ -233,7 +233,7 @@ std::string trace_numeric_value(
233
233
}
234
234
235
235
void trace_value (
236
- std::ostream &out,
236
+ messaget::mstreamt &out,
237
237
const namespacet &ns,
238
238
const optionalt<symbol_exprt> &lhs_object,
239
239
const exprt &full_lhs,
@@ -245,49 +245,44 @@ void trace_value(
245
245
if (lhs_object.has_value ())
246
246
identifier=lhs_object->get_identifier ();
247
247
248
- std::string value_string ;
248
+ out << " " << from_expr (ns, identifier, full_lhs) << ' = ' ;
249
249
250
250
if (value.is_nil ())
251
- value_string= " (assignment removed)" ;
251
+ out << " (assignment removed)" ;
252
252
else
253
253
{
254
- value_string= from_expr (ns, identifier, value);
254
+ out << from_expr (ns, identifier, value);
255
255
256
256
// the binary representation
257
- value_string += " (" + trace_numeric_value (value, ns, options) + " )" ;
257
+ out << ' ' << messaget::faint << ' ('
258
+ << trace_numeric_value (value, ns, options) << ' )' << messaget::reset;
258
259
}
259
260
260
- out << " "
261
- << from_expr (ns, identifier, full_lhs)
262
- << " =" << value_string
263
- << " \n " ;
261
+ out << ' \n ' ;
264
262
}
265
263
266
264
void show_state_header (
267
- std::ostream &out,
265
+ messaget::mstreamt &out,
268
266
const namespacet &ns,
269
267
const goto_trace_stept &state,
270
268
const source_locationt &source_location,
271
269
unsigned step_nr,
272
270
const trace_optionst &options)
273
271
{
274
- out << " \n " ;
272
+ out << ' \n ' ;
275
273
276
274
if (step_nr == 0 )
277
275
out << " Initial State" ;
278
276
else
279
277
out << " State " << step_nr;
280
278
281
- out << " " << source_location << " thread " << state.thread_nr << " \n " ;
282
- out << " ----------------------------------------------------"
283
- << " \n " ;
279
+ out << ' ' << source_location << " thread " << state.thread_nr << ' \n ' ;
280
+ out << " ----------------------------------------------------" << ' \n ' ;
284
281
285
282
if (options.show_code )
286
283
{
287
- out << as_string (ns, *state.pc )
288
- << " \n " ;
289
- out << " ----------------------------------------------------"
290
- << " \n " ;
284
+ out << as_string (ns, *state.pc ) << ' \n ' ;
285
+ out << " ----------------------------------------------------" << ' \n ' ;
291
286
}
292
287
}
293
288
@@ -304,7 +299,7 @@ bool is_index_member_symbol(const exprt &src)
304
299
}
305
300
306
301
void show_full_goto_trace (
307
- std::ostream &out,
302
+ messaget::mstreamt &out,
308
303
const namespacet &ns,
309
304
const goto_tracet &goto_trace,
310
305
const trace_optionst &options)
@@ -324,33 +319,33 @@ void show_full_goto_trace(
324
319
case goto_trace_stept::typet::ASSERT:
325
320
if (!step.cond_value )
326
321
{
327
- out << " \n " ;
328
- out << " Violated property:" << " \n " ;
322
+ out << ' \n ' ;
323
+ out << messaget::red << " Violated property:" << messaget::reset << ' \n ' ;
329
324
if (!step.pc ->source_location .is_nil ())
330
- out << " " << step.pc ->source_location << " \n " ;
331
- out << " " << step.comment << " \n " ;
325
+ out << " " << step.pc ->source_location << ' \n ' ;
326
+ out << " " << messaget::red << step.comment << messaget::reset << ' \n ' ;
332
327
333
328
if (step.pc ->is_assert ())
334
329
out << " " << from_expr (ns, step.pc ->function , step.pc ->guard )
335
330
<< ' \n ' ;
336
331
337
- out << " \n " ;
332
+ out << ' \n ' ;
338
333
}
339
334
break ;
340
335
341
336
case goto_trace_stept::typet::ASSUME:
342
337
if (!step.cond_value )
343
338
{
344
- out << " \n " ;
345
- out << " Violated assumption:" << " \n " ;
339
+ out << ' \n ' ;
340
+ out << " Violated assumption:" << ' \n ' ;
346
341
if (!step.pc ->source_location .is_nil ())
347
- out << " " << step.pc ->source_location << " \n " ;
342
+ out << " " << step.pc ->source_location << ' \n ' ;
348
343
349
344
if (step.pc ->is_assume ())
350
345
out << " " << from_expr (ns, step.pc ->function , step.pc ->guard )
351
346
<< ' \n ' ;
352
347
353
- out << " \n " ;
348
+ out << ' \n ' ;
354
349
}
355
350
break ;
356
351
@@ -403,50 +398,50 @@ void show_full_goto_trace(
403
398
printf_formattert printf_formatter (ns);
404
399
printf_formatter (id2string (step.format_string ), step.io_args );
405
400
printf_formatter.print (out);
406
- out << " \n " ;
401
+ out << ' \n ' ;
407
402
}
408
403
else
409
404
{
410
405
show_state_header (
411
406
out, ns, step, step.pc ->source_location , step.step_nr , options);
412
- out << " OUTPUT " << step.io_id << " : " ;
407
+ out << " OUTPUT " << step.io_id << ' : ' ;
413
408
414
409
for (std::list<exprt>::const_iterator
415
410
l_it=step.io_args .begin ();
416
411
l_it!=step.io_args .end ();
417
412
l_it++)
418
413
{
419
414
if (l_it!=step.io_args .begin ())
420
- out << " ; " ;
421
- out << " " << from_expr (ns, step.pc ->function , *l_it);
415
+ out << ' ; ' ;
416
+ out << ' ' << from_expr (ns, step.pc ->function , *l_it);
422
417
423
418
// the binary representation
424
- out << " (" << trace_numeric_value (*l_it, ns, options) << " ) " ;
419
+ out << " (" << trace_numeric_value (*l_it, ns, options) << ' ) ' ;
425
420
}
426
421
427
- out << " \n " ;
422
+ out << ' \n ' ;
428
423
}
429
424
break ;
430
425
431
426
case goto_trace_stept::typet::INPUT:
432
427
show_state_header (
433
428
out, ns, step, step.pc ->source_location , step.step_nr , options);
434
- out << " INPUT " << step.io_id << " : " ;
429
+ out << " INPUT " << step.io_id << ' : ' ;
435
430
436
431
for (std::list<exprt>::const_iterator
437
432
l_it=step.io_args .begin ();
438
433
l_it!=step.io_args .end ();
439
434
l_it++)
440
435
{
441
436
if (l_it!=step.io_args .begin ())
442
- out << " ; " ;
443
- out << " " << from_expr (ns, step.pc ->function , *l_it);
437
+ out << ' ; ' ;
438
+ out << ' ' << from_expr (ns, step.pc ->function , *l_it);
444
439
445
440
// the binary representation
446
- out << " (" << trace_numeric_value (*l_it, ns, options) << " ) " ;
441
+ out << " (" << trace_numeric_value (*l_it, ns, options) << ' ) ' ;
447
442
}
448
443
449
- out << " \n " ;
444
+ out << ' \n ' ;
450
445
break ;
451
446
452
447
case goto_trace_stept::typet::FUNCTION_CALL:
@@ -497,7 +492,7 @@ void show_full_goto_trace(
497
492
}
498
493
499
494
void show_goto_stack_trace (
500
- std::ostream &out,
495
+ messaget::mstreamt &out,
501
496
const namespacet &ns,
502
497
const goto_tracet &goto_trace,
503
498
const trace_optionst &options)
@@ -573,7 +568,7 @@ void show_goto_stack_trace(
573
568
}
574
569
575
570
void show_goto_trace (
576
- std::ostream &out,
571
+ messaget::mstreamt &out,
577
572
const namespacet &ns,
578
573
const goto_tracet &goto_trace,
579
574
const trace_optionst &options)
@@ -585,7 +580,7 @@ void show_goto_trace(
585
580
}
586
581
587
582
void show_goto_trace (
588
- std::ostream &out,
583
+ messaget::mstreamt &out,
589
584
const namespacet &ns,
590
585
const goto_tracet &goto_trace)
591
586
{
0 commit comments