2020-05-28 11:05:56 +00:00
|
|
|
pragma experimental SMTChecker;
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
uint[] a;
|
|
|
|
uint[][] b;
|
2021-03-23 18:15:14 +00:00
|
|
|
function p() public { a.push(); }
|
|
|
|
function q() public { b.push().push(); }
|
|
|
|
function f(uint x, uint v) public {
|
|
|
|
require(x < a.length);
|
2020-05-28 11:05:56 +00:00
|
|
|
a[x] = v;
|
|
|
|
delete a;
|
2021-03-23 18:15:14 +00:00
|
|
|
assert(a.length == 0);
|
2020-05-28 11:05:56 +00:00
|
|
|
}
|
|
|
|
function g(uint x, uint y, uint v) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < b.length);
|
|
|
|
require(y < b[x].length);
|
2020-05-28 11:05:56 +00:00
|
|
|
b[x][y] = v;
|
|
|
|
delete b;
|
2021-03-23 18:15:14 +00:00
|
|
|
assert(b.length == 0);
|
2020-05-28 11:05:56 +00:00
|
|
|
}
|
|
|
|
function h(uint x, uint y, uint v) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < b.length);
|
|
|
|
require(y < b[x].length);
|
2020-05-28 11:05:56 +00:00
|
|
|
b[x][y] = v;
|
|
|
|
delete b[x];
|
2021-03-23 18:15:14 +00:00
|
|
|
assert(b[x].length == 0);
|
2020-05-28 11:05:56 +00:00
|
|
|
}
|
|
|
|
function i(uint x, uint y, uint v) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < b.length);
|
|
|
|
require(y < b[x].length);
|
2020-05-28 11:05:56 +00:00
|
|
|
b[x][y] = v;
|
2021-03-23 18:15:14 +00:00
|
|
|
require(y < b.length);
|
2020-05-28 11:05:56 +00:00
|
|
|
delete b[y];
|
2021-03-23 18:15:14 +00:00
|
|
|
assert(b[y].length == 0);
|
2020-05-28 11:05:56 +00:00
|
|
|
}
|
|
|
|
function j(uint x, uint y, uint z, uint v) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < b.length);
|
|
|
|
require(y < b[x].length);
|
2020-05-28 11:05:56 +00:00
|
|
|
b[x][y] = v;
|
2021-03-23 18:15:14 +00:00
|
|
|
require(z < b.length);
|
2020-05-28 11:05:56 +00:00
|
|
|
delete b[z];
|
|
|
|
// Not necessarily the case.
|
2021-03-23 18:15:14 +00:00
|
|
|
require(y < b.length);
|
|
|
|
require(x < b[x].length);
|
|
|
|
// Disabled because of Spacer nondeterminism.
|
|
|
|
//assert(b[y][x] == 0);
|
2020-05-28 11:05:56 +00:00
|
|
|
}
|
|
|
|
function setA(uint x, uint y) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < a.length);
|
2020-05-28 11:05:56 +00:00
|
|
|
a[x] = y;
|
|
|
|
}
|
|
|
|
function setB(uint x, uint y, uint z) public {
|
2021-03-23 18:15:14 +00:00
|
|
|
require(x < b.length);
|
|
|
|
require(y < b[x].length);
|
2020-05-28 11:05:56 +00:00
|
|
|
b[x][y] = z;
|
|
|
|
}
|
|
|
|
}
|
2020-12-02 17:40:48 +00:00
|
|
|
// ====
|
|
|
|
// SMTIgnoreCex: yes
|
2020-05-28 11:05:56 +00:00
|
|
|
// ----
|