solidity/test/libsolidity/smtCheckerTests/imports/import_base.sol
2022-04-01 23:41:18 -05:00

24 lines
626 B
Solidity

==== Source: base ====
contract Base {
uint x;
address a;
function f() internal returns (uint) {
a = address(this);
++x;
return 2;
}
}
==== Source: der ====
import "base";
contract Der is Base {
function g(uint y) public {
require(x < 10); // added to restrict the search space and avoid non-determinsm in Spacer
x += f();
assert(y > x);
}
}
// ====
// SMTEngine: all
// ----
// Warning 6328: (der:173-186='assert(y > x)'): CHC: Assertion violation happens here.\nCounterexample:\nx = 3, a = 0x0\ny = 0\n\nTransaction trace:\nDer.constructor()\nState: x = 0, a = 0x0\nDer.g(0)\n Base.f() -- internal call