mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add CLI and JSON option to select SMTChecker targets
This commit is contained in:
@@ -0,0 +1 @@
|
||||
--model-checker-engine chc --model-checker-targets assert
|
||||
@@ -0,0 +1,14 @@
|
||||
Warning: CHC: Assertion violation happens here.
|
||||
Counterexample:
|
||||
arr = []
|
||||
a = 0
|
||||
x = 0
|
||||
|
||||
Transaction trace:
|
||||
test.constructor()
|
||||
State: arr = []
|
||||
test.f(0, 1)
|
||||
--> model_checker_targets_assert_chc/input.sol:12:3:
|
||||
|
|
||||
12 | assert(x > 0);
|
||||
| ^^^^^^^^^^^^^
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
pragma experimental SMTChecker;
|
||||
contract test {
|
||||
uint[] arr;
|
||||
function f(address payable a, uint x) public {
|
||||
require(x >= 0);
|
||||
--x;
|
||||
x + type(uint).max;
|
||||
2 / x;
|
||||
a.transfer(x);
|
||||
assert(x > 0);
|
||||
arr.pop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user