Skip to main content

hash_map_contains_key_ensures

Function hash_map_contains_key_ensures 

Source
pub open spec fn hash_map_contains_key_ensures<Key: Borrow<Q> + Hash + Eq, Value, S: BuildHasher, A: Allocator, Q: Hash + Eq + ?Sized>(
    m: &HashMap<Key, Value, S, A>,
    k: &Q,
    result: bool,
) -> bool
Expand description
{
    ({
        &&& obeys_key_model::<Key>()
        &&& obeys_key_model::<Q>()
        &&& builds_valid_hashers::<S>()
        &&& <Key as BorrowSpec<Q>>::obeys_borrow_spec()
        &&& hash_map_inv(m)

    })
        ==> {
            result
                == exists |key: Key| {
                    &&& #[trigger] m@.contains_key(key)
                    &&& k.eq_spec(<Key as BorrowSpec<Q>>::borrow_spec(&key))

                }
        }
}