val enum_key (#key #repr: eqtype) (e: enum key repr) : Tot eqtype
let enum_key (#key #repr: eqtype) (e: enum key repr) : Tot eqtype = (s: key { list_mem s (list_map fst e) } )
val enum_key (#key #repr: eqtype) (e: enum key repr) : Tot eqtype
let enum_key (#key #repr: eqtype) (e: enum key repr) : Tot eqtype =
(s: key{list_mem s (list_map fst e)})
LowParse.Spec.Enum.fst.checked
prims.fst.checked LowParse.Spec.Combinators.fsti.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.Classical.fsti.checked
LowParse.Spec.Enum.fst
Prims.eqtype LowParse.Spec.Enum.enum Prims.b2t LowParse.Spec.Enum.list_mem LowParse.Spec.Enum.list_map FStar.Pervasives.Native.tuple2 FStar.Pervasives.Native.fst
module LowParse.Spec.Enum
include LowParse.Spec.Combinators

module L = FStar.List.Tot

[@Norm]
let rec list_map
  (#a #b: Type)
  (f: (a -> Tot b))
  (l: list a)
: Tot (l' : list b { l' == L.map f l } )
= match l with
  | [] -> []
  | a :: q -> f a :: list_map f q

type enum (key: eqtype) (repr: eqtype) = (l: list (key * repr) {
  L.noRepeats (list_map fst l) /\
  L.noRepeats (list_map snd l)
})

[@Norm]
let rec list_mem
  (#t: eqtype)
  (x: t)
  (l: list t)
: Tot (y: bool { y == true <==> L.mem x l == true } )
= match l with
  | [] -> false
  | a :: q -> (x = a || list_mem x q)
val enum_key (#key #repr: eqtype) (e: enum key repr) : Tot eqtype
e: LowParse.Spec.Enum.enum key repr -> Prims.eqtype