Skip to content

Commit 9562c80

Browse files
committed
Print (at debug level) the current SSA step being converted
1 parent 0b36342 commit 9562c80

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/goto-symex/symex_target_equation.cpp

+41
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,22 @@ void symex_target_equationt::convert_decls(
437437
void symex_target_equationt::convert_guards(
438438
prop_convt &prop_conv)
439439
{
440+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
441+
const bool debug_output = verbosity >= messaget::M_DEBUG;
442+
440443
for(auto &step : SSA_steps)
441444
{
442445
if(step.ignore)
443446
step.guard_literal=const_literal(false);
444447
else
445448
{
449+
if(debug_output)
450+
{
451+
std::ostringstream oss;
452+
step.output(oss);
453+
prop_conv.debug() << oss.str() << messaget::eom;
454+
}
455+
446456
try
447457
{
448458
step.guard_literal = prop_conv.convert(step.guard);
@@ -462,6 +472,9 @@ void symex_target_equationt::convert_guards(
462472
void symex_target_equationt::convert_assumptions(
463473
prop_convt &prop_conv)
464474
{
475+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
476+
const bool debug_output = verbosity >= messaget::M_DEBUG;
477+
465478
for(auto &step : SSA_steps)
466479
{
467480
if(step.is_assume())
@@ -470,6 +483,13 @@ void symex_target_equationt::convert_assumptions(
470483
step.cond_literal=const_literal(true);
471484
else
472485
{
486+
if(debug_output)
487+
{
488+
std::ostringstream oss;
489+
step.output(oss);
490+
prop_conv.debug() << oss.str() << messaget::eom;
491+
}
492+
473493
try
474494
{
475495
step.cond_literal = prop_conv.convert(step.cond_expr);
@@ -490,6 +510,9 @@ void symex_target_equationt::convert_assumptions(
490510
void symex_target_equationt::convert_goto_instructions(
491511
prop_convt &prop_conv)
492512
{
513+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
514+
const bool debug_output = verbosity >= messaget::M_DEBUG;
515+
493516
for(auto &step : SSA_steps)
494517
{
495518
if(step.is_goto())
@@ -498,6 +521,13 @@ void symex_target_equationt::convert_goto_instructions(
498521
step.cond_literal=const_literal(true);
499522
else
500523
{
524+
if(debug_output)
525+
{
526+
std::ostringstream oss;
527+
step.output(oss);
528+
prop_conv.debug() << oss.str() << messaget::eom;
529+
}
530+
501531
try
502532
{
503533
step.cond_literal = prop_conv.convert(step.cond_expr);
@@ -519,13 +549,24 @@ void symex_target_equationt::convert_goto_instructions(
519549
void symex_target_equationt::convert_constraints(
520550
decision_proceduret &decision_procedure) const
521551
{
552+
const unsigned verbosity =
553+
decision_procedure.get_message_handler().get_verbosity();
554+
const bool debug_output = verbosity >= messaget::M_DEBUG;
555+
522556
for(const auto &step : SSA_steps)
523557
{
524558
if(step.is_constraint())
525559
{
526560
if(step.ignore)
527561
continue;
528562

563+
if(debug_output)
564+
{
565+
std::ostringstream oss;
566+
step.output(oss);
567+
decision_procedure.debug() << oss.str() << messaget::eom;
568+
}
569+
529570
decision_procedure.set_to_true(step.cond_expr);
530571
}
531572
}

0 commit comments

Comments
 (0)