val synth_ticketContents_cases
      (x: LP.enum_key ticketVersion_enum)
      (y: ticketContents_case_of_ticketVersion x)
    : LP.refine_with_tag key_of_ticketContents x
let synth_ticketContents_cases (x:LP.enum_key ticketVersion_enum) (y:ticketContents_case_of_ticketVersion x)
  : LP.refine_with_tag key_of_ticketContents x =
  match x with
  | Ticket12 -> ticketContents_refine x (T_ticket12 (to_ticketContents_case_of_ticketVersion Ticket12 y))
  | Ticket13 -> ticketContents_refine x (T_ticket13 (to_ticketContents_case_of_ticketVersion Ticket13 y))
val synth_ticketContents_cases
      (x: LP.enum_key ticketVersion_enum)
      (y: ticketContents_case_of_ticketVersion x)
    : LP.refine_with_tag key_of_ticketContents x
let synth_ticketContents_cases
      (x: LP.enum_key ticketVersion_enum)
      (y: ticketContents_case_of_ticketVersion x)
    : LP.refine_with_tag key_of_ticketContents x =
match x with
| Ticket12 ->
  ticketContents_refine x (T_ticket12 (to_ticketContents_case_of_ticketVersion Ticket12 y))
| Ticket13 ->
  ticketContents_refine x (T_ticket13 (to_ticketContents_case_of_ticketVersion Ticket13 y))
Parsers.TicketContents.fst.checked
prims.fst.checked Parsers.TicketVersion.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
Parsers.TicketContents.fst
LowParse.Spec.Enum.enum_key Parsers.TicketVersion.ticketVersion FStar.UInt8.t Parsers.TicketVersion.ticketVersion_enum Parsers.TicketContents.ticketContents_case_of_ticketVersion Parsers.TicketContents.ticketContents_refine Parsers.TicketContents.T_ticket12 Parsers.TicketContents.to_ticketContents_case_of_ticketVersion Parsers.TicketVersion.Ticket12 Parsers.TicketContents.T_ticket13 Parsers.TicketVersion.Ticket13 LowParse.Spec.Base.refine_with_tag Parsers.TicketContents.ticketContents Parsers.TicketContents.key_of_ticketContents
module Parsers.TicketContents

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

friend Parsers.TicketVersion

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

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

inline_for_extraction let key_of_ticketContents (x:ticketContents) : LP.enum_key ticketVersion_enum =
  match x with
  | T_ticket12 _ -> ticketVersion_as_enum_key Ticket12
  | T_ticket13 _ -> ticketVersion_as_enum_key Ticket13

inline_for_extraction let ticketContents_case_of_ticketVersion (x:ticketVersion) : Type0 =
  match x with
  | Ticket12 -> ticketContents12
  | Ticket13 -> ticketContents13

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

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

inline_for_extraction let synth_ticketContents_cases (x:LP.enum_key ticketVersion_enum) (y:ticketContents_case_of_ticketVersion x)
val synth_ticketContents_cases
      (x: LP.enum_key ticketVersion_enum)
      (y: ticketContents_case_of_ticketVersion x)
    : LP.refine_with_tag key_of_ticketContents x

    x: LowParse.Spec.Enum.enum_key Parsers.TicketVersion.ticketVersion_enum ->
    y: Parsers.TicketContents.ticketContents_case_of_ticketVersion x
  -> LowParse.Spec.Base.refine_with_tag Parsers.TicketContents.key_of_ticketContents x