Skip to content
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

clean up postcondition framedness check #463

Merged
merged 5 commits into from
Nov 21, 2023

Conversation

gauravpartha
Copy link
Contributor

The method postcondition is checked to be properly framed in a fresh state as follows:

inhale precondition
PostMask := Mask;
PostHeap := Heap;
havoc PostHeap;
PostMask := ZeroMask
 if(*) {
   check postcondition framed in (PostHeap, PostMask)
   assume false;
}
translate main body of method
exhale postcondition

The initial assignments to PostMask and PostHeap are superfluous. Moreover, the post state setup is only relevant inside the then-branch of the non-deterministic if statement. This PR makes this explicit by changing the encoding to:

inhale precondition
 if(*) {
   havoc PostHeap;
   PostMask := ZeroMask;
   check postcondition framed in (PostHeap, PostMask)
   assume false;
}
translate main body of method
exhale postcondition

@gauravpartha gauravpartha merged commit c2a4135 into master Nov 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant