vest_lib/core/exec/
mod.rs1pub mod bridge_lemmas;
11pub mod error;
12pub mod fns;
13pub mod input;
14pub mod output;
15pub mod parser;
16pub mod serializer;
17
18pub use error::{ParseError, ParseErrorKind};
19pub use input::{InputBuf, InputSlice};
20pub use output::{OutputBuf, OutputSlice};
21pub use parser::{PResult, Parser};
22pub use serializer::{
23 ByteLen, ComplianceErrorKind, PreSerializeError, Prepare, Serializer, SerializerExt,
24};
25
26use vstd::prelude::*;
27#[cfg(verus_only)]
28use vstd::std_specs::cmp::PartialEqIs;
29
30verus! {
31
32pub assume_specification<T: core::cmp::PartialEq<U>, U>[ <[T] as PartialEq<[U]>>::eq ](
33 x: &[T],
34 y: &[U],
35) -> (res: bool)
36 ensures
37 res == (x@.len() == y@.len() && forall|i: int|
38 #![auto]
39 0 <= i < x@.len() ==> x@[i].is_eq(&y@[i])),
40;
41
42#[inline(always)]
43pub fn bytes_eq(a: &[u8], b: &[u8]) -> (r: bool)
44 ensures
45 r == (a@ == b@),
46 r == (a.deep_view() == b.deep_view()),
47{
48 let res = *a == *b;
49 assert(a@ == a.deep_view());
50 assert(b@ == b.deep_view());
51 assert(res ==> (a.deep_view() == b.deep_view()));
52 res
53}
54
55}