Skip to content
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

Add various specs for HashSet, FSet, and iterators (ranges, filter_map, rev) #1313

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

Lysxia
Copy link
Collaborator

@Lysxia Lysxia commented Jan 7, 2025

  • Also strengthen the spec of filter

Note: the spec for Borrow is required for HashSet::contains

@jhjourdan
Copy link
Collaborator

This contains quite a lot of new specifications that need to be discussed.

For example, I am not so sure the spec for double ended iterators is the one we want, because it does not say anything about how the forward and the backward relation interact.

@Lysxia
Copy link
Collaborator Author

Lysxia commented Jan 8, 2025

The current spec for double ended iterators is at least enough for reasoning about simple and common for loops and .collect().

My understanding is that we're not too happy with the iterator specs as a whole (we'd like either better handling of existentials or to rework the specs to make proofs easier) so I'm wary of putting too much work into iterator specs up front. My approach is more to develop just what is needed by examples I come across. It's better to have some specs than none especially for iterators since Creusot can't translate for loops without specs.

@jhjourdan
Copy link
Collaborator

We are going to merge this as soon as this is rebased.

@Lysxia Lysxia force-pushed the hashset-specs branch 5 times, most recently from 1f13639 to 024fbb0 Compare February 17, 2025 14:35
@Lysxia Lysxia enabled auto-merge February 17, 2025 14:36
…p, rev)

- Also strengthen the spec of filter

Note: the spec for `Borrow` is required for `HashSet::contains`
@Lysxia Lysxia merged commit 9d76741 into master Feb 17, 2025
6 checks passed
@Lysxia Lysxia deleted the hashset-specs branch February 17, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants