pub struct GhostSubseq<V> { /* private fields */ }
Implementations§
Source§impl<V> GhostSubseq<V>
impl<V> GhostSubseq<V>
Sourcepub open spec fn spec_index(self, idx: int) -> V
pub open spec fn spec_index(self, idx: int) -> V
recommends
0 <= idx < self.len(),
{ self@[idx] }
Sourcepub open spec fn subrange_abs(self, start_inclusive: int, end_exclusive: int) -> Seq<V>
pub open spec fn subrange_abs(self, start_inclusive: int, end_exclusive: int) -> Seq<V>
recommends
self.off() <= start_inclusive <= end_exclusive <= self.off() + self@.len(),
{ self@.subrange(start_inclusive - self.off(), end_exclusive - self.off()) }
Sourcepub proof fn agree(tracked self: &GhostSubseq<V>, tracked auth: &GhostSeqAuth<V>)
pub proof fn agree(tracked self: &GhostSubseq<V>, tracked auth: &GhostSeqAuth<V>)
requires
self.id() == auth.id(),
ensuresself@.len() > 0
==> {
&&& self@
=~= auth@
.subrange(
self.off() as int - auth.off(),
self.off() - auth.off() + self@.len() as int,
)
&&& self.off() >= auth.off()
&&& self.off() + self@.len() <= auth.off() + auth@.len()
},
Sourcepub proof fn agree_map(tracked self: &GhostSubseq<V>, tracked auth: &GhostMapAuth<int, V>)
pub proof fn agree_map(tracked self: &GhostSubseq<V>, tracked auth: &GhostMapAuth<int, V>)
requires
self.id() == auth.id(),
ensuresforall |i| {
0 <= i < self@.len()
==> #[trigger] auth@.contains_key(self.off() + i)
&& auth@[self.off() + i] == self@[i]
},
Sourcepub proof fn update(tracked self: &mut GhostSubseq<V>, tracked auth: &mut GhostSeqAuth<V>, v: Seq<V>)
pub proof fn update(tracked self: &mut GhostSubseq<V>, tracked auth: &mut GhostSeqAuth<V>, v: Seq<V>)
requires
old(self).id() == old(auth).id(),
v.len() == old(self)@.len(),
ensuresself.id() == auth.id(),
self.off() == old(self).off(),
auth.id() == old(auth).id(),
self@ =~= v,
auth@ =~= old(auth)@.update_subrange_with(self.off() - auth.off(), v),
self.off() == old(self).off(),
auth.off() == old(auth).off(),
Sourcepub proof fn update_map(tracked
self: &mut GhostSubseq<V>,
tracked auth: &mut GhostMapAuth<int, V>,
v: Seq<V>,
)
pub proof fn update_map(tracked self: &mut GhostSubseq<V>, tracked auth: &mut GhostMapAuth<int, V>, v: Seq<V>, )
requires
old(self).id() == old(auth).id(),
v.len() == old(self)@.len(),
ensuresself.id() == auth.id(),
self.off() == old(self).off(),
auth.id() == old(auth).id(),
self@ =~= v,
auth@
=~= Map::new(
|i: int| old(auth)@.contains_key(i),
|i: int| {
if self.off() <= i < self.off() + v.len() {
v[i - self.off()]
} else {
old(auth)@[i]
}
},
),
Sourcepub proof fn split(tracked self: &mut GhostSubseq<V>, n: int) -> tracked result : GhostSubseq<V>
pub proof fn split(tracked self: &mut GhostSubseq<V>, n: int) -> tracked result : GhostSubseq<V>
requires
0 <= n <= old(self)@.len(),
ensuresself.id() == old(self).id(),
self.off() == old(self).off(),
result.id() == self.id(),
result.off() == old(self).off() + n,
self@ =~= old(self)@.subrange(0, n),
result@ =~= old(self)@.subrange(n, old(self)@.len() as int),
Sourcepub proof fn combine(tracked self: &mut GhostSubseq<V>, tracked r: GhostSubseq<V>)
pub proof fn combine(tracked self: &mut GhostSubseq<V>, tracked r: GhostSubseq<V>)
requires
r.id() == old(self).id(),
r.off() == old(self).off() + old(self)@.len(),
ensuresself.id() == old(self).id(),
self@ =~= old(self)@ + r@,
self.off() == old(self).off(),
Sourcepub proof fn disjoint(tracked &mut self, tracked other: &GhostSubseq<V>)
pub proof fn disjoint(tracked &mut self, tracked other: &GhostSubseq<V>)
requires
old(self).id() == other.id(),
ensuresself.id() == old(self).id(),
self.off() == old(self).off(),
self@ == old(self)@,
self@.len() == 0 || other@.len() == 0 || self.off() + self@.len() <= other.off()
|| other.off() + other@.len() <= self.off(),
Sourcepub proof fn new(off: nat, len: nat, tracked f: GhostSubmap<int, V>) -> tracked result : GhostSubseq<V>
pub proof fn new(off: nat, len: nat, tracked f: GhostSubmap<int, V>) -> tracked result : GhostSubseq<V>
requires
f@.dom() == Set::new(|i: int| off <= i < off + len),
ensuresresult.id() == f.id(),
result.off() == off,
result@ == Seq::new(len, |i| f@[off + i]),
Auto Trait Implementations§
impl<V> Freeze for GhostSubseq<V>
impl<V> RefUnwindSafe for GhostSubseq<V>where
V: RefUnwindSafe,
impl<V> Send for GhostSubseq<V>where
V: Send,
impl<V> Sync for GhostSubseq<V>where
V: Sync,
impl<V> Unpin for GhostSubseq<V>where
V: Unpin,
impl<V> UnwindSafe for GhostSubseq<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more