val alert'_lserializer:LL.serializer32 alert'_serializer
val alert'_lserializer:LL.serializer32 alert'_serializer
let alert'_lserializer : LL.serializer32 alert'_serializer = (alertLevel_lserializer `LL.serialize32_nondep_then` alertDescription_lserializer)
module MiTLS.Parsers.Alert

(* 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 LS = LowParse.SLow
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 alert' = (alertLevel & alertDescription)

inline_for_extraction let synth_alert (x: alert') : alert =
  match x with (level,description) -> {
    level = level;
    description = description;
  }

inline_for_extraction let synth_alert_recip (x: alert) : alert' = (x.level,x.description)

let synth_alert_recip_inverse () : Lemma (LP.synth_inverse synth_alert_recip synth_alert) = ()

let synth_alert_injective () : Lemma (LP.synth_injective synth_alert) =
  LP.synth_inverse_synth_injective synth_alert_recip synth_alert;
  synth_alert_recip_inverse ()

let synth_alert_inverse () : Lemma (LP.synth_inverse synth_alert synth_alert_recip) =
  assert_norm (LP.synth_inverse synth_alert synth_alert_recip)

let synth_alert_recip_injective () : Lemma (LP.synth_injective synth_alert_recip) =
  synth_alert_recip_inverse ();
  LP.synth_inverse_synth_injective synth_alert synth_alert_recip

noextract let alert'_parser : LP.parser _ alert' = (alertLevel_parser `LP.nondep_then` alertDescription_parser)

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

let alert_parser =
  synth_alert_injective ();
  assert_norm (alert_parser_kind == alert'_parser_kind);
  alert'_parser `LP.parse_synth` synth_alert

noextract let alert'_serializer : LP.serializer alert'_parser = (alertLevel_serializer `LP.serialize_nondep_then` alertDescription_serializer)

let alert_serializer =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = synth_alert_inverse () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LP.serialize_synth _ synth_alert alert'_serializer synth_alert_recip ()

let alert_bytesize (x:alert) : GTot nat = Seq.length (alert_serializer x)

let alert_bytesize_eq x = ()

inline_for_extraction let alert'_parser32 : LS.parser32 alert'_parser = (alertLevel_parser32 `LS.parse32_nondep_then` alertDescription_parser32)

let alert_parser32 =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LS.parse32_synth _ synth_alert (fun x -> synth_alert x) alert'_parser32 ()

inline_for_extraction let alert'_serializer32 : LS.serializer32 alert'_serializer = (alertLevel_serializer32 `LS.serialize32_nondep_then` alertDescription_serializer32)

let alert_serializer32 =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = synth_alert_inverse () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LS.serialize32_synth _ synth_alert _ alert'_serializer32 synth_alert_recip (fun x -> synth_alert_recip x) ()

inline_for_extraction let alert'_size32 : LSZ.size32 alert'_serializer = (alertLevel_size32 `LSZ.size32_nondep_then` alertDescription_size32)

let alert_size32 =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = synth_alert_inverse () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LSZ.size32_synth _ synth_alert _ alert'_size32 synth_alert_recip (fun x -> synth_alert_recip x) ()

inline_for_extraction let alert'_validator : LL.validator alert'_parser = (alertLevel_validator `LL.validate_nondep_then` alertDescription_validator)

let alert_validator =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LL.validate_synth alert'_validator synth_alert ()

inline_for_extraction let alert'_reader : LL.leaf_reader alert'_parser = (LL.read_nondep_then alertLevel_jumper alertLevel_reader alertDescription_reader)

let alert_reader =
  [@inline_let] let _ = synth_alert_injective () in
  [@inline_let] let _ = assert_norm (alert_parser_kind == alert'_parser_kind) in
  LL.read_synth _ synth_alert (fun x -> synth_alert x) alert'_reader ()
/
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
MiTLS.Parsers.Alert.fst
LowParse.Low.Base.serializer32 MiTLS.Parsers.Alert.alert'_serializer
LowParse.Low.Combinators.serialize32_nondep_then MiTLS.Parsers.AlertLevel.alertLevel_parser_kind MiTLS.Parsers.AlertLevel.alertLevel MiTLS.Parsers.AlertLevel.alertLevel_parser MiTLS.Parsers.AlertLevel.alertLevel_serializer MiTLS.Parsers.AlertLevel.alertLevel_lserializer MiTLS.Parsers.AlertDescription.alertDescription_parser_kind MiTLS.Parsers.AlertDescription.alertDescription MiTLS.Parsers.AlertDescription.alertDescription_parser MiTLS.Parsers.AlertDescription.alertDescription_serializer MiTLS.Parsers.AlertDescription.alertDescription_lserializer
let alert'_lserializer:LL.serializer32 alert'_serializer =
  
(alertLevel_lserializer `LL.serialize32_nondep_then` alertDescription_lserializer)