val timestamp_bytesize_eqn (x: timestamp) : Lemma (timestamp_bytesize x == 4 + 4) [SMTPat (timestamp_bytesize x)]
val timestamp_bytesize_eqn (x: timestamp) : Lemma (timestamp_bytesize x == 4 + 4) [SMTPat (timestamp_bytesize x)]
let timestamp_bytesize_eqn x =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LP.serialize_synth_eq _ synth_timestamp timestamp'_serializer synth_timestamp_recip () x;
LP.length_serialize_nondep_then LPI.serialize_u32 LPI.serialize_u32 x.epoch x.counter;
  (assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.epoch)) == 4));
  (assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.counter)) == 4));
  assert(timestamp_bytesize x == Seq.length (LP.serialize LPI.serialize_u32 x.epoch) + Seq.length (LP.serialize LPI.serialize_u32 x.counter))
module Zeta.Formats.Aux.Timestamp

(* 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"

type timestamp' = (U32.t & U32.t)

inline_for_extraction let synth_timestamp (x: timestamp') : timestamp =
  match x with (epoch,counter) -> {
    epoch = epoch;
    counter = counter;
  }

inline_for_extraction let synth_timestamp_recip (x: timestamp) : timestamp' = (x.epoch,x.counter)

let synth_timestamp_recip_inverse () : Lemma (LP.synth_inverse synth_timestamp_recip synth_timestamp) = ()

let synth_timestamp_injective () : Lemma (LP.synth_injective synth_timestamp) =
  LP.synth_inverse_synth_injective synth_timestamp_recip synth_timestamp;
  synth_timestamp_recip_inverse ()

let synth_timestamp_inverse () : Lemma (LP.synth_inverse synth_timestamp synth_timestamp_recip) =
  assert_norm (LP.synth_inverse synth_timestamp synth_timestamp_recip)

let synth_timestamp_recip_injective () : Lemma (LP.synth_injective synth_timestamp_recip) =
  synth_timestamp_recip_inverse ();
  LP.synth_inverse_synth_injective synth_timestamp synth_timestamp_recip

noextract let timestamp'_parser : LP.parser _ timestamp' = (LPI.parse_u32 `LP.nondep_then` LPI.parse_u32)

noextract let timestamp'_parser_kind = LP.get_parser_kind timestamp'_parser

let timestamp_parser =
  synth_timestamp_injective ();
  assert_norm (timestamp_parser_kind == timestamp'_parser_kind);
  timestamp'_parser `LP.parse_synth` synth_timestamp

noextract let timestamp'_serializer : LP.serializer timestamp'_parser = (LPI.serialize_u32 `LP.serialize_nondep_then` LPI.serialize_u32)

let timestamp_serializer =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LP.serialize_synth _ synth_timestamp timestamp'_serializer synth_timestamp_recip ()

let timestamp_bytesize (x:timestamp) : GTot nat = Seq.length (timestamp_serializer x)

let timestamp_bytesize_eq x = ()

inline_for_extraction let timestamp'_size32 : LSZ.size32 timestamp'_serializer = (LSZ.size32_u32 `LSZ.size32_nondep_then` LSZ.size32_u32)

let timestamp_size32 =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LSZ.size32_synth _ synth_timestamp _ timestamp'_size32 synth_timestamp_recip (fun x -> synth_timestamp_recip x) ()

inline_for_extraction let timestamp'_reader : LL.leaf_reader timestamp'_parser = (LL.read_nondep_then LL.jump_u32 LL.read_u32 LL.read_u32)

let timestamp_reader =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LL.read_synth _ synth_timestamp (fun x -> synth_timestamp x) timestamp'_reader ()

inline_for_extraction let timestamp'_lserializer : LL.serializer32 timestamp'_serializer = (LL.serialize32_u32 `LL.serialize32_nondep_then` LL.serialize32_u32)

let timestamp_lserializer =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LL.serialize32_synth timestamp'_lserializer synth_timestamp synth_timestamp_recip (fun x -> synth_timestamp_recip x) ()
/
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.Seq.fst.checked FStar.Pervasives.Native.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.Timestamp.fst
x: Zeta.Formats.Aux.Timestamp.timestamp
  -> FStar.Pervasives.Lemma (ensures Zeta.Formats.Aux.Timestamp.timestamp_bytesize x == 4 + 4)
      [SMTPat (Zeta.Formats.Aux.Timestamp.timestamp_bytesize x)]
Zeta.Formats.Aux.Timestamp.timestamp Prims._assert Prims.eq2 Prims.int Zeta.Formats.Aux.Timestamp.timestamp_bytesize Prims.op_Addition FStar.Seq.Base.length LowParse.Bytes.byte LowParse.Spec.Base.serialize LowParse.Spec.Int.parse_u32_kind FStar.UInt32.t LowParse.Spec.Int.parse_u32 LowParse.Spec.Int.serialize_u32 Zeta.Formats.Aux.Timestamp.__proj__Mktimestamp__item__epoch Zeta.Formats.Aux.Timestamp.__proj__Mktimestamp__item__counter Prims.unit LowParse.Spec.Combinators.length_serialize_nondep_then LowParse.Spec.Combinators.serialize_synth_eq LowParse.Spec.Combinators.and_then_kind Zeta.Formats.Aux.Timestamp.timestamp' Zeta.Formats.Aux.Timestamp.timestamp'_parser Zeta.Formats.Aux.Timestamp.synth_timestamp Zeta.Formats.Aux.Timestamp.timestamp'_serializer Zeta.Formats.Aux.Timestamp.synth_timestamp_recip FStar.Pervasives.assert_norm LowParse.Spec.Base.parser_kind Zeta.Formats.Aux.Timestamp.timestamp_parser_kind Zeta.Formats.Aux.Timestamp.timestamp'_parser_kind Zeta.Formats.Aux.Timestamp.synth_timestamp_inverse Zeta.Formats.Aux.Timestamp.synth_timestamp_injective
let timestamp_bytesize_eqn x =
  
[@@ inline_let ]let _ = synth_timestamp_injective () in
[@@ inline_let ]let _ = synth_timestamp_inverse () in
[@@ inline_let ]let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
LP.serialize_synth_eq _ synth_timestamp timestamp'_serializer synth_timestamp_recip () x;
LP.length_serialize_nondep_then LPI.serialize_u32 LPI.serialize_u32 x.epoch x.counter;
(assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.epoch)) == 4));
(assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.counter)) == 4));
assert (timestamp_bytesize x ==
    Seq.length (LP.serialize LPI.serialize_u32 x.epoch) +
    Seq.length (LP.serialize LPI.serialize_u32 x.counter))