Skip to content

Commit 4705086

Browse files
committed
Print (at debug level) the current SSA step being converted
1 parent dab7580 commit 4705086

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

src/goto-symex/symex_target_equation.cpp

+54
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,23 @@ void symex_target_equationt::convert(
400400
void symex_target_equationt::convert_assignments(
401401
decision_proceduret &decision_procedure) const
402402
{
403+
const unsigned verbosity =
404+
decision_procedure.get_message_handler().get_verbosity();
405+
const bool debug_output = verbosity >= messaget::M_DEBUG;
406+
403407
for(const auto &step : SSA_steps)
404408
{
405409
if(step.is_assignment() && !step.ignore)
410+
{
411+
if(debug_output)
412+
{
413+
std::ostringstream oss;
414+
step.output(oss);
415+
decision_procedure.debug() << oss.str() << messaget::eom;
416+
}
417+
406418
decision_procedure.set_to_true(step.cond_expr);
419+
}
407420
}
408421
}
409422

@@ -437,12 +450,22 @@ void symex_target_equationt::convert_decls(
437450
void symex_target_equationt::convert_guards(
438451
prop_convt &prop_conv)
439452
{
453+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
454+
const bool debug_output = verbosity >= messaget::M_DEBUG;
455+
440456
for(auto &step : SSA_steps)
441457
{
442458
if(step.ignore)
443459
step.guard_literal=const_literal(false);
444460
else
445461
{
462+
if(debug_output)
463+
{
464+
std::ostringstream oss;
465+
step.output(oss);
466+
prop_conv.debug() << oss.str() << messaget::eom;
467+
}
468+
446469
try
447470
{
448471
step.guard_literal = prop_conv.convert(step.guard);
@@ -462,6 +485,9 @@ void symex_target_equationt::convert_guards(
462485
void symex_target_equationt::convert_assumptions(
463486
prop_convt &prop_conv)
464487
{
488+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
489+
const bool debug_output = verbosity >= messaget::M_DEBUG;
490+
465491
for(auto &step : SSA_steps)
466492
{
467493
if(step.is_assume())
@@ -470,6 +496,13 @@ void symex_target_equationt::convert_assumptions(
470496
step.cond_literal=const_literal(true);
471497
else
472498
{
499+
if(debug_output)
500+
{
501+
std::ostringstream oss;
502+
step.output(oss);
503+
prop_conv.debug() << oss.str() << messaget::eom;
504+
}
505+
473506
try
474507
{
475508
step.cond_literal = prop_conv.convert(step.cond_expr);
@@ -490,6 +523,9 @@ void symex_target_equationt::convert_assumptions(
490523
void symex_target_equationt::convert_goto_instructions(
491524
prop_convt &prop_conv)
492525
{
526+
const unsigned verbosity = prop_conv.get_message_handler().get_verbosity();
527+
const bool debug_output = verbosity >= messaget::M_DEBUG;
528+
493529
for(auto &step : SSA_steps)
494530
{
495531
if(step.is_goto())
@@ -498,6 +534,13 @@ void symex_target_equationt::convert_goto_instructions(
498534
step.cond_literal=const_literal(true);
499535
else
500536
{
537+
if(debug_output)
538+
{
539+
std::ostringstream oss;
540+
step.output(oss);
541+
prop_conv.debug() << oss.str() << messaget::eom;
542+
}
543+
501544
try
502545
{
503546
step.cond_literal = prop_conv.convert(step.cond_expr);
@@ -519,12 +562,23 @@ void symex_target_equationt::convert_goto_instructions(
519562
void symex_target_equationt::convert_constraints(
520563
decision_proceduret &decision_procedure) const
521564
{
565+
const unsigned verbosity =
566+
decision_procedure.get_message_handler().get_verbosity();
567+
const bool debug_output = verbosity >= messaget::M_DEBUG;
568+
522569
for(const auto &step : SSA_steps)
523570
{
524571
if(step.is_constraint())
525572
{
526573
if(!step.ignore)
527574
{
575+
if(debug_output)
576+
{
577+
std::ostringstream oss;
578+
step.output(oss);
579+
decision_procedure.debug() << oss.str() << messaget::eom;
580+
}
581+
528582
try
529583
{
530584
decision_procedure.set_to_true(step.cond_expr);

0 commit comments

Comments
 (0)