2021-10-12 09:12:18 +00:00
|
|
|
contract E {
|
|
|
|
uint public e;
|
|
|
|
function setE(uint _e) public {
|
|
|
|
e = _e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract D {
|
|
|
|
E e;
|
|
|
|
constructor(E _e) {
|
|
|
|
e = _e;
|
|
|
|
}
|
|
|
|
function setE(uint x) public {
|
|
|
|
e.setE(x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contract C {
|
|
|
|
function f() public {
|
|
|
|
E e = new E();
|
|
|
|
D d = new D(e);
|
|
|
|
assert(e.e() == 0); // should hold
|
|
|
|
d.setE(42);
|
|
|
|
assert(e.e() == 42); // should hold
|
|
|
|
assert(e.e() == 2); // should fail
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// SMTEngine: chc
|
|
|
|
// SMTExtCalls: trusted
|
|
|
|
// SMTTargets: assert
|
|
|
|
// ----
|
|
|
|
// Warning 6328: (344-362): CHC: Assertion violation happens here.
|
2023-02-09 16:07:13 +00:00
|
|
|
// Info 1391: CHC: 2 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|