Trait creusot_contracts::std::iter::Iterator
source · pub trait Iterator: Iterator {
// Required methods
fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool;
fn completed(&mut self) -> bool;
fn produces_refl(self);
fn produces_trans(
a: Self,
ab: Seq<Self::Item>,
b: Self,
bc: Seq<Self::Item>,
c: Self,
);
// Provided method
fn map_inv<B, F>(self, func: F) -> MapInv<Self, Self::Item, F>
where Self: Sized,
F: FnMut(Self::Item, Snapshot<Seq<Self::Item>>) -> B { ... }
}
Required Methods§
sourcefn produces_refl(self)
fn produces_refl(self)
law
ensures
self.produces(Seq::EMPTY, self)
Provided Methods§
sourcefn map_inv<B, F>(self, func: F) -> MapInv<Self, Self::Item, F>
fn map_inv<B, F>(self, func: F) -> MapInv<Self, Self::Item, F>
requires
forall<e : Self::Item, i2 : Self> self.produces(Seq::singleton(e), i2) ==> func.precondition((e, Snapshot::new(Seq::EMPTY)))
requires
MapInv::<Self, _, F>::reinitialize()
requires
MapInv::<Self, Self::Item, F>::preservation(self, func)
ensures
result == MapInv { iter: self, func, produced: Snapshot::new(Seq::EMPTY) }
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<I: Iterator + ?Sized> Iterator for &mut I
impl<I: Iterator + ?Sized> Iterator for &mut I
source§fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool
fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool
logic(prophetic)
pearlite! { (*self).produces(visited, *o) && ^self == ^o }
source§fn completed(&mut self) -> bool
fn completed(&mut self) -> bool
logic(prophetic)
pearlite! { (*self).completed() && ^*self == ^^self }
source§fn produces_refl(self)
fn produces_refl(self)
law
ensures
self.produces(Seq::EMPTY, self)
source§impl<T, const N: usize> Iterator for IntoIter<T, N>
impl<T, const N: usize> Iterator for IntoIter<T, N>
source§fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool
fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool
logic(prophetic)
pearlite! { self@ == visited.concat(o@) }
source§fn completed(&mut self) -> bool
fn completed(&mut self) -> bool
logic(prophetic)
pearlite! { self.resolve() && self@ == Seq::EMPTY }
source§fn produces_refl(self)
fn produces_refl(self)
law
ensures
self.produces(Seq::EMPTY, self)