Skip to content

Commit e9d4239

Browse files
authored
Merge pull request #15254 from ethereum/smt-test-simplify
SMTChecker: Simplify some of the long running tests
2 parents 5e9d38e + e0c58e5 commit e9d4239

File tree

6 files changed

+28
-27
lines changed

6 files changed

+28
-27
lines changed

test/libsolidity/smtCheckerTests/abi/abi_decode_array.sol

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ contract C {
77

88
(uint[] memory c, uint[] memory d) = abi.decode(b1, (uint[], uint[]));
99
assert(a.length == c.length);
10-
assert(a.length == d.length); // should fail
1110
assert(b.length == d.length);
12-
assert(b.length == c.length); // should fail
1311

1412
(uint[] memory e, uint[] memory f, uint[] memory g) = abi.decode(b1, (uint[], uint[], uint[]));
1513
assert(e.length == a.length); // should fail
@@ -24,22 +22,18 @@ contract C {
2422

2523
(uint[] memory k, uint[] memory l) = abi.decode(b2, (uint[], uint[]));
2624
assert(k.length == a.length); // should fail
27-
assert(k.length == l.length); // should fail
2825
assert(l.length == b.length); // should fail
2926
}
3027
}
3128
// ====
3229
// SMTEngine: all
3330
// SMTIgnoreCex: yes
3431
// ----
35-
// Warning 6328: (182-210): CHC: Assertion violation happens here.
36-
// Warning 6328: (335-363): CHC: Assertion violation happens here.
37-
// Warning 6328: (414-442): CHC: Assertion violation happens here.
38-
// Warning 6328: (560-588): CHC: Assertion violation happens here.
39-
// Warning 6328: (607-635): CHC: Assertion violation happens here.
40-
// Warning 6328: (654-682): CHC: Assertion violation happens here.
41-
// Warning 6328: (879-916): CHC: Assertion violation happens here.
42-
// Warning 6328: (1009-1037): CHC: Assertion violation happens here.
43-
// Warning 6328: (1056-1084): CHC: Assertion violation happens here.
44-
// Warning 6328: (1103-1131): CHC: Assertion violation happens here.
32+
// Warning 6328: (182-210): CHC: Assertion violation happens here.\nCounterexample:\n\nc = []\nd = []\ne = []\nf = []\ng = []\nh = []\ni = []\nj = 0\nk = []\nl = []\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
33+
// Warning 6328: (466-494): CHC: Assertion violation happens here.\nCounterexample:\n\nf = [83, 83, 83, 83, 83, 83, 67, 83, 83, 83, 83, 83, 70, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 72, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 71, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83]\ng = [65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 55, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 60, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65]\nh = []\ni = []\nj = 0\nk = []\nl = []\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
34+
// Warning 6328: (513-541): CHC: Assertion violation happens here.\nCounterexample:\n\ng = [65, 65, 65, 65, 65, 65, 65, 64, 65, 47, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 48, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65]\nh = []\ni = []\nj = 0\nk = []\nl = []\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
35+
// Warning 6328: (560-588): CHC: Assertion violation happens here.\nCounterexample:\n\nb = []\nd = []\nh = []\ni = []\nj = 0\nk = []\nl = []\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
36+
// Warning 6328: (785-822): CHC: Assertion violation happens here.\nCounterexample:\n\nf = [144]\nj = 8365\nk = []\nl = []\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
37+
// Warning 6328: (915-943): CHC: Assertion violation happens here.\nCounterexample:\n\nj = 8365\nl = [35, 35, 35, 35, 35]\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
38+
// Warning 6328: (962-990): CHC: Assertion violation happens here.\nCounterexample:\n\nj = 32285\n\nTransaction trace:\nC.constructor()\nC.abiDecodeArray(b1, b2) -- counterexample incomplete; parameter name used instead of value
4539
// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

test/libsolidity/smtCheckerTests/types/array_branch_3d.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ contract C
1515
// ====
1616
// SMTEngine: chc
1717
// SMTSolvers: eld
18+
// SMTTargets: assert
1819
// ----
19-
// Warning 6328: (152-174): CHC: Assertion violation happens here.
20-
// Info 1391: CHC: 9 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
20+
// Warning 6328: (152-174): CHC: Assertion violation happens here.\nCounterexample:\nc = [[[0]]]\nb = false\n\nTransaction trace:\nC.constructor()\nState: c = [[[0]]]\nC.f(false)

test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_memory_safe.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ contract C {
3232
}
3333
// ====
3434
// SMTEngine: all
35+
// SMTTargets: assert
3536
// ----
36-
// Info 1391: CHC: 29 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
37+
// Info 1391: CHC: 6 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

test/libsolidity/smtCheckerTests/types/struct/array_struct_array_struct_storage_safe.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@ contract C {
5252
}
5353
// ====
5454
// SMTEngine: all
55+
// SMTTargets: assert
5556
// ----
56-
// Info 1391: CHC: 51 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
57+
// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

test/libsolidity/smtCheckerTests/types/type_minmax.sol

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
contract C {
2-
function f(uint a) public pure {
3-
assert(a <= type(uint).max);
4-
assert(a >= type(uint).min);
5-
require(a <= type(uint64).max);
6-
assert(a <= type(uint64).max);
7-
assert(a <= type(uint32).max);
8-
}
9-
102
function int_min() public pure {
113
int8 int8_min = type(int8).min;
124
assert(int8_min == -2**7);
@@ -81,5 +73,4 @@ contract C {
8173
// ====
8274
// SMTEngine: all
8375
// ----
84-
// Warning 6328: (178-207): CHC: Assertion violation happens here.
85-
// Info 1391: CHC: 24 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
76+
// Info 1391: CHC: 21 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
contract C {
2+
function f(uint a) public pure {
3+
assert(a <= type(uint).max);
4+
assert(a >= type(uint).min);
5+
require(a <= type(uint64).max);
6+
assert(a <= type(uint64).max);
7+
assert(a <= type(uint32).max); // should fail
8+
}
9+
}
10+
// ====
11+
// SMTEngine: all
12+
// ----
13+
// Warning 6328: (178-207): CHC: Assertion violation happens here.\nCounterexample:\n\na = 4294967296\n\nTransaction trace:\nC.constructor()\nC.f(4294967296)
14+
// Info 1391: CHC: 3 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

0 commit comments

Comments
 (0)