Definition mapsto_ x : pred := fun m => forall n, if eq_nat_dec x n then m n <> None else m n = None.

(* Specifications: *)
Lemma mapsto_mapsto_ x n m : mapsto x n m -> mapsto_ x m.
Lemma precise_mapsto x n : precise (mapsto x n).
Lemma precise_mapsto_ x : precise (mapsto_ x).
Lemma precise_join R m1 m2 : precise R -> m1 |= R -> m2 |= R -> joins m1 m2 -> empty m1 /\ empty m2.
Record globals := mkglobals
{ resinvs : nat -> pred (* resource invariant for each lock *) ;
funspecs : string -> option pred (* precondition of each function *)
}.
Lemma mapsto_mapsto_ x n m : mapsto x n m -> mapsto_ x m.
Lemma precise_mapsto x n : precise (mapsto x n).
Lemma precise_mapsto_ x : precise (mapsto_ x).
Lemma precise_join R m1 m2 : precise R -> m1 |= R -> m2 |= R -> joins m1 m2 -> empty m1 /\ empty m2.
Definition selfjoins {A} (maps : A -> map) :=
forall i j, i <> j -> joins (maps i) (maps j).
Lemma mapsto_mapsto_ x n m : mapsto x n m -> mapsto_ x m.
Lemma precise_mapsto x n : precise (mapsto x n).
Lemma precise_mapsto_ x : precise (mapsto_ x).
Lemma precise_join R m1 m2 : precise R -> m1 |= R -> m2 |= R -> joins m1 m2 -> empty m1 /\ empty m2.
Record globals := mkglobals
{ resinvs : nat -> pred (* resource invariant for each lock *) ;
funspecs : string -> option pred (* precondition of each function *)
}.