Skip to main content

fold_requires

Function fold_requires 

Source
pub open spec fn fold_requires<A, B, F: FnMut(B, A) -> B>(
    items: Seq<A>,
    produces: Seq<bool>,
    init: B,
    f: F,
) -> bool
Expand description
{
    forall |bs: Seq<B>| {
        (#[trigger] fold_prefix(items, produces, init, f, bs)
            && bs.len() - 1 < items.len() && produces[bs.len() - 1])
            ==> f.requires((bs.last(), items[bs.len() - 1]))
    }
}