-
Notifications
You must be signed in to change notification settings - Fork 34
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
Simplify wildcard multiplication #756
Conversation
Doesn't that result in surprises when using
|
I think it might, yes. I was trying to get it to do something like that yesterday but didn't immediately succeed. The important case IMO is really Although I think there are specific cases where the other simplifications are also valid and don't result in perm-problems. |
Regarding
Or am I misunderstanding this and "only" source-level wildcard multiplications are transformed? |
Crap, you're right. |
Happy to help — destroy your plans, that is :-P |
…on into meilers_wildcard_mult
…ct/silicon into meilers_wildcard_mult
The code now tracks for which resources in the method/... that's being verified perm expressions are used, so in Malte's example from above, the simplification no longer happens for produce or consume related to the However, I can still think of at least one scenario where we might not be sound:
That means that the simplification is potentially unsafe if we use perm to find out the value of a wildcard and then exhale that amount of a different resource of which we have an amount that is some expression involving the same wildcard. |
Simplifying the product of a wildcard and any positive term to be just the wildcard, similar to what Carbon already does.
In particular, this is intended to avoid non-linear wildcard-wildcard multiplications, which Z3 seems to struggle with.
Also adding some more cases to permission multiplication simplification to enable avoid these products also inside more complex terms.
This may or may not result in a small performance improvement. @jcp19