val ptrp_sel (#a:Type0) (r:ref a) (p: perm) : selector a (ptrp r p)
val ptrp_sel (#a:Type0) (r:ref a) (p: perm) : selector a (ptrp r p)
let ptrp_sel r p = sel_of (vptr0 r p)
module Steel.ArrayRef

module A = Steel.Array

let null #a = A.null #a

let is_null r = A.is_null r

let vptr0_refine
  (#a: Type0)
  (r: ref a)
  (s: Seq.lseq a (A.length r))
: Tot prop
= Seq.length s == 1

let vptr0_rewrite
  (#a: Type)
  (r: ref a)
  (p: perm)
  (s: normal (vrefine_t (A.varrayp r p) (vptr0_refine r)))
: Tot a
= Seq.index s 0

[@@__steel_reduce__; __reduce__]
let vptr1
  (#a: Type0)
  (r: ref a)
  (p: perm)
: Tot vprop
= A.varrayp r p `vrefine`
  vptr0_refine r `vrewrite`
  vptr0_rewrite r p

[@@__steel_reduce__]
let vptr0
  (#a: Type0)
  (r: ref a)
  (p: perm)
: Tot vprop
= vptr1 r p

let intro_vptr0
  (#opened: _)
  (#a: Type0)
  (r: ref a)
  (p: perm)
: SteelGhost unit opened
    (A.varrayp r p)
    (fun _ -> vptr0 r p)
    (fun _ -> True)
    (fun h _ h' ->
      let s = A.aselp r p h in
      Seq.length s == 1 /\
      h' (vptr0 r p) == Seq.index s 0
    )
= A.varrayp_not_null r p;
  intro_vrefine (A.varrayp r p) (vptr0_refine r);
  intro_vrewrite (A.varrayp r p `vrefine` vptr0_refine r) (vptr0_rewrite r p);
  change_equal_slprop (vptr1 r p) (vptr0 r p)

let elim_vptr0
  (#opened: _)
  (#a: Type0)
  (r: ref a)
  (p: perm)
: SteelGhost unit opened
    (vptr0 r p)
    (fun _ -> A.varrayp r p)
    (fun _ -> True)
    (fun h _ h' ->
      A.aselp r p h' `Seq.equal` Seq.create 1 (h (vptr0 r p))
    )
=
  change_equal_slprop (vptr0 r p) (vptr1 r p);
  elim_vrewrite (A.varrayp r p `vrefine` vptr0_refine r) (vptr0_rewrite r p);
  elim_vrefine (A.varrayp r p) (vptr0_refine r)

let ptrp r p = hp_of (vptr0 r p)
/
Steel.Array.fsti.checked prims.fst.checked FStar.SizeT.fsti.checked FStar.Seq.fst.checked FStar.Pervasives.fsti.checked
Steel.ArrayRef.fst
r: Steel.ArrayRef.ref a -> p: Steel.FractionalPermission.perm
  -> Steel.Effect.Common.selector a (Steel.ArrayRef.ptrp r p)
Steel.ArrayRef.ref Steel.FractionalPermission.perm Steel.Effect.Common.sel_of Steel.ArrayRef.vptr0 Steel.Effect.Common.selector Steel.ArrayRef.ptrp
let ptrp_sel r p =
  
sel_of (vptr0 r p)