2019-07-30 10:18:03 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract LoopFor2 {
|
|
|
|
uint[] b;
|
|
|
|
uint[] c;
|
|
|
|
|
|
|
|
function testUnboundedForLoop(uint n) public {
|
|
|
|
b[0] = 900;
|
|
|
|
uint[] memory a = b;
|
|
|
|
require(n > 0 && n < 100);
|
|
|
|
for (uint i = 0; i < n; i += 1) {
|
|
|
|
b[i] = i + 1;
|
|
|
|
c[i] = b[i];
|
|
|
|
}
|
2020-02-12 01:52:35 +00:00
|
|
|
// This is safe but too hard to solve currently.
|
2019-07-30 10:18:03 +00:00
|
|
|
assert(b[0] == c[0]);
|
|
|
|
assert(a[0] == 900);
|
|
|
|
assert(b[0] == 900);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
2020-02-12 01:52:35 +00:00
|
|
|
// Warning: (316-336): Assertion violation happens here
|
|
|
|
// Warning: (363-382): Assertion violation happens here
|