val index (#a:Type0) (x:array a) (n:nat)
  : ST a
       (requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
       (ensures  (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
                              h0 == h1 /\
                              v == Seq.index (sel h0 x) n))
let index #a x n =
  let s = to_seq x in
  Seq.index s n
val index (#a:Type0) (x:array a) (n:nat)
  : ST a
       (requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
       (ensures  (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
                              h0 == h1 /\
                              v == Seq.index (sel h0 x) n))
let index #a x n =
let s = to_seq x in
Seq.index s n
FStar.Array.fst.checked
prims.fst.checked FStar.ST.fst.checked FStar.Seq.fst.checked FStar.Ref.fst.checked FStar.Pervasives.fsti.checked FStar.All.fst.checked
FStar.Array.fst
FStar.Array.array Prims.nat FStar.Seq.Base.index FStar.Seq.Base.seq FStar.Array.to_seq
(*
   Copyright 2008-2014 Nikhil Swamy and 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.
*)

(**
F* standard library mutable arrays module.

@summary Mutable arrays
*)
module FStar.Array
#set-options "--max_fuel 0 --initial_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.All
open FStar.Seq
open FStar.Ref

let array a = ref (seq a)

let as_ref #_ arr = arr

let op_At_Bar #a s1 s2 =
  let s1' = !s1 in
  let s2' = !s2 in
  ST.alloc (Seq.append s1' s2')

let of_seq #a s = ST.alloc s

let to_seq #a s = !s

let of_list #a l = of_seq (Seq.seq_of_list l)

let create #a n init = ST.alloc (Seq.create n init)
val index (#a:Type0) (x:array a) (n:nat)
  : ST a
       (requires (fun h -> contains h x /\ n < Seq.length (sel h x)))
       (ensures  (fun h0 v h1 -> n < Seq.length (sel h0 x) /\
                              h0 == h1 /\
                              v == Seq.index (sel h0 x) n))
x: FStar.Array.array a -> n: Prims.nat -> FStar.ST.ST a