File tree 3 files changed +25
-0
lines changed
regression/cbmc/simplify_singleton_interval_7953
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)
151
151
{
152
152
mp_integer lower;
153
153
mp_integer higher;
154
+ exprt non_const_value;
154
155
};
155
156
boundst bounds;
156
157
@@ -177,6 +178,7 @@ simplify_exprt::resultt<> simplify_exprt::simplify_boolean(const exprt &expr)
177
178
auto int_opt =
178
179
numeric_cast<mp_integer>(to_constant_expr (ge_expr->rhs ())))
179
180
{
181
+ bounds.non_const_value = ge_expr->lhs ();
180
182
bounds.lower = *int_opt;
181
183
return true ;
182
184
}
@@ -199,6 +201,8 @@ simplify_exprt::resultt<> simplify_exprt::simplify_boolean(const exprt &expr)
199
201
// (e.g. i >= j)
200
202
if (!ge_expr->rhs ().is_constant ())
201
203
return false ;
204
+ if (ge_expr->lhs () != bounds.non_const_value )
205
+ return false ;
202
206
if (
203
207
auto int_opt =
204
208
numeric_cast<mp_integer>(to_constant_expr (ge_expr->rhs ())))
You can’t perform that action at this time.
0 commit comments