File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
regression/cbmc/simplify_singleton_interval_7953 Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ extern void __VERIFIER_assume (int cond );
3+ extern int __VERIFIER_nondet_int (void );
4+ int main ()
5+ {
6+ int z = __VERIFIER_nondet_int ();
7+ int k = __VERIFIER_nondet_int ();
8+ __VERIFIER_assume (1 < z );
9+ __VERIFIER_assume (1 <= z && k <= 1 );
10+ assert (0 );
11+ }
Original file line number Diff line number Diff line change 1+ CORE new-smt-backend
2+ main.c
3+
4+ ^VERIFICATION FAILED$
5+ ^EXIT=10$
6+ ^SIGNAL=0$
7+ --
8+ ^warning: ignoring
9+ --
10+ Simplification must not spuriously turn the second assumption into an equality.
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ simplify_exprt::resultt<> simplify_exprt::simplify_boolean(const exprt &expr)
151151 {
152152 mp_integer lower;
153153 mp_integer higher;
154+ exprt non_const_value;
154155 };
155156 boundst bounds;
156157
@@ -177,6 +178,7 @@ simplify_exprt::resultt<> simplify_exprt::simplify_boolean(const exprt &expr)
177178 auto int_opt =
178179 numeric_cast<mp_integer>(to_constant_expr (ge_expr->rhs ())))
179180 {
181+ bounds.non_const_value = ge_expr->lhs ();
180182 bounds.lower = *int_opt;
181183 return true ;
182184 }
@@ -199,6 +201,8 @@ simplify_exprt::resultt<> simplify_exprt::simplify_boolean(const exprt &expr)
199201 // (e.g. i >= j)
200202 if (!ge_expr->rhs ().is_constant ())
201203 return false ;
204+ if (ge_expr->lhs () != bounds.non_const_value )
205+ return false ;
202206 if (
203207 auto int_opt =
204208 numeric_cast<mp_integer>(to_constant_expr (ge_expr->rhs ())))
You can’t perform that action at this time.
0 commit comments