mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change CHC encoding to functions forest instead of explicit CFG
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
library l1 {
|
||||
|
||||
uint private constant TON = 1000;
|
||||
function f1() public pure {
|
||||
assert(TON == 1000);
|
||||
assert(TON == 2000);
|
||||
}
|
||||
function f2(uint x, uint y) internal pure returns (uint) {
|
||||
return x + y;
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f(uint x) public pure {
|
||||
uint z = l1.f2(x, 1);
|
||||
assert(z == x + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (136-155): Assertion violation happens here
|
||||
// Warning: (229-234): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (300-302): Assertion checker does not yet implement type type(library l1)
|
||||
// Warning: (229-234): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (327-332): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
@@ -0,0 +1,9 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
library l1 {
|
||||
|
||||
uint private constant TON = 1000;
|
||||
function f1() public pure {
|
||||
assert(TON == 1000);
|
||||
}
|
||||
}
|
||||
@@ -17,3 +17,8 @@ contract Simple {
|
||||
}
|
||||
// ====
|
||||
// SMTSolvers: z3
|
||||
// ----
|
||||
// Warning: (172-187): Error trying to invoke SMT solver.
|
||||
// Warning: (195-209): Error trying to invoke SMT solver.
|
||||
// Warning: (172-187): Assertion violation happens here
|
||||
// Warning: (195-209): Assertion violation happens here
|
||||
|
||||
@@ -14,3 +14,8 @@ contract Simple {
|
||||
}
|
||||
// ====
|
||||
// SMTSolvers: z3
|
||||
// ----
|
||||
// Warning: (164-179): Error trying to invoke SMT solver.
|
||||
// Warning: (187-201): Error trying to invoke SMT solver.
|
||||
// Warning: (164-179): Assertion violation happens here
|
||||
// Warning: (187-201): Assertion violation happens here
|
||||
|
||||
@@ -12,12 +12,12 @@ contract LoopFor2 {
|
||||
b[i] = i + 1;
|
||||
c[i] = b[i];
|
||||
}
|
||||
// This is safe but too hard to solve currently.
|
||||
assert(b[0] == c[0]);
|
||||
assert(a[0] == 900);
|
||||
assert(b[0] == 900);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// SMTSolvers: z3
|
||||
// ----
|
||||
// Warning: (312-331): Assertion violation happens here
|
||||
// Warning: (316-336): Assertion violation happens here
|
||||
// Warning: (363-382): Assertion violation happens here
|
||||
|
||||
+4
-4
@@ -12,13 +12,13 @@ contract LoopFor2 {
|
||||
b[i] = i + 1;
|
||||
c[i] = b[i];
|
||||
}
|
||||
// This is safe but too hard to prove currently.
|
||||
assert(b[0] == c[0]);
|
||||
assert(a[0] == 900);
|
||||
assert(b[0] == 900);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// SMTSolvers: z3
|
||||
// ----
|
||||
// Warning: (290-309): Assertion violation happens here
|
||||
// Warning: (313-332): Assertion violation happens here
|
||||
// Warning: (317-337): Assertion violation happens here
|
||||
// Warning: (341-360): Assertion violation happens here
|
||||
// Warning: (364-383): Assertion violation happens here
|
||||
|
||||
@@ -13,5 +13,5 @@ contract C
|
||||
assert(a[1][1] == 0);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// SMTSolvers: z3
|
||||
// ----
|
||||
// Warning: (184-204): Assertion violation happens here
|
||||
|
||||
Reference in New Issue
Block a user