Open marshtompsxd opened 2 years ago
I changed assert(s1 == s2);
to assert(equal(s1, s2));
and it works.
Just curious, what is the difference between == and equal in the context of proof code?
equal
is guaranteed to always be "equality at the level of the SMT encoding"
==
is just the usual Rust ==
operator, which may or may not have the above property. If it does have that property (called Structural
), then ==
is allowed in proof/spec code, where it thereby means the same thing as equal
.
I'm not sure why Option
isn't already marked Structural
- I think it probably could be without any issues. @utaal is that right?
[Triaged at the Verus all-hands.]
This should not matter for spec code anymore, as it already becomes SpecEq
.
Consider other names: SmtEq
, LogicalEq
, SolverEq
.
It should be implemented as a #[verifier(external)]
impl
for Option
, Result
, etc.
Hi verus team, I was trying to check the equality of two structs that contain Option like this:
However, verus reports the error:
My understanding about the equality check is:
[derive(Structural)] is necessary for the struct we want to check equality for
If both 1 and 2 are true, what would be the best way to check the equality of a struct that contains Option fields?