-
Notifications
You must be signed in to change notification settings - Fork 715
feat: verify all and any for hash maps
#10765
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
Conversation
TwoFX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we have recently got any and all on iterators (#10686) and hash map iterators are coming up (#10761), the question arises: should we define m.all p on a hash map m to be m.iter.all p (or, even more radical, not provide it at all and expect users to write m.iter.all p themselves)?
And hopefully if the right lemmas about HashMap.iter and Iter.any exist, all any lemmas you might want on hash maps fall right out?
@datokrat, any thoughts?
This would also work for me and then we can close this one. I feel like it would be more comfortable for the user to still have the custom |
I think this will work -- however, one should perhaps run a benchmark comparing the iterators' If it turns out that there is still a performance benefit to implementing |
|
@jt202, |
|
@TwoFX I can give it a try. Should I push then the benchmarks here or share them in another way if they are not meant to be that permanent. |
|
Feel free to add them here, more benchmarks are always good to have. |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
|
I tried a bit with the iterator approach, but to me, it feels like I get more complicated statements than my direct approach in this file. My goal was it to have lemmas looking like those in |
|
changelog-library |
|
@TwoFX I tried a bit with the iterator approach, but the lemmas weren't much of use to get something compared to the list API. I talked with @datokrat about that, and we came to the conclusion that the direct approach via How should the benchmark file be adapted for long term use? |
datokrat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have nothing to complain except for a few syntactical and stylistical remarks ;)
This PR extends the
all/anyfunctions from hash sets to hash maps and dependent hash maps and verifies them.