let half = half_perm full_perm
let half =
half_perm full_perm
Steel.LockCoupling.fsti.checked
Steel.ST.Util.fsti.checked Steel.ST.Reference.fsti.checked Steel.FractionalPermission.fst.checked prims.fst.checked FStar.Pervasives.fsti.checked
Steel.LockCoupling.fsti
Steel.FractionalPermission.half_perm Steel.FractionalPermission.full_perm
(*
   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.LockCoupling
open Steel.ST.Util
open Steel.ST.Reference
open Steel.FractionalPermission

(*
   This example sketches how an invariant for lock-coupling list
     (a list that stores a lock at each cell protecting its tail pointer)
   might work.

   It relies on strictly positive version of the exists and pts_to
   separation logic predicates, although the libraries are not
   currently annotated with such positivity annotations.=
*)

(* It is relatively easy to show that h_exists is strictly positive *)
val h_exists (#[@@@strictly_positive] a:Type)
             ([@@@strictly_positive] p:(a -> vprop))
   : vprop

(* the pts_to predicate is a bit more subtle. It is an instance
   of a more general form that involves assertions about a PCM,
   and it is possible to construct PCMs that are not strictly
   positive. However, the basic pts_to predicate that this refers to,
   for the fractional permission PCM, is strictly positive.
   Revising the library to enable decorating pts_to predicates derived
   from positive PCMs remains to be done. *)
val pts_to (#[@@@strictly_positive] a:Type)
           (r:ref a)
           (f:perm)
           (v:a) : vprop 

val lock ([@@@strictly_positive] p:vprop) : Type0
val half : Steel.FractionalPermission.perm
Steel.FractionalPermission.perm