val init_aux' (#a: Type) (len: nat) (k: nat{k < len}) (contents: (i: nat{i < len} -> Tot a))
    : Tot (seq a) (decreases (len - k))
let rec init_aux' (#a:Type) (len:nat) (k:nat{k < len}) (contents: (i:nat{i < len} -> Tot a))
    : Tot (seq a)
      (decreases (len - k))
  = if k + 1 = len
    then MkSeq [contents k]
    else cons (contents k) (init_aux' len (k+1) contents)
val init_aux' (#a: Type) (len: nat) (k: nat{k < len}) (contents: (i: nat{i < len} -> Tot a))
    : Tot (seq a) (decreases (len - k))
let rec init_aux' (#a: Type) (len: nat) (k: nat{k < len}) (contents: (i: nat{i < len} -> Tot a))
    : Tot (seq a) (decreases (len - k)) =
if k + 1 = len then MkSeq [contents k] else cons (contents k) (init_aux' len (k + 1) contents)
FStar.Seq.Base.fst.checked
prims.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked
FStar.Seq.Base.fst
Prims.nat Prims.b2t Prims.op_LessThan Prims.op_Equality Prims.int Prims.op_Addition FStar.Seq.Base.MkSeq Prims.Cons Prims.Nil Prims.bool FStar.Seq.Base.cons FStar.Seq.Base.init_aux' FStar.Seq.Base.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.
*)

(* A logical theory of sequences indexed by natural numbers in [0, n) *)
module FStar.Seq.Base
//#set-options "--initial_fuel 0 --max_fuel 0 --initial_ifuel 1 --max_ifuel 1"

module List = FStar.List.Tot

type seq (a:Type u#a) :Type u#a =
  | MkSeq: l:list a -> seq a

let length #_ s = List.length (MkSeq?.l s)

let index #_ s i = List.index (MkSeq?.l s) i

let cons (#a:Type) (x:a) (s:seq a) : Tot (seq a) = MkSeq (x::(MkSeq?.l s))

let hd (#a:Type) (s:seq a{length s > 0}) : Tot a = List.hd (MkSeq?.l s)

let tl (#a:Type) (s:seq a{length s > 0}) : Tot (seq a) = MkSeq (List.tl (MkSeq?.l s))

let rec create #_ len v = if len = 0 then MkSeq [] else cons v (create (len - 1) v)

private let rec init_aux' (#a:Type) (len:nat) (k:nat{k < len}) (contents: (i:nat{i < len} -> Tot a))
    : Tot (seq a)
val init_aux' (#a: Type) (len: nat) (k: nat{k < len}) (contents: (i: nat{i < len} -> Tot a))
    : Tot (seq a) (decreases (len - k))
len: Prims.nat -> k: Prims.nat{k < len} -> contents: (i: Prims.nat{i < len} -> a)
  -> Prims.Tot (FStar.Seq.Base.seq a)