mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
455 B
Solidity
25 lines
455 B
Solidity
contract C {
|
|
uint[] a;
|
|
uint l;
|
|
function p() public {
|
|
require(a.length < type(uint).max - 1);
|
|
require(l < type(uint).max - 1);
|
|
a.push();
|
|
++l;
|
|
}
|
|
function q() public {
|
|
require(a.length > 0);
|
|
require(l > 0);
|
|
a.pop();
|
|
--l;
|
|
}
|
|
function r() public view returns (uint) {
|
|
require(l > 0);
|
|
return a[l - 1]; // safe access
|
|
}
|
|
}
|
|
// ====
|
|
// SMTEngine: all
|
|
// ----
|
|
// Info 1180: Contract invariant(s) for :C:\n((l + ((- 1) * a.length)) <= 0)\n
|