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

requires/ensures triggers missing for trait overrides #1150

Open
jonhnet opened this issue May 31, 2024 · 0 comments
Open

requires/ensures triggers missing for trait overrides #1150

jonhnet opened this issue May 31, 2024 · 0 comments

Comments

@jonhnet
Copy link
Collaborator

jonhnet commented May 31, 2024

When working with trait implementations, I sometimes get silly failures that can be resolved by asserting (inside the fn body) the requires or ensures expression that the fn should have inherited from the trait definition. These assertions should never be necessary because the requires or ensures expression should be providing the necessary triggering mentions.

Here is a recorded example. In the recording, VariableSizedElementSeq_v.rs:146 fn try_length fails with both pre- and post-condition failures. If you uncomment the assertions on lines 148, 149, and 151, this fn passes verification.

The precondition failure is a little different than what I wrote above. Uncommenting just 148 (the literal precondition) isn't sufficient, but uncommenting line 149 (which appears as the first conjunct of the precondition at line 132 in the same file) provides the necessary trigger. This still should have been "discovered" by mentioning seq_valid; I think it's related.

2024-05-31-09-07-43.zip

I've seen this problem not infrequently, but haven't found a consistent initial condition, hence the recording.

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

No branches or pull requests

1 participant