pub mod exec;
pub mod proof;
pub mod spec;
use vstd::prelude::*;
verus! {
#[derive(Copy)]
pub struct Star<A>(pub A);
impl<A: Clone> Clone for Star<A> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(A::clone, (&self.0,), cloned.0),
{
Star(self.0.clone())
}
}
#[derive(Copy)]
pub struct Repeat<A, B>(pub A, pub B);
impl<A: Clone, B: Clone> Clone for Repeat<A, B> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(A::clone, (&self.0,), cloned.0),
call_ensures(B::clone, (&self.1,), cloned.1),
{
Repeat(self.0.clone(), self.1.clone())
}
}
#[derive(Copy)]
pub struct RepeatN<C, N = u8>(pub N, pub C);
impl<C: Clone, N: Clone> Clone for RepeatN<C, N> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(N::clone, (&self.0,), cloned.0),
call_ensures(C::clone, (&self.1,), cloned.1),
{
RepeatN(self.0.clone(), self.1.clone())
}
}
#[derive(Copy)]
pub struct Array<const N: usize, C>(pub C);
impl<const N: usize, C: Clone> Clone for Array<N, C> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(C::clone, (&self.0,), cloned.0),
{
Array(self.0.clone())
}
}
}