Skip to content

Fix implementation of Ord for Prop #746

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

Merged
merged 1 commit into from
May 16, 2025
Merged

Fix implementation of Ord for Prop #746

merged 1 commit into from
May 16, 2025

Conversation

blishko
Copy link
Collaborator

@blishko blishko commented May 16, 2025

Description

Previously, the implementation of <= for Prop would not obey the antisymmetry law, I believe in the case of PEq specifically. This leads to weird behaviour, namely that duplicates are not properly recognized in Set.

The proposed change is to implement compare directly, which I think is easier than trying to fix <=.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

Previously, the implementation of `<=` for Prop would not obey the
antisymmetry law, I believe in the case of `PEq` specifically.
This leads to weird behaviour, namely that duplicates are not properly
recognized in Set.

The proposed change is to implement `compare` directly, which I think is
easier than trying to fix `<=`.
@blishko blishko requested a review from msooseth May 16, 2025 13:02
Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Well done. Thanks, I learned something!

@@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
we now try best to print everything we can, and print an appropriate error message
instead of crashing.
- We no longer produce duplicate SMT assertions regarding concrete keccak values.
- Ord is now correctly implemented for Prop.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Sorry :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be optimistic from me :)
Time will tell...

@msooseth msooseth added the bug Something isn't working label May 16, 2025
@blishko blishko merged commit 678efac into main May 16, 2025
9 checks passed
@blishko blishko deleted the fix-prop-ord branch May 16, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants