MetaRegionOwners

Struct MetaRegionOwners 

Source
pub struct MetaRegionOwners {
    pub slots: Map<usize, PointsTo<MetaSlot>>,
    pub dropped_slots: Map<usize, PointsTo<MetaSlot>>,
    pub slot_owners: Map<usize, MetaSlotOwner>,
}

Fields§

§slots: Map<usize, PointsTo<MetaSlot>>§dropped_slots: Map<usize, PointsTo<MetaSlot>>§slot_owners: Map<usize, MetaSlotOwner>

Implementations§

Source§

impl MetaRegionOwners

Source

pub open spec fn ref_count(self, i: usize) -> res : u64

recommends
self.inv(),
i < max_meta_slots() as usize,
{ self.slot_owners[i].ref_count.value() }
Source

pub open spec fn paddr_range_in_region(self, range: Range<Paddr>) -> bool

recommends
self.inv(),
range.start < range.end < MAX_PADDR(),
{
    forall |paddr: Paddr| {
        (range.start <= paddr < range.end && paddr % PAGE_SIZE() == 0)
            ==> self.slots.contains_key(frame_to_index_spec(paddr))
    }
}
Source

pub open spec fn paddr_range_in_dropped_region(self, range: Range<Paddr>) -> bool

recommends
self.inv(),
range.start < range.end < MAX_PADDR(),
{
    forall |paddr: Paddr| {
        (range.start <= paddr < range.end && paddr % PAGE_SIZE() == 0)
            ==> !self.slots.contains_key(frame_to_index_spec(paddr))
                && self.dropped_slots.contains_key(frame_to_index_spec(paddr))
    }
}
Source

pub open spec fn paddr_range_not_in_region(self, range: Range<Paddr>) -> bool

recommends
self.inv(),
range.start < range.end < MAX_PADDR(),
{
    forall |paddr: Paddr| {
        (range.start <= paddr < range.end && paddr % PAGE_SIZE() == 0)
            ==> !self.slots.contains_key(frame_to_index_spec(paddr))
                && !self.dropped_slots.contains_key(frame_to_index_spec(paddr))
    }
}
Source

pub proof fn inv_implies_correct_addr(self, paddr: usize)

requires
paddr < MAX_PADDR(),
paddr % PAGE_SIZE() == 0,
self.inv(),
ensures
self.slot_owners.contains_key(frame_to_index_spec(paddr) as usize),

Trait Implementations§

Source§

impl Inv for MetaRegionOwners

Source§

open spec fn inv(self) -> bool

{
    &&& self.slots.dom().finite()
    &&& {
        forall |i: usize| {
            i < max_meta_slots() <==> #[trigger] self.slot_owners.contains_key(i)
        }
    }
    &&& {
        forall |i: usize| #[trigger] self.slots.contains_key(i) ==> i < max_meta_slots()
    }
    &&& {
        forall |i: usize| {
            #[trigger] self.dropped_slots.contains_key(i) ==> i < max_meta_slots()
        }
    }
    &&& {
        forall |i: usize| {
            #[trigger] self.slot_owners.contains_key(i) ==> self.slot_owners[i].inv()
        }
    }
    &&& {
        forall |i: usize| {
            #[trigger] self.slots.contains_key(i)
                ==> {
                    &&& self.slots[i].is_init()
                    &&& self.slots[i].addr() == meta_addr(i)
                    &&& self.slots[i].value().wf(self.slot_owners[i])
                    &&& self.slot_owners[i].self_addr == self.slots[i].addr()
                    &&& !self.dropped_slots.contains_key(i)

                }
        }
    }
    &&& {
        forall |i: usize| {
            #[trigger] self.dropped_slots.contains_key(i)
                ==> {
                    &&& self.dropped_slots[i].is_init()
                    &&& self.dropped_slots[i].addr() == meta_addr(i)
                    &&& self.dropped_slots[i].value().wf(self.slot_owners[i])
                    &&& self.slot_owners[i].self_addr == self.dropped_slots[i].addr()
                    &&& !self.slots.contains_key(i)

                }
        }
    }

}
Source§

impl InvView for MetaRegionOwners

Source§

impl View for MetaRegionOwners

Source§

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

{
    let slots = self.slot_owners.map_values(|s: MetaSlotOwner| s@);
    MetaRegionModel { slots }
}
Source§

type V = MetaRegionModel

Auto Trait Implementations§

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>