How to use verus-find

Verus-find can find functions and lemmas in Verus files that match some user-provided pattern. Verus-find supports searching for an expression pattern in the pre- and or postcondition and searching for functions that match a specific signature pattern.

Searching in pre- and postconditions

To search in pre- or postconditions, type a Verus expression.
The results are the functions whose pre-/postcondition contains an expression that matches the queried expression.

For example, a search for _.difference(_).len() finds the following lemma:


vstd/set_lib.rs:
proof fn lemma_len_difference<A>(s1: Set<A>, s2: Set<A>)
requires
s1.finite(),
ensures
s1.difference(s2).len() <= s1.len(),

Expression matching

General rules

Argument matching rules

The arguments to function and method calls are matched as follows.

Searching by function signature

To search by function signature, type a valid Verus function signature.

For example, a search for fn any(_: &mut Vec<_>, _: _) finds the following function:


vstd/pervasive.rs: (in `impl alloc::vec::Vec<T>`)
fn set(&mut self, i: usize, value: T)
requires
i < old(self).len(),
ensures
self@ == old(self)@.update(i as int, value),

Signature matching rules

Can I search functions in my own project?

The web instance only searches in Verus' standard library vstd. The CLI version can also search your own project. Check out the Github repository for instructions.