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

Always use image functions for QPs #834

Merged
merged 11 commits into from
May 5, 2024
Merged

Conversation

marcoeilers
Copy link
Contributor

@marcoeilers marcoeilers commented Apr 24, 2024

The current QP encoding is unsound for QPs that have trivial conditions and permission amounts that do not depend on the quantified variable(s), if the quantified variables are of type Int or Ref. Essentially, for such QPs, the encoding assumes that any receiver r can be mapped to some quantified value x s.t. the receiver e(x) is r, which is obviously not always the case.

This PR fixes that by enforcing the use of image functions for all QPs (like in Carbon), i.e., by adding an explicit condition that for any reference r we only have permission to it if it is in the image of function e(x). This was previously only done when quantifying over types that might be finite (see PR #666).

Additionally, this PR adjusts several parts in the QP and quasihavoc encoding that were previously not dealing with image functions correctly, which presumably wasn't noticed earlier because for many QPs image functions were not used, or because some tests may have relied on Silicon's unsoundness.

This fixes #833

@marcoeilers marcoeilers changed the title Add missing condition in QP consume Always use image functions for QPs May 4, 2024
@marcoeilers marcoeilers merged commit 8b452c6 into master May 5, 2024
4 checks passed
@marcoeilers marcoeilers deleted the meilers_qp_receiver_check branch July 1, 2024 13:32
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.

Unsound behavior with QPs without condition
1 participant