Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR verifies the missing parts of the
Run
method - the loops that start a connection on each thread are now verified. Unfortunately, Gobra suffers from an incompleteness with closures (viperproject/gobra#723) that makes it pretty much impossible from calling a closure from another closure. Because of this, the call to the closureread
insideclosure2
andclosure3
cannot be verified. Until this issue is fixed, we check the precondition ofread
before calling it (manually, with asserts) and then kill that branch - we do not verify the call automatically. Fortunately, this function does not have postconditions, thus there are no major proof obligations being assumed away by killing the branch. As soon as the issue is fixed, it would be safe to remove the assertions and the calls toTODO()
.Finally, I had to make a few syntactic changes to split the closure declaration and the closure call into two statements, otherwise the program with spec becomes very hard to look at.