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

Not pushing conditions using permission introspection further in #853

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

marcoeilers
Copy link
Contributor

@marcoeilers marcoeilers commented Jun 13, 2024

The --conditionalizePermissions command line option rewrites implications and ternary expressions to avoid branching.
The general pattern is that e1 ==> acc(e2.f, e3) is rewritten to acc(e2.f, e1 ? e3 : none.

This rewriting is not always sound if the condition (e1 in this case) uses permission introspection.
Example:

inhale P1(x)
exhale perm(P1(x)) >= write ==> (P1(x) && P1(x))

must not be rewritten to

inhale P1(x)
exhale acc(P1(x), perm(P1(x)) >= write ? write : none) && acc(P1(x), perm(P1(x)) >= write ? write : none)

since the value of perm(P1(x)) >= write changes.

This PR conservatively prevents any rewriting where the condition contains perm or forperm.
This fixes one issue mentioned in #851.

Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks ok to me, I have a few questions about the tests though

@marcoeilers marcoeilers merged commit 67a1edc into master Jun 17, 2024
4 checks passed
@marcoeilers marcoeilers deleted the meilers_cond_perms_disable_for_perm_introspection 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.

2 participants