pub open spec fn fold_prefix<A, B, F: FnMut(B, A) -> B>(
items: Seq<A>,
produces: Seq<bool>,
init: B,
f: F,
bs: Seq<B>,
) -> boolExpand description
{
&&& 1 <= bs.len() <= items.len() + 1
&&& bs[0] == init
&&& produces.take(bs.len() - 1).all(|p: bool| p)
&&& forall |j: int| {
0 <= j < bs.len() - 1
==> f.requires((bs[j], #[trigger] items[j]))
&& f.ensures((bs[j], items[j]), bs[j + 1])
}
}