LinkedListOwner

Struct LinkedListOwner 

Source
pub struct LinkedListOwner<M: AnyFrameMeta + Repr<MetaSlot>> {
    pub list: Seq<LinkOwner>,
    pub perms: Map<int, PointsTo<MetaSlot, Link<M>>>,
    pub list_id: u64,
}

Fields§

§list: Seq<LinkOwner>§perms: Map<int, PointsTo<MetaSlot, Link<M>>>§list_id: u64

Implementations§

Source§

impl<M: AnyFrameMeta + Repr<MetaSlot>> LinkedListOwner<M>

Source

pub open spec fn inv_at(self, i: int) -> bool

{
    &&& self.perms.contains_key(i)
    &&& self.perms[i].addr() == self.list[i].paddr
    &&& self.perms[i].points_to.addr() == self.list[i].paddr
    &&& self.perms[i].wf()
    &&& self.perms[i].addr() % META_SLOT_SIZE() == 0
    &&& FRAME_METADATA_RANGE().start <= self.perms[i].addr()
        < FRAME_METADATA_RANGE().start + MAX_NR_PAGES() * META_SLOT_SIZE()
    &&& self.perms[i].is_init()
    &&& self.perms[i].value().wf(self.list[i])
    &&& i == 0 <==> self.perms[i].mem_contents().value().prev is None
    &&& i == self.list.len() - 1 <==> self.perms[i].value().next is None
    &&& 0 < i
        ==> self.perms[i].value().prev is Some
            && self.perms[i].value().prev.unwrap() == self.perms[i - 1].pptr()
    &&& i < self.list.len() - 1
        ==> self.perms[i].value().next is Some
            && self.perms[i].value().next.unwrap() == self.perms[i + 1].pptr()
    &&& self.list[i].inv()
    &&& self.list[i].in_list == self.list_id

}
Source

pub open spec fn view_helper(owners: Seq<LinkOwner>) -> Seq<LinkModel>

{
    if owners.len() == 0 {
        Seq::<LinkModel>::empty()
    } else {
        seq![owners[0].view()].add(Self::view_helper(owners.remove(0)))
    }
}
Source

pub proof fn view_preserves_len(owners: Seq<LinkOwner>)

ensures
Self::view_helper(owners).len() == owners.len(),

Trait Implementations§

Source§

impl<M: AnyFrameMeta + Repr<MetaSlot>> Inv for LinkedListOwner<M>

Source§

open spec fn inv(self) -> bool

{ forall |i: int| 0 <= i < self.list.len() ==> self.inv_at(i) }
Source§

impl<M: AnyFrameMeta + Repr<MetaSlot>> InvView for LinkedListOwner<M>

Source§

impl<M: AnyFrameMeta + Repr<MetaSlot>> View for LinkedListOwner<M>

Source§

open spec fn view(&self) -> Self::V

{
    LinkedListModel {
        list: Self::view_helper(self.list),
    }
}
Source§

type V = LinkedListModel

Auto Trait Implementations§

§

impl<M> Freeze for LinkedListOwner<M>

§

impl<M> !RefUnwindSafe for LinkedListOwner<M>

§

impl<M> Send for LinkedListOwner<M>
where M: Send,

§

impl<M> Sync for LinkedListOwner<M>
where M: Sync,

§

impl<M> Unpin for LinkedListOwner<M>
where M: Unpin,

§

impl<M> UnwindSafe for LinkedListOwner<M>
where M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

impl<T, U> IntoSpecImpl<U> for T
where U: From<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

impl<T, U> TryIntoSpecImpl<U> for T
where U: TryFrom<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<U, <U as TryFrom<T>>::Error>