2019-07-17 16:01:14 +00:00
|
|
|
contract C {
|
|
|
|
uint x;
|
|
|
|
|
|
|
|
function f() public {
|
|
|
|
if (x == 0)
|
|
|
|
x = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function g() public {
|
|
|
|
if (x == 1)
|
|
|
|
x = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function h() public {
|
|
|
|
if (x == 2)
|
|
|
|
x = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function shows that (x < 9) is not inductive and
|
|
|
|
// a stronger invariant is needed to be found.
|
|
|
|
// (x < 3) is the one found in the end.
|
|
|
|
function j() public {
|
|
|
|
if (x == 7)
|
|
|
|
x = 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
function i() public view {
|
|
|
|
assert(x < 9);
|
|
|
|
}
|
|
|
|
}
|
2019-12-04 15:39:34 +00:00
|
|
|
// ====
|
2021-03-31 15:11:54 +00:00
|
|
|
// SMTEngine: all
|
2019-12-04 15:39:34 +00:00
|
|
|
// SMTSolvers: z3
|
2021-03-12 23:02:36 +00:00
|
|
|
// ----
|