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§

source

fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool

logic(prophetic)

source

fn completed(&mut self) -> bool

logic(prophetic)

source

fn produces_refl(self)

law

ensures

self.produces(Seq::EMPTY, self)

source

fn produces_trans( a: Self, ab: Seq<Self::Item>, b: Self, bc: Seq<Self::Item>, c: Self, )

law

requires

a.produces(ab, b)

requires

b.produces(bc, c)

ensures

a.produces(ab.concat(bc), c)

Provided Methods§

source

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,

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

source§

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

logic(prophetic)

pearlite! { (*self).completed() && ^*self == ^^self }

source§

fn produces_refl(self)

law

ensures

self.produces(Seq::EMPTY, self)

source§

fn produces_trans( a: Self, ab: Seq<Self::Item>, b: Self, bc: Seq<Self::Item>, c: Self, )

law

requires

a.produces(ab, b)

requires

b.produces(bc, c)

ensures

a.produces(ab.concat(bc), c)

source§

impl<T, const N: usize> Iterator for IntoIter<T, N>

source§

fn produces(self, visited: Seq<Self::Item>, o: Self) -> bool

logic(prophetic)

pearlite! { self@ == visited.concat(o@) }

source§

fn completed(&mut self) -> bool

logic(prophetic)

pearlite! { self.resolve() && self@ == Seq::EMPTY }

source§

fn produces_refl(self)

law

ensures

self.produces(Seq::EMPTY, self)

source§

fn produces_trans( a: Self, ab: Seq<Self::Item>, b: Self, bc: Seq<Self::Item>, c: Self, )

law

requires

a.produces(ab, b)

requires

b.produces(bc, c)

ensures

a.produces(ab.concat(bc), c)

Implementors§

source§

impl<'a, I, T> Iterator for Cloned<I>
where I: Iterator<Item = &'a T>, T: Clone + 'a,

source§

impl<'a, I, T> Iterator for Copied<I>
where I: Iterator<Item = &'a T>, T: Copy + 'a,

source§

impl<'a, T> Iterator for creusot_contracts::std::collections::vec_deque::Iter<'a, T>

source§

impl<'a, T> Iterator for creusot_contracts::std::option::Iter<'a, T>

source§

impl<'a, T> Iterator for creusot_contracts::std::option::IterMut<'a, T>

source§

impl<'a, T> Iterator for creusot_contracts::std::slice::Iter<'a, T>

source§

impl<'a, T> Iterator for creusot_contracts::std::slice::IterMut<'a, T>

source§

impl<A: Iterator, B: Iterator> Iterator for Zip<A, B>

source§

impl<B, I, F> Iterator for Map<I, F>
where I: Iterator, Self: Iterator<Item = B>, F: FnMut(I::Item) -> B,

source§

impl<I> Iterator for Enumerate<I>
where I: Iterator,

source§

impl<I, F> Iterator for Filter<I, F>
where I: Iterator, F: FnMut(&I::Item) -> bool,

source§

impl<I: Iterator> Iterator for Fuse<I>

source§

impl<I: Iterator> Iterator for Skip<I>

source§

impl<I: Iterator> Iterator for Take<I>

source§

impl<I: Iterator, B, F: FnMut(I::Item, Snapshot<Seq<I::Item>>) -> B> Iterator for MapInv<I, I::Item, F>

source§

impl<Idx: DeepModel<DeepModelTy = Int> + Step> Iterator for Range<Idx>

source§

impl<Idx: DeepModel<DeepModelTy = Int> + Step> Iterator for RangeInclusive<Idx>

source§

impl<T> Iterator for creusot_contracts::std::option::IntoIter<T>

source§

impl<T> Iterator for Empty<T>

source§

impl<T> Iterator for Once<T>

source§

impl<T, A: Allocator> Iterator for creusot_contracts::std::vec::IntoIter<T, A>

source§

impl<T: Clone> Iterator for Repeat<T>