val log_entry_hdr_bytesize_eqn_NextEpoch (x: unit) : Lemma (log_entry_hdr_bytesize (Le_payload_NextEpoch x) == 1 + 0) [SMTPat (log_entry_hdr_bytesize (Le_payload_NextEpoch x))]
val log_entry_hdr_bytesize_eqn_NextEpoch (x: unit) : Lemma (log_entry_hdr_bytesize (Le_payload_NextEpoch x) == 1 + 0) [SMTPat (log_entry_hdr_bytesize (Le_payload_NextEpoch x))]
let log_entry_hdr_bytesize_eqn_NextEpoch x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_NextEpoch x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_NextEpoch x))) in assert (1 <= ln /\ ln <= 1));
  (assert (FStar.Seq.length (LP.serialize LP.serialize_empty (x)) == 0))
module Zeta.Formats.Aux.Log_entry_hdr

(* This file has been automatically generated by EverParse. *)
open FStar.Bytes
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module LP = LowParse.Spec
module LT = LowParse.TacLib
module LSZ = LowParse.SLow
module LPI = LowParse.Spec.AllIntegers
module LL = LowParse.Low
module L = FStar.List.Tot
module B = LowStar.Buffer
module BY = FStar.Bytes
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

#reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' --z3rlimit 16 --z3cliopt smt.arith.nl=false --max_fuel 2 --max_ifuel 2"

friend Zeta.Formats.Aux.Log_entry_kind

// Need high Z3 limits for large sum types
#set-options "--z3rlimit 480"

inline_for_extraction unfold let log_entry_kind_as_enum_key (x:log_entry_kind) : Pure (LP.enum_key log_entry_kind_enum)
  (requires norm [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst log_entry_kind_enum)) == true) (ensures fun _ -> True) =
  [@inline_let] let _ = norm_spec [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst log_entry_kind_enum)) in x

inline_for_extraction let key_of_log_entry_hdr (x:log_entry_hdr) : LP.enum_key log_entry_kind_enum =
  match x with
  | Le_payload_AddM _ -> log_entry_kind_as_enum_key AddM
  | Le_payload_AddB _ -> log_entry_kind_as_enum_key AddB
  | Le_payload_EvictM _ -> log_entry_kind_as_enum_key EvictM
  | Le_payload_EvictB _ -> log_entry_kind_as_enum_key EvictB
  | Le_payload_EvictBM _ -> log_entry_kind_as_enum_key EvictBM
  | Le_payload_NextEpoch _ -> log_entry_kind_as_enum_key NextEpoch
  | Le_payload_VerifyEpoch _ -> log_entry_kind_as_enum_key VerifyEpoch
  | Le_payload_RunApp _ -> log_entry_kind_as_enum_key RunApp

inline_for_extraction let log_entry_hdr_case_of_log_entry_kind (x:log_entry_kind) : Type0 =
  match x with
  | AddM -> addm_payload
  | AddB -> addb_payload
  | EvictM -> evictm_payload
  | EvictB -> evictb_payload
  | EvictBM -> evictbm_payload
  | NextEpoch -> unit
  | VerifyEpoch -> unit
  | RunApp -> runapp_payload_hdr

unfold inline_for_extraction let to_log_entry_hdr_case_of_log_entry_kind (x:log_entry_kind) (#x':log_entry_kind) (y:log_entry_hdr_case_of_log_entry_kind x')  : Pure (norm [delta_only [(`%log_entry_hdr_case_of_log_entry_kind)]; iota] (log_entry_hdr_case_of_log_entry_kind x))
  (requires (x == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%log_entry_hdr_case_of_log_entry_kind)] ; iota] (log_entry_hdr_case_of_log_entry_kind x) in y

unfold inline_for_extraction let log_entry_hdr_refine (k:LP.enum_key log_entry_kind_enum) (x:log_entry_hdr)
  : Pure (LP.refine_with_tag key_of_log_entry_hdr k)  (requires norm [delta; iota; zeta] (key_of_log_entry_hdr x) == k) (ensures (fun y -> y == x)) =
  [@inline_let] let _ = norm_spec [delta; iota; zeta] (key_of_log_entry_hdr x) in x

