mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10181 from ethereum/smt_user_timeout
[SMTChecker] User timeout option
This commit is contained in:
@@ -0,0 +1 @@
|
||||
--model-checker-timeout 1
|
||||
@@ -0,0 +1,50 @@
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_all/input.sol:6:3:
|
||||
|
|
||||
6 | assert(x > 0);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_all/input.sol:7:3:
|
||||
|
|
||||
7 | assert(x > 2);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_all/input.sol:8:3:
|
||||
|
|
||||
8 | assert(x > 4);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_all/input.sol:6:3:
|
||||
|
|
||||
6 | assert(x > 0);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 0
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_all/input.sol:7:3:
|
||||
|
|
||||
7 | assert(x > 2);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 1
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_all/input.sol:8:3:
|
||||
|
|
||||
8 | assert(x > 4);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 3
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
pragma experimental SMTChecker;
|
||||
contract test {
|
||||
function f(uint x) public pure {
|
||||
assert(x > 0);
|
||||
assert(x > 2);
|
||||
assert(x > 4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--model-checker-engine bmc --model-checker-timeout 1
|
||||
@@ -0,0 +1,32 @@
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_bmc/input.sol:6:3:
|
||||
|
|
||||
6 | assert(x > 0);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 0
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_bmc/input.sol:7:3:
|
||||
|
|
||||
7 | assert(x > 2);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 1
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
|
||||
Warning: BMC: Assertion violation happens here.
|
||||
--> model_checker_timeout_bmc/input.sol:8:3:
|
||||
|
|
||||
8 | assert(x > 4);
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 3
|
||||
|
||||
Note: Callstack:
|
||||
Note:
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
pragma experimental SMTChecker;
|
||||
contract test {
|
||||
function f(uint x) public pure {
|
||||
assert(x > 0);
|
||||
assert(x > 2);
|
||||
assert(x > 4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--model-checker-engine chc --model-checker-timeout 1
|
||||
@@ -0,0 +1,17 @@
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_chc/input.sol:6:3:
|
||||
|
|
||||
6 | assert(x > 0);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_chc/input.sol:7:3:
|
||||
|
|
||||
7 | assert(x > 2);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
Warning: CHC: Assertion violation might happen here.
|
||||
--> model_checker_timeout_chc/input.sol:8:3:
|
||||
|
|
||||
8 | assert(x > 4);
|
||||
| ^^^^^^^^^^^^^
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.0;
|
||||
pragma experimental SMTChecker;
|
||||
contract test {
|
||||
function f(uint x) public pure {
|
||||
assert(x > 0);
|
||||
assert(x > 2);
|
||||
assert(x > 4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"modelCheckerSettings":
|
||||
{
|
||||
"timeout": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{"auxiliaryInputRequested":{"smtlib2queries":{"0x067a0b3dedbdbea0177dfdac7720e0016881a66f25f487ed054daeecdca08a44":"(set-option :produce-models true)
|
||||
(set-option :timeout 1)
|
||||
(set-logic ALL)
|
||||
(declare-fun |error_0| () Int)
|
||||
(declare-fun |this_0| () Int)
|
||||
(declare-datatypes ((|state_type| 0)) (((|state_type| (|balances| (Array Int Int))))))
|
||||
(declare-fun |state_0| () |state_type|)
|
||||
(declare-datatypes ((|bytes_tuple| 0)) (((|bytes_tuple| (|bytes_tuple_accessor_array| (Array Int Int)) (|bytes_tuple_accessor_length| Int)))))
|
||||
(declare-datatypes ((|tx_type| 0)) (((|tx_type| (|block.coinbase| Int) (|block.difficulty| Int) (|block.gaslimit| Int) (|block.number| Int) (|block.timestamp| Int) (|blockhash| (Array Int Int)) (|msg.data| |bytes_tuple|) (|msg.sender| Int) (|msg.sig| Int) (|msg.value| Int) (|tx.gasprice| Int) (|tx.origin| Int)))))
|
||||
(declare-fun |tx_0| () |tx_type|)
|
||||
(declare-datatypes ((|ecrecover_input_type| 0)) (((|ecrecover_input_type| (|hash| Int) (|v| Int) (|r| Int) (|s| Int)))))
|
||||
(declare-datatypes ((|crypto_type| 0)) (((|crypto_type| (|ecrecover| (Array |ecrecover_input_type| Int)) (|keccak256| (Array |bytes_tuple| Int)) (|ripemd160| (Array |bytes_tuple| Int)) (|sha256| (Array |bytes_tuple| Int))))))
|
||||
(declare-fun |crypto_0| () |crypto_type|)
|
||||
(declare-fun |x_4_0| () Int)
|
||||
(declare-fun |expr_8_0| () Int)
|
||||
(declare-fun |expr_9_0| () Int)
|
||||
(declare-fun |expr_10_1| () Bool)
|
||||
|
||||
(assert (and (and true (and (= expr_10_1 (> expr_8_0 expr_9_0)) (and (= expr_9_0 0) (and (= expr_8_0 x_4_0) (and (and (>= x_4_0 0) (<= x_4_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) true))))) (not expr_10_1)))
|
||||
(declare-const |EVALEXPR_0| Int)
|
||||
(assert (= |EVALEXPR_0| x_4_0))
|
||||
(check-sat)
|
||||
(get-value (|EVALEXPR_0| ))
|
||||
"}},"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:4:47: Warning: CHC: Assertion violation might happen here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
","message":"CHC: Assertion violation might happen here.","severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"},{"component":"general","errorCode":"4661","formattedMessage":"A:4:47: Warning: BMC: Assertion violation happens here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
Counterexample:
|
||||
x = 0
|
||||
|
||||
Callstack:
|
||||
|
||||
","message":"BMC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample:
|
||||
x = 0
|
||||
"},{"message":"Callstack:"},{"message":""}],"severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"modelCheckerSettings":
|
||||
{
|
||||
"engine": "bmc",
|
||||
"timeout": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{"auxiliaryInputRequested":{"smtlib2queries":{"0x067a0b3dedbdbea0177dfdac7720e0016881a66f25f487ed054daeecdca08a44":"(set-option :produce-models true)
|
||||
(set-option :timeout 1)
|
||||
(set-logic ALL)
|
||||
(declare-fun |error_0| () Int)
|
||||
(declare-fun |this_0| () Int)
|
||||
(declare-datatypes ((|state_type| 0)) (((|state_type| (|balances| (Array Int Int))))))
|
||||
(declare-fun |state_0| () |state_type|)
|
||||
(declare-datatypes ((|bytes_tuple| 0)) (((|bytes_tuple| (|bytes_tuple_accessor_array| (Array Int Int)) (|bytes_tuple_accessor_length| Int)))))
|
||||
(declare-datatypes ((|tx_type| 0)) (((|tx_type| (|block.coinbase| Int) (|block.difficulty| Int) (|block.gaslimit| Int) (|block.number| Int) (|block.timestamp| Int) (|blockhash| (Array Int Int)) (|msg.data| |bytes_tuple|) (|msg.sender| Int) (|msg.sig| Int) (|msg.value| Int) (|tx.gasprice| Int) (|tx.origin| Int)))))
|
||||
(declare-fun |tx_0| () |tx_type|)
|
||||
(declare-datatypes ((|ecrecover_input_type| 0)) (((|ecrecover_input_type| (|hash| Int) (|v| Int) (|r| Int) (|s| Int)))))
|
||||
(declare-datatypes ((|crypto_type| 0)) (((|crypto_type| (|ecrecover| (Array |ecrecover_input_type| Int)) (|keccak256| (Array |bytes_tuple| Int)) (|ripemd160| (Array |bytes_tuple| Int)) (|sha256| (Array |bytes_tuple| Int))))))
|
||||
(declare-fun |crypto_0| () |crypto_type|)
|
||||
(declare-fun |x_4_0| () Int)
|
||||
(declare-fun |expr_8_0| () Int)
|
||||
(declare-fun |expr_9_0| () Int)
|
||||
(declare-fun |expr_10_1| () Bool)
|
||||
|
||||
(assert (and (and true (and (= expr_10_1 (> expr_8_0 expr_9_0)) (and (= expr_9_0 0) (and (= expr_8_0 x_4_0) (and (and (>= x_4_0 0) (<= x_4_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) true))))) (not expr_10_1)))
|
||||
(declare-const |EVALEXPR_0| Int)
|
||||
(assert (= |EVALEXPR_0| x_4_0))
|
||||
(check-sat)
|
||||
(get-value (|EVALEXPR_0| ))
|
||||
"}},"errors":[{"component":"general","errorCode":"4661","formattedMessage":"A:4:47: Warning: BMC: Assertion violation happens here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
Counterexample:
|
||||
x = 0
|
||||
|
||||
Callstack:
|
||||
|
||||
","message":"BMC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample:
|
||||
x = 0
|
||||
"},{"message":"Callstack:"},{"message":""}],"severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"modelCheckerSettings":
|
||||
{
|
||||
"engine": "chc",
|
||||
"timeout": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:4:47: Warning: CHC: Assertion violation might happen here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
","message":"CHC: Assertion violation might happen here.","severity":"warning","sourceLocation":{"end":150,"file":"A","start":137},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"modelCheckerSettings":
|
||||
{
|
||||
"engine": "chc",
|
||||
"atimeout": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"errors":[{"component":"general","formattedMessage":"Unknown key \"atimeout\"","message":"Unknown key \"atimeout\"","severity":"error","type":"JSONError"}]}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"language": "Solidity",
|
||||
"sources":
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma experimental SMTChecker;\ncontract C { function f(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"modelCheckerSettings":
|
||||
{
|
||||
"timeout": "asd"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"errors":[{"component":"general","formattedMessage":"modelCheckerSettings.timeout must be an unsigned integer.","message":"modelCheckerSettings.timeout must be an unsigned integer.","severity":"error","type":"JSONError"}]}
|
||||
Reference in New Issue
Block a user