vstd: add specs for BinaryHeap, BTreeMap, and BTreeSet#2059
Open
briangmilnes wants to merge 1 commit intoverus-lang:mainfrom
Open
vstd: add specs for BinaryHeap, BTreeMap, and BTreeSet#2059briangmilnes wants to merge 1 commit intoverus-lang:mainfrom
briangmilnes wants to merge 1 commit intoverus-lang:mainfrom
Conversation
Add formal specifications for three Rust stdlib collection types: - BinaryHeap: push, pop, peek, len, is_empty, clear, with DeepView support and is_heap_max maximality predicate - BTreeMap: new, insert, get, contains_key, remove, clear, clone, len, is_empty, with iterators (Keys, Values, Iter, IntoIter) and DeepView - BTreeSet: new, insert, remove, contains, len, is_empty, clear, clone, with iterators (Iter, IntoIter) and DeepView Includes comprehensive tests covering: - All methods with value verification - Iterator tests with for-loop, while-loop, and loop-match patterns - DeepView tests for nested types Also adds CONTRIBUTING.md section on controlling test parallelism (RUST_TEST_THREADS) since vargo does not forward -j flag.
tjhance
requested changes
Jan 2, 2026
Collaborator
tjhance
left a comment
There was a problem hiding this comment.
I haven't looked at this in detail, but at the very least, these containers need to use some sort of obeys_key_model assumption (similar to our specs for HashMap), i.e., an assumption that comparisons are deterministic and that equality is compatible with Ord.
Author
|
10q! Got it, but this is going to take some work and I might as well then put in my additions for Ordering in cmp. Which I trust more now. What's the process? Do I just close out this PR as it's getting dated? Get up to date and start a new one? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add formal specifications for three Rust stdlib collection types (easy additions suggested by veracity-analyze_rust_wrapping_needs).
Includes comprehensive tests covering:
Also adds CONTRIBUTING.md section on controlling test parallelism (RUST_TEST_THREADS) since vargo does not forward -j flag.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.