val initial_senv (_:unit) : ML size_env
let initial_senv () =
  let i = [
       ("unit",     (Fixed 0,  None));
       ("Bool",     (Fixed 1,  Some 1));
       ("UINT8",    (Fixed 1,  Some 1));
       ("UINT16",   (Fixed 2,  Some 2));
       ("UINT32",   (Fixed 4,  Some 4));
       ("UINT64",   (Fixed 8,  Some 8));
       ("UINT8BE",   (Fixed 1,  Some 1));
       ("UINT16BE",   (Fixed 2,  Some 2));
       ("UINT32BE",   (Fixed 4,  Some 4));
       ("UINT64BE",   (Fixed 8,  Some 8));
       ("field_id", (Fixed 4,  Some 4));
       ("all_bytes", (Variable, None));
       ("all_zeros", (Variable, None));
       ("PUINT8",   (Variable, pointer_alignment))
  ]
  in
  let senv = H.create 17 in
  List.iter (fun (i, k) -> H.insert senv (to_ident' i) k) i;
  senv
val initial_senv (_:unit) : ML size_env
let initial_senv () =
let i =
  [
    ("unit", (Fixed 0, None)); ("Bool", (Fixed 1, Some 1)); ("UINT8", (Fixed 1, Some 1));
    ("UINT16", (Fixed 2, Some 2)); ("UINT32", (Fixed 4, Some 4)); ("UINT64", (Fixed 8, Some 8));
    ("UINT8BE", (Fixed 1, Some 1)); ("UINT16BE", (Fixed 2, Some 2)); ("UINT32BE", (Fixed 4, Some 4));
    ("UINT64BE", (Fixed 8, Some 8)); ("field_id", (Fixed 4, Some 4));
    ("all_bytes", (Variable, None)); ("all_zeros", (Variable, None));
    ("PUINT8", (Variable, pointer_alignment))
  ]
in
let senv = H.create 17 in
List.iter (fun (i, k) -> H.insert senv (to_ident' i) k) i;
senv
TypeSizes.fst.checked
prims.fst.checked Options.fsti.checked Hashtable.fsti.checked FStar.Printf.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.Mul.fst.checked FStar.Math.Lib.fst.checked FStar.List.Tot.Base.fst.checked FStar.List.Tot.fst.checked FStar.List.fst.checked FStar.IO.fst.checked FStar.All.fst.checked Binding.fsti.checked Ast.fst.checked
TypeSizes.fst
Prims.unit TypeSizes.size_env FStar.List.iter FStar.Pervasives.Native.tuple2 Prims.string TypeSizes.size TypeSizes.alignment Hashtable.insert Ast.ident' Ast.to_ident' Hashtable.t Hashtable.create Prims.list Prims.Cons FStar.Pervasives.Native.Mktuple2 TypeSizes.Fixed FStar.Pervasives.Native.None Prims.int Prims.l_or Prims.eq2 FStar.Pervasives.Native.Some TypeSizes.Variable TypeSizes.pointer_alignment Prims.Nil
(*
   Copyright 2019 Microsoft Research

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain as copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)
module TypeSizes
open FStar.All
open Ast
open FStar.Mul
module H = Hashtable
module B = Binding

let product_size (base:size) (n:int) =
  match base with
  | Variable
  | WithVariableSuffix _ ->
    Variable
  | Fixed k ->
    Fixed (k * n)

let typename = ident'

let alignment = option (x:int{x == 1 \/ x == 2 \/ x == 4 \/ x == 8})

type size_env = H.t typename (size & alignment)

//TODO: size of pointer is platform-dependent
let pointer_alignment : alignment = Some 8
val initial_senv (_:unit) : ML size_env
_: Prims.unit -> FStar.All.ML TypeSizes.size_env