-
Notifications
You must be signed in to change notification settings - Fork 55
fix handling of bounds in conseq equiv phoare #837
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR fixes the handling of bounds in the conseq rule for equivalence judgments in phoare logic by adding a side condition that requires bounds to be equal under the appropriate memory substitutions.
Key Changes:
- Extended
transitivity_side_condto accept optional bound parameters and generate bound equality conditions - Modified
t_bdHoareF_conseq_equivto accept and pass the second bound as a parameter - Updated the documentation comment to reflect the new bound equality requirement
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Decision from meeting: add a unit test and merge. |
|
I was trying out this PR and I still get some issues with combining lossless with hoare to get phoare. |
|
Can you try introducing |
|
Ah, that works! |
|
Alright! Then the default and basic fix is "add an error message" (can be a separate PR). Then we think about tackling this in general. |
|
I was hoping for a non breaking fix soonish. Ow this will impose a major refactoring on a large project. |
|
It might be quick, still, if it's just about reactivating an existing code path. |
|
#847 is the issue that would get closed if we also fix this new problem in this PR. |
|
I just noticed (weekend work is not my best work), that the j and premise are in the postcondition, so I now understand both why it's a major refactoring (which might not even be possible depending on how much you simplified), and why you might think it should Just Work.™ |
add tests for conseq equiv phoare
This fixes #834 and #836.
The fix is to modify the side condition requiring a memory satisfying the left precondition to imply the existence of a right memory satisfying the right precondition and jointly satisfying the two-sided precondition. Now we also require the bounds to be proven equal under these two memories.
In most existing uses this part of the side condition should just simplify away since the bounds should be equal and usually don't depend on memories.
As a side effect this PR also permits uses of this kind of conseq to use bounds that aren't trivially equal, requiring equality to be proven instead.