-
Notifications
You must be signed in to change notification settings - Fork 108
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
Create a proper notion of equality for Prusti #53
Comments
I am assigning myself to mark that this is the next thing I am going to work on once I am done with the compiler upgrade. However, since the upgrade is going to take some time, feel free to steal this issue. |
Update: |
May I suggest that this enhanced notion of equality should also involve an extension of the
This works, but
fails, even though they are equivalent from Rust's perspective (because "reference equality" is actually "deep equality" in Rust). Now, this is obviously not a big issue for
The postcondition is obviously true, because the function never even touches the reference, but rustc thinks that I apologize if this has been discussed before, but I couldn't find it during a quick look at the existing issues. |
I agree that we eventually also want to support old in equalities involving ADTs; that's on the list besides a few other features that have not been implemented yet.
This is interesting as the "new equality" is only concerned with ADTs (structs, enums, tuples). I agree that we should fix this, but it should probably be moved into a separate issue. |
Is it, though? What if a struct has a mutable reference as a field? You'll have to recursively check that for equality, too. Or do you mean by "ADT" that this is explicitly not supported? |
At the moment, we explicitly check whether the outermost type is an ADT (or a tuple). If this is not the case, then the old notion of equality is applied. Once we detected that we are dealing with equality between ADTs, we indeed recursively check whether all fields are supported and also dereference fields accordingly. |
The "notion of equality" now exists thanks to snapshots etc. We are planning to further extend it, by using snapshots for |
We want a way to express that two objects have the same byte representation and use this notion for equality for pure functions (if
a
andb
are equal, thenf(a)
andf(b)
are equal for any pure functionf
).The text was updated successfully, but these errors were encountered: