Skip to main content

BundledSpecs

Type Alias BundledSpecs 

Source
pub type BundledSpecs<T> = (PredFnSpec<T>, ByteLenFnSpec<T>, ParserFnSpec<T>, SerializerFnSpec<T>, SerializerDPSFnSpec<T>);

Trait Implementations§

Source§

impl<T> Consistency for BundledSpecs<T>

Source§

open spec fn consistent(&self, v: Self::Val) -> bool

{ (self.0)(v) }
Source§

type Val = T

The type of values whose consistency is being checked.
Source§

impl<T> EquivSerializers for BundledSpecs<T>

Source§

open spec fn equiv_inv(&self) -> bool

{
    let (_, _, _, s, s_dps) = *self;
    forall |v: T| #[trigger] (s_dps)(v, seq![]) == (s)(v) + seq![]
}
Source§

proof fn lemma_serialize_equiv_on_empty(&self, v: Self::SVal)

Source§

impl<T> EquivSerializersGeneral for BundledSpecs<T>

Source§

open spec fn equiv_general_inv(&self) -> bool

{
    let (_, _, _, s, s_dps) = *self;
    forall |v: T, obuf: Seq<u8>| #[trigger] (s_dps)(v, obuf) == (s)(v) + obuf
}
Source§

proof fn lemma_serialize_equiv(&self, v: Self::SVal, obuf: Seq<u8>)

Source§

impl<T> GoodSerializer for BundledSpecs<T>

Source§

open spec fn serialize_inv(&self) -> bool

{ serializer_specs(*self).serialize_inv() }
Source§

proof fn lemma_serialize_len(&self, v: Self::SVal)

Source§

impl<T> NoLookAhead for BundledSpecs<T>

Source§

open spec fn no_lookahead_inv(&self) -> bool

{
    let (_, _, p, _, _) = *self;
    no_lookahead_parser(p)
}
Source§

proof fn lemma_no_lookahead(&self, i1: Seq<u8>, i2: Seq<u8>)

Source§

fn corollary_non_extensible(&self, i1: Seq<u8>, i2: Seq<u8>)

Source§

impl<T> NonMalleable for BundledSpecs<T>

Source§

open spec fn nonmal_inv(&self) -> bool

{ parser_specs(*self).nonmal_inv() }
Source§

proof fn lemma_parse_non_malleable(&self, buf1: Seq<u8>, buf2: Seq<u8>)

Source§

impl<T> NonTailFmt for BundledSpecs<T>

Source§

open spec fn serialize_dps_inv(&self) -> bool

{
    let (_, b, _, _, s_dps) = *self;
    non_tail_fmt_dps(s_dps, b)
}
Source§

proof fn lemma_serialize_dps_prepend(&self, v: Self::SValue, obuf: Seq<u8>)

Source§

proof fn lemma_serialize_dps_len(&self, v: Self::SValue, obuf: Seq<u8>)

Source§

impl<T> Productive for BundledSpecs<T>

Source§

open spec fn productive_inv(&self) -> bool

{ parser_specs(*self).productive_inv() }
Source§

proof fn lemma_productive(&self, ibuf: Seq<u8>)

Source§

impl<T> SPRoundTripDps for BundledSpecs<T>

Source§

open spec fn unambiguous(&self) -> bool

{
    let (c, b, p, _, s_dps) = *self;
    sp_roundtrip_dps(p, c, b, s_dps)
}
Source§

proof fn theorem_serialize_dps_parse_roundtrip(&self, v: Self::T, obuf: Seq<u8>)

Source§

impl<T> SafeParser for BundledSpecs<T>

Source§

open spec fn safe_inv(&self) -> bool

{ parser_specs(*self).safe_inv() }
Source§

proof fn lemma_parse_safe(&self, ibuf: Seq<u8>)

Source§

impl<T> SoundParser for BundledSpecs<T>

Source§

open spec fn sound_inv(&self) -> bool

{ parser_specs(*self).sound_inv() }
Source§

proof fn lemma_parse_sound_consumption(&self, ibuf: Seq<u8>)

Source§

proof fn lemma_parse_sound_value(&self, ibuf: Seq<u8>)

Source§

impl<T> SpecByteLen for BundledSpecs<T>

Source§

open spec fn byte_len(&self, v: Self::T) -> nat

{ (self.1)(v) }
Source§

type T = T

The type of values whose byte length is being computed.
Source§

impl<T> SpecParser for BundledSpecs<T>

Source§

open spec fn spec_parse(&self, input: Seq<u8>) -> Option<(int, Self::PVal)>

{ (self.2)(input) }
Source§

type PVal = T

The type of parsed values.
Source§

impl<T> SpecSerializer for BundledSpecs<T>

Source§

open spec fn spec_serialize(&self, v: Self::SVal) -> Seq<u8>

{ (self.3)(v) }
Source§

type SVal = T

The type of values to be serialized.
Source§

impl<T> SpecSerializerDps for BundledSpecs<T>

Source§

open spec fn spec_serialize_dps(&self, v: Self::SValue, obuf: Seq<u8>) -> Seq<u8>

{ (self.4)(v, obuf) }
Source§

type SValue = T

The type of values to be serialized.