val fill_buffer_init
  (#t: typ)
  (b: buffer t) (* destination *)
  (v: type_of_typ t)
  (h: HS.mem)
: Lemma
  (requires (fill_buffer_precond' b h))
  (ensures (fill_buffer_inv b 0ul v h h))
let fill_buffer_init #t b v h =
  buffer_readable_intro_empty h (gsub_buffer b 0ul 0ul);
  Seq.lemma_eq_intro (buffer_as_seq h (gsub_buffer b 0ul 0ul)) (Seq.create 0 v)
val fill_buffer_init
  (#t: typ)
  (b: buffer t) (* destination *)
  (v: type_of_typ t)
  (h: HS.mem)
: Lemma
  (requires (fill_buffer_precond' b h))
  (ensures (fill_buffer_inv b 0ul v h h))
let fill_buffer_init #t b v h =
buffer_readable_intro_empty h (gsub_buffer b 0ul 0ul);
Seq.lemma_eq_intro (buffer_as_seq h (gsub_buffer b 0ul 0ul)) (Seq.create 0 v)
FStar.Pointer.Derived3.fst.checked
prims.fst.checked FStar.UInt32.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Ghost.fsti.checked
FStar.Pointer.Derived3.fst
FStar.Pointer.Base.typ FStar.Pointer.Base.buffer FStar.Pointer.Base.type_of_typ FStar.Monotonic.HyperStack.mem FStar.Seq.Base.lemma_eq_intro FStar.Pointer.Base.buffer_as_seq FStar.Pointer.Base.gsub_buffer FStar.UInt32.__uint_to_t FStar.Seq.Base.create Prims.unit FStar.Pointer.Derived1.buffer_readable_intro_empty
(*
   Copyright 2008-2018 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 a 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 FStar.Pointer.Derived3

module HH = FStar.HyperStack
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

private
let fill_buffer_precond'
  (#t: typ)
  (b: buffer t) (* destination *)
  (h: HS.mem)
: GTot Type0
= buffer_live h b

private
let fill_buffer_postcond'
  (#t: typ)
  (b: buffer t) (* destination *)
  (v: type_of_typ t)
  (h: HS.mem)
  (h' : HS.mem)
: GTot Type0
= fill_buffer_precond' b h /\
  modifies (loc_buffer b) h h' /\
  buffer_readable h' b /\
  buffer_as_seq h' b == Seq.create (UInt32.v (buffer_length b)) v

private
let fill_buffer_inv
  (#t: typ)
  (b: buffer t) (* destination *)
  (len' : UInt32.t)
  (v: type_of_typ t)
  (h: HS.mem)
  (h' : HS.mem)
: GTot Type0
= fill_buffer_precond' b h /\
  modifies (loc_buffer b) h h' /\
  UInt32.v len' <= UInt32.v (buffer_length b) /\
  buffer_readable h' (gsub_buffer b 0ul len') /\
  buffer_as_seq h' (gsub_buffer b 0ul len') == Seq.create (UInt32.v len') v

private
val fill_buffer_init
  (#t: typ)
  (b: buffer t) (* destination *)
  (v: type_of_typ t)
  (h: HS.mem)
: Lemma
  (requires (fill_buffer_precond' b h))
  (ensures (fill_buffer_inv b 0ul v h h))
val fill_buffer_init
  (#t: typ)
  (b: buffer t) (* destination *)
  (v: type_of_typ t)
  (h: HS.mem)
: Lemma
  (requires (fill_buffer_precond' b h))
  (ensures (fill_buffer_inv b 0ul v h h))

    b: FStar.Pointer.Base.buffer t ->
    v: FStar.Pointer.Base.type_of_typ t ->
    h: FStar.Monotonic.HyperStack.mem
  -> FStar.Pervasives.Lemma (requires FStar.Pointer.Derived3.fill_buffer_precond' b h)
      (ensures FStar.Pointer.Derived3.fill_buffer_inv b 0ul v h h)