val return_ens (a: Type) (x: a) (p: (a -> vprop)) : ens_t (p x) a p
let return_ens (a:Type) (x:a) (p:a -> vprop) : ens_t (p x) a p =
  fun (h0:rmem (p x)) (r:a) (h1:rmem (p r)) ->
    r == x /\ frame_equalities (p x) h0 (focus_rmem h1 (p x))
val return_ens (a: Type) (x: a) (p: (a -> vprop)) : ens_t (p x) a p
let return_ens (a: Type) (x: a) (p: (a -> vprop)) : ens_t (p x) a p =
fun (h0: rmem (p x)) (r: a) (h1: rmem (p r)) ->
  r == x /\ frame_equalities (p x) h0 (focus_rmem h1 (p x))
Steel.Effect.fsti.checked
Steel.Memory.fsti.checked Steel.Effect.Common.fsti.checked prims.fst.checked FStar.Tactics.fst.checked FStar.Set.fsti.checked FStar.Pervasives.fsti.checked FStar.Ghost.fsti.checked FStar.FunctionalExtensionality.fsti.checked
Steel.Effect.fsti
Steel.Effect.Common.vprop Steel.Effect.Common.rmem Prims.l_and Prims.eq2 Steel.Effect.Common.frame_equalities Steel.Effect.Common.focus_rmem Steel.Effect.Common.ens_t
(*
   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

open Steel.Memory
module Mem = Steel.Memory
module FExt = FStar.FunctionalExtensionality
open FStar.Ghost
module T = FStar.Tactics

include Steel.Effect.Common

/// This module defines the main Steel effect, with requires and ensures predicates operating on
/// selectors, which will be discharged by SMT

#set-options "--warn_error -330"  //turn off the experimental feature warning
#set-options "--ide_id_info_off"

(* Defining the Steel effect with selectors *)

/// The underlying representation of Steel computations.
/// The framed bit indicates whether this computation has already been framed. This corresponds to the |- and |-_F modalities
/// in the ICFP21 paper
val repr (a:Type) (framed:bool) (pre:pre_t) (post:post_t a) (req:req_t pre) (ens:ens_t pre a post) : Type u#2

/// Logical precondition of the return combinator
unfold
let return_req (p:vprop) : req_t p = fun _ -> True

/// Logical postcondition of the return combinator:
/// The returned value [r] corresponds to the value passed to the return [x],
/// and return leaves selectors of all resources in [p] unchanged
unfold
val return_ens (a: Type) (x: a) (p: (a -> vprop)) : ens_t (p x) a p
a: Type -> x: a -> p: (_: a -> Steel.Effect.Common.vprop) -> Steel.Effect.Common.ens_t (p x) a p