-
Notifications
You must be signed in to change notification settings - Fork 262
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
Fix: No more mention of reveal lemmas when implementing opaque functions in traits #2974
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.
The fix is good, but can you extend the test to check whether :opaque propagates to the classes implementing the trait? (Or if it doesn't, to confirm that it doesn't?)
I'm not sure what you mean? Can you please elaborate? |
Yes, sorry: I was asking about what happens when you put opaque on a signature without a body:
|
Good question. That will not cause any problem I can think of. Since the function in the trait is {:opaque}, there is a lemma that is generated without a body. |
@cpitclaudel Your latest example passes. My first impulse was to let the user do what they deem appropriate, but the following doesn't verify, so I'm inclined to follow the precedent: trait T {
function F(): int
}
class C extends T {
function F() : nat { 3 }
} I don't think this needs to be in the scope of this PR. |
Looks good to me! But:
The difference between
Should I open a separate issue for this? |
Yes, I think the issue here is that {:opaque} attribute are not ported from the traits to the classes, or something else. |
This PR fixes #2612
After investigation
That was what caused the bug to appear. I fixed it by adding a special case to the error, so that if it's a lemma and it has the attribute specially created for lemmas that mark it
opaque_reveal
, then the error is not thrown.Because of 2) this is sound.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.