inline_for_extraction let synth_log_entry_hdr_cases (x:LP.enum_key log_entry_kind_enum) (y:log_entry_hdr_case_of_log_entry_kind x)
  : LP.refine_with_tag key_of_log_entry_hdr x =
  match x with
  | AddM -> log_entry_hdr_refine x (Le_payload_AddM (to_log_entry_hdr_case_of_log_entry_kind AddM y))
  | AddB -> log_entry_hdr_refine x (Le_payload_AddB (to_log_entry_hdr_case_of_log_entry_kind AddB y))
  | EvictM -> log_entry_hdr_refine x (Le_payload_EvictM (to_log_entry_hdr_case_of_log_entry_kind EvictM y))
  | EvictB -> log_entry_hdr_refine x (Le_payload_EvictB (to_log_entry_hdr_case_of_log_entry_kind EvictB y))
  | EvictBM -> log_entry_hdr_refine x (Le_payload_EvictBM (to_log_entry_hdr_case_of_log_entry_kind EvictBM y))
  | NextEpoch -> log_entry_hdr_refine x (Le_payload_NextEpoch (to_log_entry_hdr_case_of_log_entry_kind NextEpoch y))
  | VerifyEpoch -> log_entry_hdr_refine x (Le_payload_VerifyEpoch (to_log_entry_hdr_case_of_log_entry_kind VerifyEpoch y))
  | RunApp -> log_entry_hdr_refine x (Le_payload_RunApp (to_log_entry_hdr_case_of_log_entry_kind RunApp y))

