-
Notifications
You must be signed in to change notification settings - Fork 6.3k
SMTChecker: Further test simplifications #15256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only difference between this file and |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ contract C | |
| mapping (uint => uint8)[2] severalMaps8; | ||
| mapping (uint => uint)[2][2] severalMaps3d; | ||
| function f(mapping (uint => uint) storage map) internal { | ||
| // Accesses are safe but oob is reported because of aliasing. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems the problem with aliasing of maps had been fixed somewhere along the way, because no oob was reported here anymore. |
||
| severalMaps[0][0] = 42; | ||
| severalMaps8[0][0] = 42; | ||
| severalMaps3d[0][0][0] = 42; | ||
|
|
@@ -15,8 +14,7 @@ contract C | |
| // Should not fail since knowledge is erased only for mapping (uint => uint). | ||
| assert(severalMaps8[0][0] == 42); | ||
| // Should fail since map == severalMaps3d[0][0] is possible. | ||
| // Removed because current Spacer seg faults in cex generation. | ||
| //assert(severalMaps3d[0][0][0] == 42); | ||
| assert(severalMaps3d[0][0][0] == 42); | ||
| } | ||
| function g(uint x) public { | ||
| require(x < severalMaps.length); | ||
|
|
@@ -26,6 +24,8 @@ contract C | |
| // ==== | ||
| // SMTEngine: all | ||
| // SMTIgnoreCex: yes | ||
| // SMTTargets: assert | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this test, we want to focus on assertions, not the accesses. |
||
| // ---- | ||
| // Warning 6328: (456-487): CHC: Assertion violation happens here. | ||
| // Info 1391: CHC: 8 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. | ||
| // Warning 6328: (392-423): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\n\nTransaction trace:\nC.constructor()\nC.g(0)\n C.f(map) -- counterexample incomplete; parameter name used instead of value -- internal call | ||
| // Warning 6328: (606-642): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0\n\nTransaction trace:\nC.constructor()\nC.g(0)\n C.f(map) -- counterexample incomplete; parameter name used instead of value -- internal call | ||
| // Info 1391: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The out of bounds checks seem to be difficult for Z3, but there is no point to test them, they are safe.
The point of this test is to test the assertion.