val lemma_functoriality (#a:Type) (#rel:preorder a) (r:mref a rel) (p q:spred rel)
  : Lemma (requires (token r p /\ (forall x. p x ==> q x)))
    (ensures (token r q))
let lemma_functoriality #_ #_ r p q = lemma_functoriality (p_pred r p) (p_pred r q)
val lemma_functoriality (#a:Type) (#rel:preorder a) (r:mref a rel) (p q:spred rel)
  : Lemma (requires (token r p /\ (forall x. p x ==> q x)))
    (ensures (token r q))
let lemma_functoriality #_ #_ r p q =
lemma_functoriality (p_pred r p) (p_pred r q)
FStar.MRef.fst.checked
prims.fst.checked FStar.ST.fst.checked FStar.Preorder.fst.checked FStar.Pervasives.fsti.checked FStar.Heap.fst.checked
FStar.MRef.fst
FStar.Preorder.preorder FStar.ST.mref FStar.MRef.spred FStar.ST.lemma_functoriality FStar.MRef.p_pred Prims.unit
(*
   Copyright 2008-2018 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 FStar.MRef
open FStar.Heap
open FStar.ST

open FStar.Preorder

private let p_pred (#a:Type) (#b:preorder a) (r:mref a b) (p:(a -> Type))
  = fun h -> h `contains` r /\ p (sel h r)

let token #_ #_ r p = witnessed (p_pred r p)

let witness_token #_ #_ m p =
  gst_recall (contains_pred m);
  gst_witness (p_pred m p)

let recall_token #_ #_ m p = gst_recall (p_pred m p)
val lemma_functoriality (#a:Type) (#rel:preorder a) (r:mref a rel) (p q:spred rel)
  : Lemma (requires (token r p /\ (forall x. p x ==> q x)))
    (ensures (token r q))
r: FStar.ST.mref a rel -> p: FStar.MRef.spred rel -> q: FStar.MRef.spred rel
  -> FStar.Pervasives.Lemma (requires FStar.MRef.token r p /\ (forall (x: a). p x ==> q x))
      (ensures FStar.MRef.token r q)