We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f815a7 commit beddcafCopy full SHA for beddcaf
src/solvers/flattening/boolbv.cpp
@@ -630,22 +630,11 @@ bool boolbvt::boolbv_set_equality_to_true(const equal_exprt &expr)
630
631
void boolbvt::set_to(const exprt &expr, bool value)
632
{
633
- if(expr.type().id()!=ID_bool)
634
- {
635
- error() << "boolbvt::set_to got non-boolean operand: "
636
- << expr.pretty() << eom;
637
- throw 0;
638
- }
639
-
640
- if(value)
641
642
- if(expr.id()==ID_equal)
643
644
- if(!boolbv_set_equality_to_true(to_equal_expr(expr)))
645
- return;
646
647
+ PRECONDITION(expr.type().id() == ID_bool);
648
+ const auto equal_expr = expr_try_dynamic_cast<equal_exprt>(expr);
+ if(value && equal_expr && !boolbv_set_equality_to_true(*equal_expr))
+ return;
649
return SUB::set_to(expr, value);
650
}
651
0 commit comments