unfold inline_for_extraction let from_log_entry_hdr_case_of_log_entry_kind (#x':log_entry_kind) (x:log_entry_kind)
  (y: norm [delta_only [(`%log_entry_hdr_case_of_log_entry_kind)]; iota] (log_entry_hdr_case_of_log_entry_kind x))
  : Pure (log_entry_hdr_case_of_log_entry_kind x') (requires (x == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%log_entry_hdr_case_of_log_entry_kind)] ; iota] (log_entry_hdr_case_of_log_entry_kind x) in y

let synth_log_entry_hdr_cases_recip_pre (k:LP.enum_key log_entry_kind_enum)
  (x:LP.refine_with_tag key_of_log_entry_hdr k) : GTot bool =
  match k with
  | AddM -> Le_payload_AddM? x
  | AddB -> Le_payload_AddB? x
  | EvictM -> Le_payload_EvictM? x
  | EvictB -> Le_payload_EvictB? x
  | EvictBM -> Le_payload_EvictBM? x
  | NextEpoch -> Le_payload_NextEpoch? x
  | VerifyEpoch -> Le_payload_VerifyEpoch? x
  | RunApp -> Le_payload_RunApp? x

let synth_log_entry_hdr_cases_recip_pre_intro (k:LP.enum_key log_entry_kind_enum) (x:LP.refine_with_tag key_of_log_entry_hdr k)
  : Lemma (synth_log_entry_hdr_cases_recip_pre k x == true) =
  norm_spec [delta; iota] (synth_log_entry_hdr_cases_recip_pre k x)

inline_for_extraction let synth_log_entry_hdr_cases_recip (k:LP.enum_key log_entry_kind_enum)
  (x:LP.refine_with_tag key_of_log_entry_hdr k) : (log_entry_hdr_case_of_log_entry_kind k) =
  match k with
  | AddM -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro AddM x in
    (match x with Le_payload_AddM y -> (from_log_entry_hdr_case_of_log_entry_kind AddM y))
  | AddB -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro AddB x in
    (match x with Le_payload_AddB y -> (from_log_entry_hdr_case_of_log_entry_kind AddB y))
  | EvictM -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro EvictM x in
    (match x with Le_payload_EvictM y -> (from_log_entry_hdr_case_of_log_entry_kind EvictM y))
  | EvictB -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro EvictB x in
    (match x with Le_payload_EvictB y -> (from_log_entry_hdr_case_of_log_entry_kind EvictB y))
  | EvictBM -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro EvictBM x in
    (match x with Le_payload_EvictBM y -> (from_log_entry_hdr_case_of_log_entry_kind EvictBM y))
  | NextEpoch -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro NextEpoch x in
    (match x with Le_payload_NextEpoch y -> (from_log_entry_hdr_case_of_log_entry_kind NextEpoch y))
  | VerifyEpoch -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro VerifyEpoch x in
    (match x with Le_payload_VerifyEpoch y -> (from_log_entry_hdr_case_of_log_entry_kind VerifyEpoch y))
  | RunApp -> [@inline_let] let _ = synth_log_entry_hdr_cases_recip_pre_intro RunApp x in
    (match x with Le_payload_RunApp y -> (from_log_entry_hdr_case_of_log_entry_kind RunApp y))

inline_for_extraction let log_entry_hdr_sum = LP.make_sum' log_entry_kind_enum key_of_log_entry_hdr
  log_entry_hdr_case_of_log_entry_kind synth_log_entry_hdr_cases synth_log_entry_hdr_cases_recip
  (_ by (LP.make_sum_synth_case_recip_synth_case_tac ()))
  (_ by (LP.synth_case_synth_case_recip_tac ()))

noextract let parse_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : k:LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind x) =
  match x with
  | AddM -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind AddM)) = (| _, addm_payload_parser |) in u
  | AddB -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind AddB)) = (| _, addb_payload_parser |) in u
  | EvictM -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind EvictM)) = (| _, evictm_payload_parser |) in u
  | EvictB -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind EvictB)) = (| _, evictb_payload_parser |) in u
  | EvictBM -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind EvictBM)) = (| _, evictbm_payload_parser |) in u
  | NextEpoch -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind NextEpoch)) = (| _, LP.parse_empty |) in u
  | VerifyEpoch -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind VerifyEpoch)) = (| _, LP.parse_empty |) in u
  | RunApp -> [@inline_let] let u : (k: LP.parser_kind & LP.parser k (log_entry_hdr_case_of_log_entry_kind RunApp)) = (| _, runapp_payload_hdr_parser |) in u
  | _ -> (| _, LP.parse_false |)

noextract let serialize_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LP.serializer (dsnd (parse_log_entry_hdr_cases x)) =
  match x with
  | AddM -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases AddM)) = addm_payload_serializer in u
  | AddB -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases AddB)) = addb_payload_serializer in u
  | EvictM -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases EvictM)) = evictm_payload_serializer in u
  | EvictB -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases EvictB)) = evictb_payload_serializer in u
  | EvictBM -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases EvictBM)) = evictbm_payload_serializer in u
  | NextEpoch -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases NextEpoch)) = LP.serialize_empty in u
  | VerifyEpoch -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases VerifyEpoch)) = LP.serialize_empty in u
  | RunApp -> [@inline_let] let u : LP.serializer (dsnd (parse_log_entry_hdr_cases RunApp)) = runapp_payload_hdr_serializer in u
  | _ -> LP.serialize_false

inline_for_extraction noextract let size32_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LSZ.size32 (serialize_log_entry_hdr_cases x) =
  match x with
  | AddM -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases AddM) = addm_payload_size32 in u
  | AddB -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases AddB) = addb_payload_size32 in u
  | EvictM -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases EvictM) = evictm_payload_size32 in u
  | EvictB -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases EvictB) = evictb_payload_size32 in u
  | EvictBM -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases EvictBM) = evictbm_payload_size32 in u
  | NextEpoch -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases NextEpoch) = LSZ.size32_empty in u
  | VerifyEpoch -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases VerifyEpoch) = LSZ.size32_empty in u
  | RunApp -> [@inline_let] let u : LSZ.size32 (serialize_log_entry_hdr_cases RunApp) = runapp_payload_hdr_size32 in u
  | _ -> LSZ.size32_false

inline_for_extraction noextract let validate_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LL.validator (dsnd (parse_log_entry_hdr_cases x)) =
  match x with
  | AddM -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases AddM)) = addm_payload_validator in u
  | AddB -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases AddB)) = addb_payload_validator in u
  | EvictM -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases EvictM)) = evictm_payload_validator in u
  | EvictB -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases EvictB)) = evictb_payload_validator in u
  | EvictBM -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases EvictBM)) = evictbm_payload_validator in u
  | NextEpoch -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases NextEpoch)) = (LL.validate_empty ()) in u
  | VerifyEpoch -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases VerifyEpoch)) = (LL.validate_empty ()) in u
  | RunApp -> [@inline_let] let u : LL.validator (dsnd (parse_log_entry_hdr_cases RunApp)) = runapp_payload_hdr_validator in u
  | _ -> LL.validate_false ()

inline_for_extraction noextract let jump_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LL.jumper (dsnd (parse_log_entry_hdr_cases x)) =
  match x with
  | AddM -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases AddM)) = addm_payload_jumper in u
  | AddB -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases AddB)) = addb_payload_jumper in u
  | EvictM -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases EvictM)) = evictm_payload_jumper in u
  | EvictB -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases EvictB)) = evictb_payload_jumper in u
  | EvictBM -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases EvictBM)) = evictbm_payload_jumper in u
  | NextEpoch -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases NextEpoch)) = LL.jump_empty in u
  | VerifyEpoch -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases VerifyEpoch)) = LL.jump_empty in u
  | RunApp -> [@inline_let] let u : LL.jumper (dsnd (parse_log_entry_hdr_cases RunApp)) = runapp_payload_hdr_jumper in u
  | _ -> LL.jump_false

inline_for_extraction noextract let read_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases x)) =
  match x with
  | AddM -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases AddM)) = addm_payload_reader in u
  | AddB -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases AddB)) = addb_payload_reader in u
  | EvictM -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases EvictM)) = evictm_payload_reader in u
  | EvictB -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases EvictB)) = evictb_payload_reader in u
  | EvictBM -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases EvictBM)) = evictbm_payload_reader in u
  | NextEpoch -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases NextEpoch)) = LL.read_empty in u
  | VerifyEpoch -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases VerifyEpoch)) = LL.read_empty in u
  | RunApp -> [@inline_let] let u : LL.leaf_reader (dsnd (parse_log_entry_hdr_cases RunApp)) = runapp_payload_hdr_reader in u
  | _ -> LL.read_false

inline_for_extraction noextract let lserialize_log_entry_hdr_cases (x:LP.sum_key log_entry_hdr_sum)
  : LL.serializer32 (serialize_log_entry_hdr_cases x) =
  match x with
  | AddM -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases AddM) = addm_payload_lserializer in u
  | AddB -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases AddB) = addb_payload_lserializer in u
  | EvictM -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases EvictM) = evictm_payload_lserializer in u
  | EvictB -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases EvictB) = evictb_payload_lserializer in u
  | EvictBM -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases EvictBM) = evictbm_payload_lserializer in u
  | NextEpoch -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases NextEpoch) = LL.serialize32_empty in u
  | VerifyEpoch -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases VerifyEpoch) = LL.serialize32_empty in u
  | RunApp -> [@inline_let] let u : LL.serializer32 (serialize_log_entry_hdr_cases RunApp) = runapp_payload_hdr_lserializer in u
  | _ -> LL.serialize32_false

let log_entry_hdr_parser =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LP.parse_sum log_entry_hdr_sum log_entry_kind_repr_parser parse_log_entry_hdr_cases

let log_entry_hdr_serializer =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LP.serialize_sum log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases

let log_entry_hdr_bytesize (x:log_entry_hdr) : GTot nat = Seq.length (log_entry_hdr_serializer x)

let log_entry_hdr_bytesize_eq x = ()

let log_entry_hdr_size32 =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  assert_norm (LSZ.size32_sum_gen_precond (LP.get_parser_kind log_entry_kind_repr_parser) (LP.weaken_parse_cases_kind log_entry_hdr_sum parse_log_entry_hdr_cases));
  LSZ.size32_sum2 log_entry_hdr_sum log_entry_kind_repr_serializer log_entry_kind_repr_size32 serialize_log_entry_hdr_cases size32_log_entry_hdr_cases (_ by (LP.dep_enum_destr_tac ())) (_ by (LP.enum_repr_of_key_tac log_entry_kind_enum)) ()

let log_entry_hdr_validator =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LL.validate_sum log_entry_hdr_sum log_entry_kind_repr_validator log_entry_kind_repr_reader parse_log_entry_hdr_cases validate_log_entry_hdr_cases (_ by (LP.dep_maybe_enum_destr_t_tac ()))

let log_entry_hdr_jumper =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LL.jump_sum log_entry_hdr_sum log_entry_kind_repr_jumper log_entry_kind_repr_reader parse_log_entry_hdr_cases jump_log_entry_hdr_cases (_ by (LP.dep_maybe_enum_destr_t_tac ()))

let log_entry_hdr_reader =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LL.read_sum log_entry_hdr_sum log_entry_kind_repr_parser read_log_entry_kind_key log_entry_kind_repr_jumper parse_log_entry_hdr_cases read_log_entry_hdr_cases (_ by (LP.dep_enum_destr_tac ()))

let log_entry_hdr_lserializer =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LL.serialize32_sum log_entry_hdr_sum log_entry_kind_repr_serializer lserialize_log_entry_kind_key serialize_log_entry_hdr_cases lserialize_log_entry_hdr_cases (_ by (LP.dep_enum_destr_tac ()))

let lemma_valid_log_entry_hdr_valid_log_entry_kind #_ #_ s pos h =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  LL.valid_sum_elim_tag h log_entry_hdr_sum log_entry_kind_repr_parser parse_log_entry_hdr_cases s pos;
  lemma_synth_log_entry_kind_inj ();
  LL.valid_synth h parse_log_entry_kind_key synth_log_entry_kind s pos

let log_entry_hdr_gaccessor_tag =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  lemma_synth_log_entry_kind_inj ();
  lemma_synth_log_entry_kind_inv ();
  LL.gaccessor_ext
    (LL.gaccessor_compose
      (LL.gaccessor_sum_tag log_entry_hdr_sum log_entry_kind_repr_parser parse_log_entry_hdr_cases)
      (LL.gaccessor_synth_inv parse_log_entry_kind_key synth_log_entry_kind synth_log_entry_kind_inv ())
    )
    log_entry_hdr_clens_tag
    ()

let log_entry_hdr_accessor_tag =
  assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);
  lemma_synth_log_entry_kind_inj ();
  lemma_synth_log_entry_kind_inv ();
  LL.accessor_ext
    (LL.accessor_compose
      (LL.accessor_sum_tag log_entry_hdr_sum log_entry_kind_repr_parser parse_log_entry_hdr_cases)
      (LL.accessor_synth_inv parse_log_entry_kind_key synth_log_entry_kind synth_log_entry_kind_inv ())
      ()
    )
    log_entry_hdr_clens_tag
    ()

let log_entry_hdr_bytesize_eqn_AddM x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_AddM x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_AddM x))) in assert (1 <= ln /\ ln <= 1));
  (addm_payload_bytesize_eq (x))

let log_entry_hdr_bytesize_eqn_AddB x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_AddB x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_AddB x))) in assert (1 <= ln /\ ln <= 1));
  (addb_payload_bytesize_eq (x))

let log_entry_hdr_bytesize_eqn_EvictM x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_EvictM x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_EvictM x))) in assert (1 <= ln /\ ln <= 1));
  (evictm_payload_bytesize_eq (x))

let log_entry_hdr_bytesize_eqn_EvictB x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_EvictB x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_EvictB x))) in assert (1 <= ln /\ ln <= 1));
  (evictb_payload_bytesize_eq (x))

let log_entry_hdr_bytesize_eqn_EvictBM x =
    assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser) log_entry_hdr_sum parse_log_entry_hdr_cases == log_entry_hdr_parser_kind);

  LP.serialize_sum_eq log_entry_hdr_sum log_entry_kind_repr_serializer serialize_log_entry_hdr_cases (Le_payload_EvictBM x);
  (let ln = FStar.Seq.length (LP.serialize (LP.serialize_enum_key _ log_entry_kind_repr_serializer (LP.sum_enum log_entry_hdr_sum)) (key_of_log_entry_hdr (Le_payload_EvictBM x))) in assert (1 <= ln /\ ln <= 1));
  (evictbm_payload_bytesize_eq (x))
/
Zeta.Formats.Aux.Log_entry_kind.fst.checked prims.fst.checked LowStar.Buffer.fst.checked LowParse.TacLib.fst.checked LowParse.Spec.AllIntegers.fst.checked LowParse.Spec.fst.checked LowParse.SLow.fst.checked LowParse.Low.fst.checked FStar.UInt8.fsti.checked FStar.UInt64.fsti.checked FStar.UInt32.fsti.checked FStar.UInt16.fsti.checked FStar.Tactics.Effect.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Bytes.fsti.checked
Zeta.Formats.Aux.Log_entry_hdr.fst
x: Prims.unit
  -> FStar.Pervasives.Lemma
      (ensures
        Zeta.Formats.Aux.Log_entry_hdr.log_entry_hdr_bytesize (Zeta.Formats.Aux.Log_entry_hdr.Le_payload_NextEpoch
            x) ==
        1 + 0)
      [
        SMTPat (Zeta.Formats.Aux.Log_entry_hdr.log_entry_hdr_bytesize (Zeta.Formats.Aux.Log_entry_hdr.Le_payload_NextEpoch
                x))
      ]
Prims.unit Prims._assert Prims.eq2 Prims.int FStar.Seq.Base.length LowParse.Bytes.byte LowParse.Spec.Base.serialize LowParse.Spec.Combinators.parse_ret_kind LowParse.Spec.Combinators.parse_empty LowParse.Spec.Combinators.serialize_empty Prims.l_and Prims.b2t Prims.op_LessThanOrEqual Prims.nat LowParse.Spec.Combinators.parse_filter_kind LowParse.Spec.Int.parse_u8_kind LowParse.Spec.Enum.enum_key LowParse.Spec.Sum.sum_key_type Zeta.Formats.Aux.Log_entry_hdr.log_entry_hdr_sum FStar.UInt8.t LowParse.Spec.Sum.sum_enum LowParse.Spec.Enum.parse_enum_key LowParse.Spec.Int.parse_u8 LowParse.Spec.Enum.serialize_enum_key Zeta.Formats.Aux.Log_entry_kind.log_entry_kind_repr_serializer Zeta.Formats.Aux.Log_entry_hdr.key_of_log_entry_hdr Zeta.Formats.Aux.Log_entry_hdr.Le_payload_NextEpoch LowParse.Spec.Sum.serialize_sum_eq Zeta.Formats.Aux.Log_entry_hdr.parse_log_entry_hdr_cases Zeta.Formats.Aux.Log_entry_hdr.serialize_log_entry_hdr_cases FStar.Pervasives.assert_norm LowParse.Spec.Base.parser_kind LowParse.Spec.Sum.parse_sum_kind LowParse.Spec.Base.get_parser_kind Zeta.Formats.Aux.Log_entry_kind.log_entry_kind_repr_parser Zeta.Formats.Aux.Log_entry_hdr.log_entry_hdr_parser_kind
let log_entry_hdr_bytesize_eqn_NextEpoch x =
  
assert_norm (LP.parse_sum_kind (LP.get_parser_kind log_entry_kind_repr_parser)
      log_entry_hdr_sum
      parse_log_entry_hdr_cases ==
    log_entry_hdr_parser_kind);
LP.serialize_sum_eq log_entry_hdr_sum
  log_entry_kind_repr_serializer
  serialize_log_entry_hdr_cases
  (Le_payload_NextEpoch x);
(let ln =
    FStar.Seq.length (LP.serialize (LP.serialize_enum_key _
              log_entry_kind_repr_serializer
              (LP.sum_enum log_entry_hdr_sum))
          (key_of_log_entry_hdr (Le_payload_NextEpoch x)))
  in
  assert (1 <= ln /\ ln <= 1));
(assert (FStar.Seq.length (LP.serialize LP.serialize_empty (x)) == 0))