@@ -351,11 +351,11 @@ void symex_target_equationt::convert(
351
351
}
352
352
353
353
void symex_target_equationt::convert_assignments (
354
- decision_proceduret &decision_procedure) const
354
+ decision_proceduret &decision_procedure)
355
355
{
356
- for (const auto &step : SSA_steps)
356
+ for (auto &step : SSA_steps)
357
357
{
358
- if (step.is_assignment () && !step.ignore )
358
+ if (step.is_assignment () && !step.ignore && !step. converted )
359
359
{
360
360
decision_procedure.conditional_output (
361
361
decision_procedure.debug (),
@@ -365,22 +365,23 @@ void symex_target_equationt::convert_assignments(
365
365
});
366
366
367
367
decision_procedure.set_to_true (step.cond_expr );
368
+ step.converted = true ;
368
369
}
369
370
}
370
371
}
371
372
372
- void symex_target_equationt::convert_decls (
373
- prop_convt &prop_conv) const
373
+ void symex_target_equationt::convert_decls (prop_convt &prop_conv)
374
374
{
375
- for (const auto &step : SSA_steps)
375
+ for (auto &step : SSA_steps)
376
376
{
377
- if (step.is_decl () && !step.ignore )
377
+ if (step.is_decl () && !step.ignore && !step. converted )
378
378
{
379
379
// The result is not used, these have no impact on
380
380
// the satisfiability of the formula.
381
381
try
382
382
{
383
383
prop_conv.convert (step.cond_expr );
384
+ step.converted = true ;
384
385
}
385
386
catch (const bitvector_conversion_exceptiont &)
386
387
{
@@ -489,31 +490,27 @@ void symex_target_equationt::convert_goto_instructions(
489
490
}
490
491
491
492
void symex_target_equationt::convert_constraints (
492
- decision_proceduret &decision_procedure) const
493
+ decision_proceduret &decision_procedure)
493
494
{
494
- for (const auto &step : SSA_steps)
495
+ for (auto &step : SSA_steps)
495
496
{
496
- if (step.is_constraint ())
497
+ if (step.is_constraint () && !step. ignore && !step. converted )
497
498
{
498
- if (!step.ignore )
499
- {
500
- decision_procedure.conditional_output (
501
- decision_procedure.debug (),
502
- [&step](messaget::mstreamt &mstream) {
503
- step.output (mstream);
504
- mstream << messaget::eom;
505
- });
499
+ decision_procedure.conditional_output (
500
+ decision_procedure.debug (), [&step](messaget::mstreamt &mstream) {
501
+ step.output (mstream);
502
+ mstream << messaget::eom;
503
+ });
506
504
507
- try
508
- {
509
- decision_procedure.set_to_true (step.cond_expr );
510
- }
511
- catch (const bitvector_conversion_exceptiont &)
512
- {
513
- util_throw_with_nested (
514
- equation_conversion_exceptiont (
515
- " Error converting constraints for step" , step));
516
- }
505
+ try
506
+ {
507
+ decision_procedure.set_to_true (step.cond_expr );
508
+ step.converted = true ;
509
+ }
510
+ catch (const bitvector_conversion_exceptiont &)
511
+ {
512
+ util_throw_with_nested (equation_conversion_exceptiont (
513
+ " Error converting constraints for step" , step));
517
514
}
518
515
}
519
516
}
@@ -534,8 +531,13 @@ void symex_target_equationt::convert_assertions(
534
531
{
535
532
for (auto &step : SSA_steps)
536
533
{
537
- if (step.is_assert ())
534
+ // ignore already converted assertions in the error trace
535
+ if (step.is_assert () && step.converted )
536
+ step.ignore = true ;
537
+
538
+ if (step.is_assert () && !step.ignore && !step.converted )
538
539
{
540
+ step.converted = true ;
539
541
prop_conv.set_to_false (step.cond_expr );
540
542
step.cond_literal =const_literal (false );
541
543
return ; // prevent further assumptions!
@@ -556,8 +558,14 @@ void symex_target_equationt::convert_assertions(
556
558
557
559
for (auto &step : SSA_steps)
558
560
{
559
- if (step.is_assert ())
561
+ // ignore already converted assertions in the error trace
562
+ if (step.is_assert () && step.converted )
563
+ step.ignore = true ;
564
+
565
+ if (step.is_assert () && !step.ignore && !step.converted )
560
566
{
567
+ step.converted = true ;
568
+
561
569
prop_conv.conditional_output (
562
570
prop_conv.debug (),
563
571
[&step](messaget::mstreamt &mstream) {
0 commit comments