val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
  : Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h)
let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
  : Lemma ((mk_rmem r h) r0 == sel_of r0 h)
  = FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
  : Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h)
let reveal_mk_rmem (r: vprop) (h: hmem r) (r0: vprop{r `can_be_split` r0})
    : Lemma ((mk_rmem r h) r0 == sel_of r0 h) =
FExt.feq_on_domain_g (unrestricted_mk_rmem r h)
Steel.Effect.Common.fst.checked
Steel.Semantics.Instantiate.fsti.checked Steel.Semantics.Hoare.MST.fst.checked Steel.Memory.fsti.checked prims.fst.checked FStar.PropositionalExtensionality.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.FunctionalExtensionality.fsti.checked FStar.Classical.fsti.checked
Steel.Effect.Common.fst
Steel.Effect.Common.vprop Steel.Effect.Common.hmem Steel.Effect.Common.can_be_split FStar.FunctionalExtensionality.feq_on_domain_g Steel.Effect.Common.t_of Steel.Effect.Common.unrestricted_mk_rmem Prims.unit Prims.l_True Prims.squash Prims.eq2 Steel.Effect.Common.normal Steel.Effect.Common.mk_rmem Steel.Effect.Common.sel_of Prims.Nil FStar.Pervasives.pattern
(*
   Copyright 2020 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 Steel.Effect.Common
module Sem = Steel.Semantics.Hoare.MST
module Mem = Steel.Memory
open Steel.Semantics.Instantiate
module FExt = FStar.FunctionalExtensionality

let h_exists #a f = VUnit ({hp = Mem.h_exists (fun x -> hp_of (f x)); t = unit; sel = fun _ -> ()})

let can_be_split (p q:vprop) : prop = Mem.slimp (hp_of p) (hp_of q)

let reveal_can_be_split () = ()

let can_be_split_interp r r' h = ()

let can_be_split_trans p q r = ()
let can_be_split_star_l p q = ()
let can_be_split_star_r p q = ()
let can_be_split_refl p = ()

let can_be_split_congr_l p q r =
  Classical.forall_intro (interp_star (hp_of p) (hp_of r));
  Classical.forall_intro (interp_star (hp_of q) (hp_of r))

let can_be_split_congr_r p q r =
  Classical.forall_intro (interp_star (hp_of r) (hp_of p));
  Classical.forall_intro (interp_star (hp_of r) (hp_of q))

let equiv (p q:vprop) : prop = Mem.equiv (hp_of p) (hp_of q) /\ True
let reveal_equiv p q = ()

let valid_rmem (#frame:vprop) (h:rmem' frame) : prop =
  forall (p p1 p2:vprop). can_be_split frame p /\ p == VStar p1 p2 ==>
     (h p1, h p2) == h (VStar p1 p2)

let lemma_valid_mk_rmem (r:vprop) (h:hmem r) = ()

let reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
val reveal_mk_rmem (r:vprop) (h:hmem r) (r0:vprop{r `can_be_split` r0})
  : Lemma (ensures reveal_can_be_split(); (mk_rmem r h) r0 == sel_of r0 h)

    r: Steel.Effect.Common.vprop ->
    h: Steel.Effect.Common.hmem r ->
    r0: Steel.Effect.Common.vprop{Steel.Effect.Common.can_be_split r r0}
  -> FStar.Pervasives.Lemma
    (ensures
      ([@@ FStar.Pervasives.inline_let ]let _ = Steel.Effect.Common.reveal_can_be_split () in
        Steel.Effect.Common.mk_rmem r h r0 == Steel.Effect.Common.sel_of r0 h))