Created
March 22, 2021 11:57
-
-
Save TrigDevelopment/634aac3f6a0ce305a462e3f3cb376c6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct container { | |
| int counter; | |
| }; | |
| /*@ requires \valid(some_container); | |
| requires some_container->counter == 0; | |
| ensures \result->counter == \at(\result->counter, Pre) + 1; | |
| */ | |
| struct container * f(struct container * some_container) { | |
| some_container->counter = 1; | |
| return some_container; | |
| } | |
| /*@ ensures \result->counter == 1; | |
| */ | |
| struct container * a() { | |
| struct container some_container; | |
| some_container.counter = 0; | |
| return f(&some_container); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment