Description
I got thinking based on this clippy lint https://rust-lang.github.io/rust-clippy/master/#derive_hash_xor_eq about whether formal methods might be able to have a tool that checks that the hash implementations and the equality implementations meet a hashmap's requirements.
This is a common and insidious problem in computing, and while proving all implementations is probably not possible, I have a hunch that we can automatically prove that the vast majority of these implementations do maintain the required invariants because it's a very constrained problem.
Is there prior art on trying to tackle this problem? I could see this adding a lot of value if we could solve this problem. At the moment when we impl PartialEq
and Hash
we're saying trust the programmer, but it would be cool to verify.