pub mod exec;
pub mod proof;
pub mod spec;
use crate::core::proof::LeafNonMalleable;
use vstd::prelude::*;
use super::AsLen;
verus! {
#[derive(Clone, Copy)]
pub struct Fixed<const N: usize>;
#[derive(Copy)]
pub struct Varied<Len = u8>(pub Len);
impl<Len: Clone> Clone for Varied<Len> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(Len::clone, (&self.0,), cloned.0),
{
Varied(self.0.clone())
}
}
#[derive(Copy)]
pub struct ExactLen<Inner, Len = u8>(pub Len, pub Inner);
impl<Inner: Clone, Len: Clone> Clone for ExactLen<Inner, Len> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(Len::clone, (&self.0,), cloned.0),
call_ensures(Inner::clone, (&self.1,), cloned.1),
{
ExactLen(self.0.clone(), self.1.clone())
}
}
#[derive(Copy)]
pub struct AndThen<A, B>(pub A, pub B);
impl<A: Clone, B: Clone> Clone for AndThen<A, B> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(A::clone, (&self.0,), cloned.0),
call_ensures(B::clone, (&self.1,), cloned.1),
{
AndThen(self.0.clone(), self.1.clone())
}
}
impl<const N: usize> LeafNonMalleable for Fixed<N> {
proof fn nonmal_leaf_inv(&self) {
}
}
impl<Len: AsLen> LeafNonMalleable for Varied<Len> {
proof fn nonmal_leaf_inv(&self) {
}
}
}