Commit 732b3d49 authored by Ralf Jung's avatar Ralf Jung
Browse files

rename CMRA identity -> CMRA unit

parent c2c84732
...@@ -156,12 +156,12 @@ Proof. uPred.unseal. by destruct x as [[]]. Qed. ...@@ -156,12 +156,12 @@ Proof. uPred.unseal. by destruct x as [[]]. Qed.
(** The notations ◯ and ● only work for CMRAs with an empty element. So, in (** The notations ◯ and ● only work for CMRAs with an empty element. So, in
what follows, we assume we have an empty element. *) what follows, we assume we have an empty element. *)
Context `{Empty A, !CMRAIdentity A}. Context `{Empty A, !CMRAUnit A}.
Global Instance auth_cmra_identity : CMRAIdentity authR. Global Instance auth_cmra_unit : CMRAUnit authR.
Proof. Proof.
split; simpl. split; simpl.
- by apply (@cmra_empty_valid A _). - by apply (@cmra_unit_valid A _).
- by intros x; constructor; rewrite /= left_id. - by intros x; constructor; rewrite /= left_id.
- apply _. - apply _.
Qed. Qed.
......
...@@ -124,15 +124,15 @@ Section cmra_mixin. ...@@ -124,15 +124,15 @@ Section cmra_mixin.
Proof. apply (mixin_cmra_extend _ (cmra_mixin A)). Qed. Proof. apply (mixin_cmra_extend _ (cmra_mixin A)). Qed.
End cmra_mixin. End cmra_mixin.
(** * CMRAs with a global identity element *) (** * CMRAs with a unit element *)
(** We use the notation ∅ because for most instances (maps, sets, etc) the (** We use the notation ∅ because for most instances (maps, sets, etc) the
`empty' element is the global identity. *) `empty' element is the unit. *)
Class CMRAIdentity (A : cmraT) `{Empty A} := { Class CMRAUnit (A : cmraT) `{Empty A} := {
cmra_empty_valid : ; cmra_unit_valid : ;
cmra_empty_left_id :> LeftId () (); cmra_unit_left_id :> LeftId () ();
cmra_empty_timeless :> Timeless cmra_unit_timeless :> Timeless
}. }.
Instance cmra_identity_inhabited `{CMRAIdentity A} : Inhabited A := populate . Instance cmra_unit_inhabited `{CMRAUnit A} : Inhabited A := populate .
(** * Discrete CMRAs *) (** * Discrete CMRAs *)
Class CMRADiscrete (A : cmraT) := { Class CMRADiscrete (A : cmraT) := {
...@@ -347,20 +347,20 @@ Lemma cmra_discrete_update `{CMRADiscrete A} (x y : A) : ...@@ -347,20 +347,20 @@ Lemma cmra_discrete_update `{CMRADiscrete A} (x y : A) :
( z, (x z) (y z)) x ~~> y. ( z, (x z) (y z)) x ~~> y.
Proof. intros ? n. by setoid_rewrite <-cmra_discrete_valid_iff. Qed. Proof. intros ? n. by setoid_rewrite <-cmra_discrete_valid_iff. Qed.
(** ** RAs with an empty element *) (** ** RAs with a unit element *)
Section identity. Section unit.
Context `{Empty A, !CMRAIdentity A}. Context `{Empty A, !CMRAUnit A}.
Lemma cmra_empty_validN n : {n} . Lemma cmra_unit_validN n : {n} .
Proof. apply cmra_valid_validN, cmra_empty_valid. Qed. Proof. apply cmra_valid_validN, cmra_unit_valid. Qed.
Lemma cmra_empty_leastN n x : {n} x. Lemma cmra_unit_leastN n x : {n} x.
Proof. by exists x; rewrite left_id. Qed. Proof. by exists x; rewrite left_id. Qed.
Lemma cmra_empty_least x : x. Lemma cmra_unit_least x : x.
Proof. by exists x; rewrite left_id. Qed. Proof. by exists x; rewrite left_id. Qed.
Global Instance cmra_empty_right_id : RightId () (). Global Instance cmra_unit_right_id : RightId () ().
Proof. by intros x; rewrite (comm op) left_id. Qed. Proof. by intros x; rewrite (comm op) left_id. Qed.
Lemma cmra_core_empty : core . Lemma cmra_core_unit : core .
Proof. by rewrite -{2}(cmra_core_l ) right_id. Qed. Proof. by rewrite -{2}(cmra_core_l ) right_id. Qed.
End identity. End unit.
(** ** Local updates *) (** ** Local updates *)
Global Instance local_update_proper Lv (L : A A) : Global Instance local_update_proper Lv (L : A A) :
...@@ -422,13 +422,13 @@ Qed. ...@@ -422,13 +422,13 @@ Qed.
Lemma cmra_update_id x : x ~~> x. Lemma cmra_update_id x : x ~~> x.
Proof. intro. auto. Qed. Proof. intro. auto. Qed.
Section identity_updates. Section unit_updates.
Context `{Empty A, !CMRAIdentity A}. Context `{Empty A, !CMRAUnit A}.
Lemma cmra_update_empty x : x ~~> . Lemma cmra_update_unit x : x ~~> .
Proof. intros n z; rewrite left_id; apply cmra_validN_op_r. Qed. Proof. intros n z; rewrite left_id; apply cmra_validN_op_r. Qed.
Lemma cmra_update_empty_alt y : ~~> y x, x ~~> y. Lemma cmra_update_unit_alt y : ~~> y x, x ~~> y.
Proof. split; [intros; trans |]; auto using cmra_update_empty. Qed. Proof. split; [intros; trans |]; auto using cmra_update_unit. Qed.
End identity_updates. End unit_updates.
End cmra. End cmra.
(** * Properties about monotone functions *) (** * Properties about monotone functions *)
...@@ -531,7 +531,7 @@ Section unit. ...@@ -531,7 +531,7 @@ Section unit.
Proof. by split. Qed. Proof. by split. Qed.
Canonical Structure unitR : cmraT := Canonical Structure unitR : cmraT :=
Eval cbv [unitC discreteR cofe_car] in discreteR unit_ra. Eval cbv [unitC discreteR cofe_car] in discreteR unit_ra.
Global Instance unit_cmra_identity : CMRAIdentity unitR. Global Instance unit_cmra_unit : CMRAUnit unitR.
Global Instance unit_cmra_discrete : CMRADiscrete unitR. Global Instance unit_cmra_discrete : CMRADiscrete unitR.
Proof. by apply discrete_cmra_discrete. Qed. Proof. by apply discrete_cmra_discrete. Qed.
End unit. End unit.
...@@ -582,11 +582,11 @@ Section prod. ...@@ -582,11 +582,11 @@ Section prod.
by exists ((z1.1,z2.1),(z1.2,z2.2)). by exists ((z1.1,z2.1),(z1.2,z2.2)).
Qed. Qed.
Canonical Structure prodR : cmraT := CMRAT prod_cofe_mixin prod_cmra_mixin. Canonical Structure prodR : cmraT := CMRAT prod_cofe_mixin prod_cmra_mixin.
Global Instance prod_cmra_identity `{Empty A, Empty B} : Global Instance prod_cmra_unit `{Empty A, Empty B} :
CMRAIdentity A CMRAIdentity B CMRAIdentity prodR. CMRAUnit A CMRAUnit B CMRAUnit prodR.
Proof. Proof.
split. split.
- split; apply cmra_empty_valid. - split; apply cmra_unit_valid.
- by split; rewrite /=left_id. - by split; rewrite /=left_id.
- by intros ? [??]; split; apply (timeless _). - by intros ? [??]; split; apply (timeless _).
Qed. Qed.
......
...@@ -11,7 +11,7 @@ Instance: Params (@big_opM) 5. ...@@ -11,7 +11,7 @@ Instance: Params (@big_opM) 5.
(** * Properties about big ops *) (** * Properties about big ops *)
Section big_op. Section big_op.
Context `{CMRAIdentity A}. Context `{CMRAUnit A}.
(** * Big ops *) (** * Big ops *)
Lemma big_op_nil : big_op (@nil A) = . Lemma big_op_nil : big_op (@nil A) = .
......
...@@ -3,7 +3,7 @@ From algebra Require Import cmra_big_op. ...@@ -3,7 +3,7 @@ From algebra Require Import cmra_big_op.
(** * Simple solver for validity and inclusion by reflection *) (** * Simple solver for validity and inclusion by reflection *)
Module ra_reflection. Section ra_reflection. Module ra_reflection. Section ra_reflection.
Context `{CMRAIdentity A}. Context `{CMRAUnit A}.
Inductive expr := Inductive expr :=
| EVar : nat expr | EVar : nat expr
......
...@@ -128,7 +128,7 @@ Proof. ...@@ -128,7 +128,7 @@ Proof.
end; destruct y1, y2; inversion_clear Hx; repeat constructor. end; destruct y1, y2; inversion_clear Hx; repeat constructor.
Qed. Qed.
Canonical Structure exclR : cmraT := CMRAT excl_cofe_mixin excl_cmra_mixin. Canonical Structure exclR : cmraT := CMRAT excl_cofe_mixin excl_cmra_mixin.
Global Instance excl_cmra_identity : CMRAIdentity exclR. Global Instance excl_cmra_unit : CMRAUnit exclR.
Proof. split. done. by intros []. apply _. Qed. Proof. split. done. by intros []. apply _. Qed.
Global Instance excl_cmra_discrete : Discrete A CMRADiscrete exclR. Global Instance excl_cmra_discrete : Discrete A CMRADiscrete exclR.
Proof. split. apply _. by intros []. Qed. Proof. split. apply _. by intros []. Qed.
......
...@@ -159,7 +159,7 @@ Proof. ...@@ -159,7 +159,7 @@ Proof.
by symmetry; apply option_op_positive_dist_r with (m1 !! i). by symmetry; apply option_op_positive_dist_r with (m1 !! i).
Qed. Qed.
Canonical Structure mapR : cmraT := CMRAT map_cofe_mixin map_cmra_mixin. Canonical Structure mapR : cmraT := CMRAT map_cofe_mixin map_cmra_mixin.
Global Instance map_cmra_identity : CMRAIdentity mapR. Global Instance map_cmra_unit : CMRAUnit mapR.
Proof. Proof.
split. split.
- by intros i; rewrite lookup_empty. - by intros i; rewrite lookup_empty.
...@@ -194,7 +194,7 @@ Lemma map_insert_valid m i x : ✓ x → ✓ m → ✓ <[i:=x]>m. ...@@ -194,7 +194,7 @@ Lemma map_insert_valid m i x : ✓ x → ✓ m → ✓ <[i:=x]>m.
Proof. by intros ?? j; destruct (decide (i = j)); simplify_map_eq. Qed. Proof. by intros ?? j; destruct (decide (i = j)); simplify_map_eq. Qed.
Lemma map_singleton_validN n i x : {n} ({[ i := x ]} : gmap K A) {n} x. Lemma map_singleton_validN n i x : {n} ({[ i := x ]} : gmap K A) {n} x.
Proof. Proof.
split; [|by intros; apply map_insert_validN, cmra_empty_validN]. split; [|by intros; apply map_insert_validN, cmra_unit_validN].
by move=>/(_ i); simplify_map_eq. by move=>/(_ i); simplify_map_eq.
Qed. Qed.
Lemma map_singleton_valid i x : ({[ i := x ]} : gmap K A) x. Lemma map_singleton_valid i x : ({[ i := x ]} : gmap K A) x.
...@@ -232,7 +232,7 @@ Proof. ...@@ -232,7 +232,7 @@ Proof.
- intros (y&Hi&?); rewrite map_includedN_spec=>j. - intros (y&Hi&?); rewrite map_includedN_spec=>j.
destruct (decide (i = j)); simplify_map_eq. destruct (decide (i = j)); simplify_map_eq.
+ rewrite Hi. by apply (includedN_preserving _), cmra_included_includedN. + rewrite Hi. by apply (includedN_preserving _), cmra_included_includedN.
+ apply: cmra_empty_leastN. + apply: cmra_unit_leastN.
Qed. Qed.
Lemma map_dom_op m1 m2 : dom (gset K) (m1 m2) dom _ m1 dom _ m2. Lemma map_dom_op m1 m2 : dom (gset K) (m1 m2) dom _ m1 dom _ m2.
Proof. Proof.
...@@ -268,14 +268,14 @@ Proof. apply map_insert_updateP'. Qed. ...@@ -268,14 +268,14 @@ Proof. apply map_insert_updateP'. Qed.
Lemma map_singleton_update i (x y : A) : x ~~> y {[ i := x ]} ~~> {[ i := y ]}. Lemma map_singleton_update i (x y : A) : x ~~> y {[ i := x ]} ~~> {[ i := y ]}.
Proof. apply map_insert_update. Qed. Proof. apply map_insert_update. Qed.
Lemma map_singleton_updateP_empty `{Empty A, !CMRAIdentity A} Lemma map_singleton_updateP_empty `{Empty A, !CMRAUnit A}
(P : A Prop) (Q : gmap K A Prop) i : (P : A Prop) (Q : gmap K A Prop) i :
~~>: P ( y, P y Q {[ i := y ]}) ~~>: Q. ~~>: P ( y, P y Q {[ i := y ]}) ~~>: Q.
Proof. Proof.
intros Hx HQ n gf Hg. intros Hx HQ n gf Hg.
destruct (Hx n (from_option (gf !! i))) as (y&?&Hy). destruct (Hx n (from_option (gf !! i))) as (y&?&Hy).
{ move:(Hg i). rewrite !left_id. { move:(Hg i). rewrite !left_id.
case _: (gf !! i); simpl; auto using cmra_empty_validN. } case _: (gf !! i); simpl; auto using cmra_unit_validN. }
exists {[ i := y ]}; split; first by auto. exists {[ i := y ]}; split; first by auto.
intros i'; destruct (decide (i' = i)) as [->|]. intros i'; destruct (decide (i' = i)) as [->|].
- rewrite lookup_op lookup_singleton. - rewrite lookup_op lookup_singleton.
...@@ -283,7 +283,7 @@ Proof. ...@@ -283,7 +283,7 @@ Proof.
by rewrite right_id. by rewrite right_id.
- move:(Hg i'). by rewrite !lookup_op lookup_singleton_ne // !left_id. - move:(Hg i'). by rewrite !lookup_op lookup_singleton_ne // !left_id.
Qed. Qed.
Lemma map_singleton_updateP_empty' `{Empty A, !CMRAIdentity A} (P: A Prop) i : Lemma map_singleton_updateP_empty' `{Empty A, !CMRAUnit A} (P: A Prop) i :
~~>: P ~~>: λ m, y, m = {[ i := y ]} P y. ~~>: P ~~>: λ m, y, m = {[ i := y ]} P y.
Proof. eauto using map_singleton_updateP_empty. Qed. Proof. eauto using map_singleton_updateP_empty. Qed.
......
...@@ -172,7 +172,7 @@ Proof. ...@@ -172,7 +172,7 @@ Proof.
+ exfalso; inversion_clear Hx'. + exfalso; inversion_clear Hx'.
Qed. Qed.
Canonical Structure fracR : cmraT := CMRAT frac_cofe_mixin frac_cmra_mixin. Canonical Structure fracR : cmraT := CMRAT frac_cofe_mixin frac_cmra_mixin.
Global Instance frac_cmra_identity : CMRAIdentity fracR. Global Instance frac_cmra_unit : CMRAUnit fracR.
Proof. split. done. by intros []. apply _. Qed. Proof. split. done. by intros []. apply _. Qed.
Global Instance frac_cmra_discrete : CMRADiscrete A CMRADiscrete fracR. Global Instance frac_cmra_discrete : CMRADiscrete A CMRADiscrete fracR.
Proof. Proof.
...@@ -238,7 +238,7 @@ Proof. ...@@ -238,7 +238,7 @@ Proof.
split; try apply _. split; try apply _.
- intros n [p a|]; destruct 1; split; auto using validN_preserving. - intros n [p a|]; destruct 1; split; auto using validN_preserving.
- intros [q1 a1|] [q2 a2|] [[q3 a3|] Hx]; - intros [q1 a1|] [q2 a2|] [[q3 a3|] Hx];
inversion Hx; setoid_subst; try apply: cmra_empty_least; auto. inversion Hx; setoid_subst; try apply: cmra_unit_least; auto.
destruct (included_preserving f a1 (a1 a3)) as [b ?]. destruct (included_preserving f a1 (a1 a3)) as [b ?].
{ by apply cmra_included_l. } { by apply cmra_included_l. }
by exists (Frac q3 b); constructor. by exists (Frac q3 b); constructor.
......
...@@ -160,11 +160,11 @@ Section iprod_cmra. ...@@ -160,11 +160,11 @@ Section iprod_cmra.
split_and?; intros x; apply (proj2_sig (g x)). split_and?; intros x; apply (proj2_sig (g x)).
Qed. Qed.
Canonical Structure iprodR : cmraT := CMRAT iprod_cofe_mixin iprod_cmra_mixin. Canonical Structure iprodR : cmraT := CMRAT iprod_cofe_mixin iprod_cmra_mixin.
Global Instance iprod_cmra_identity `{ x, Empty (B x)} : Global Instance iprod_cmra_unit `{ x, Empty (B x)} :
( x, CMRAIdentity (B x)) CMRAIdentity iprodR. ( x, CMRAUnit (B x)) CMRAUnit iprodR.
Proof. Proof.
intros ?; split. intros ?; split.
- intros x; apply cmra_empty_valid. - intros x; apply cmra_unit_valid.
- by intros f x; rewrite iprod_lookup_op left_id. - by intros f x; rewrite iprod_lookup_op left_id.
- by apply _. - by apply _.
Qed. Qed.
...@@ -201,14 +201,14 @@ Section iprod_cmra. ...@@ -201,14 +201,14 @@ Section iprod_cmra.
Qed. Qed.
(** Properties of iprod_singleton. *) (** Properties of iprod_singleton. *)
Context `{ x, Empty (B x), x, CMRAIdentity (B x)}. Context `{ x, Empty (B x), x, CMRAUnit (B x)}.
Lemma iprod_singleton_validN n x (y: B x) : {n} iprod_singleton x y {n} y. Lemma iprod_singleton_validN n x (y: B x) : {n} iprod_singleton x y {n} y.
Proof. Proof.
split; [by move=>/(_ x); rewrite iprod_lookup_singleton|]. split; [by move=>/(_ x); rewrite iprod_lookup_singleton|].
move=>Hx x'; destruct (decide (x = x')) as [->|]; move=>Hx x'; destruct (decide (x = x')) as [->|];
rewrite ?iprod_lookup_singleton ?iprod_lookup_singleton_ne //. rewrite ?iprod_lookup_singleton ?iprod_lookup_singleton_ne //.
by apply cmra_empty_validN. by apply cmra_unit_validN.
Qed. Qed.
Lemma iprod_core_singleton x (y : B x) : Lemma iprod_core_singleton x (y : B x) :
...@@ -216,7 +216,7 @@ Section iprod_cmra. ...@@ -216,7 +216,7 @@ Section iprod_cmra.
Proof. Proof.
by move=>x'; destruct (decide (x = x')) as [->|]; by move=>x'; destruct (decide (x = x')) as [->|];
rewrite iprod_lookup_core ?iprod_lookup_singleton rewrite iprod_lookup_core ?iprod_lookup_singleton
?iprod_lookup_singleton_ne // cmra_core_empty. ?iprod_lookup_singleton_ne // cmra_core_unit.
Qed. Qed.
Lemma iprod_op_singleton (x : A) (y1 y2 : B x) : Lemma iprod_op_singleton (x : A) (y1 y2 : B x) :
......
...@@ -119,7 +119,7 @@ Proof. ...@@ -119,7 +119,7 @@ Proof.
+ exists (None,None); repeat constructor. + exists (None,None); repeat constructor.
Qed. Qed.
Canonical Structure optionR := CMRAT option_cofe_mixin option_cmra_mixin. Canonical Structure optionR := CMRAT option_cofe_mixin option_cmra_mixin.
Global Instance option_cmra_identity : CMRAIdentity optionR. Global Instance option_cmra_unit : CMRAUnit optionR.
Proof. split. done. by intros []. by inversion_clear 1. Qed. Proof. split. done. by intros []. by inversion_clear 1. Qed.
Global Instance option_cmra_discrete : CMRADiscrete A CMRADiscrete optionR. Global Instance option_cmra_discrete : CMRADiscrete A CMRADiscrete optionR.
Proof. split; [apply _|]. by intros [x|]; [apply (cmra_discrete_valid x)|]. Qed. Proof. split; [apply _|]. by intros [x|]; [apply (cmra_discrete_valid x)|]. Qed.
...@@ -164,10 +164,10 @@ Lemma option_update x y : x ~~> y → Some x ~~> Some y. ...@@ -164,10 +164,10 @@ Lemma option_update x y : x ~~> y → Some x ~~> Some y.
Proof. Proof.
rewrite !cmra_update_updateP; eauto using option_updateP with congruence. rewrite !cmra_update_updateP; eauto using option_updateP with congruence.
Qed. Qed.
Lemma option_update_None `{Empty A, !CMRAIdentity A} : ~~> Some . Lemma option_update_None `{Empty A, !CMRAUnit A} : ~~> Some .
Proof. Proof.
intros n [x|] ?; rewrite /op /cmra_op /validN /cmra_validN /= ?left_id; intros n [x|] ?; rewrite /op /cmra_op /validN /cmra_validN /= ?left_id;
auto using cmra_empty_validN. auto using cmra_unit_validN.
Qed. Qed.
End cmra. End cmra.
Arguments optionR : clear implicits. Arguments optionR : clear implicits.
......
...@@ -499,11 +499,11 @@ Proof. ...@@ -499,11 +499,11 @@ Proof.
unseal; intros Hab Ha; split=> n x ??. unseal; intros Hab Ha; split=> n x ??.
apply HΨ with n a; auto. by symmetry; apply Hab with x. by apply Ha. apply HΨ with n a; auto. by symmetry; apply Hab with x. by apply Ha.
Qed. Qed.
Lemma eq_equiv `{Empty M, !CMRAIdentity M} {A : cofeT} (a b : A) : Lemma eq_equiv `{Empty M, !CMRAUnit M} {A : cofeT} (a b : A) :
True (a b) a b. True (a b) a b.
Proof. Proof.
unseal=> Hab; apply equiv_dist; intros n; apply Hab with ; last done. unseal=> Hab; apply equiv_dist; intros n; apply Hab with ; last done.
apply cmra_valid_validN, cmra_empty_valid. apply cmra_valid_validN, cmra_unit_valid.
Qed. Qed.
Lemma iff_equiv P Q : True (P Q) P Q. Lemma iff_equiv P Q : True (P Q) P Q.
Proof. Proof.
...@@ -1002,7 +1002,7 @@ Lemma always_ownM (a : M) : core a ≡ a → (□ uPred_ownM a)%I ≡ uPred_ownM ...@@ -1002,7 +1002,7 @@ Lemma always_ownM (a : M) : core a ≡ a → (□ uPred_ownM a)%I ≡ uPred_ownM
Proof. by intros <-; rewrite always_ownM_core. Qed. Proof. by intros <-; rewrite always_ownM_core. Qed.
Lemma ownM_something : True a, uPred_ownM a. Lemma ownM_something : True a, uPred_ownM a.
Proof. unseal; split=> n x ??. by exists x; simpl. Qed. Proof. unseal; split=> n x ??. by exists x; simpl. Qed.
Lemma ownM_empty `{Empty M, !CMRAIdentity M} : True uPred_ownM . Lemma ownM_empty `{Empty M, !CMRAUnit M} : True uPred_ownM .
Proof. unseal; split=> n x ??; by exists x; rewrite left_id. Qed. Proof. unseal; split=> n x ??; by exists x; rewrite left_id. Qed.
(* Valid *) (* Valid *)
......
...@@ -5,14 +5,14 @@ Import uPred. ...@@ -5,14 +5,14 @@ Import uPred.
(* The CMRA we need. *) (* The CMRA we need. *)
Class authG Λ Σ (A : cmraT) `{Empty A} := AuthG { Class authG Λ Σ (A : cmraT) `{Empty A} := AuthG {
auth_inG :> inG Λ Σ (authR A); auth_inG :> inG Λ Σ (authR A);
auth_identity :> CMRAIdentity A; auth_identity :> CMRAUnit A;
auth_timeless :> CMRADiscrete A; auth_timeless :> CMRADiscrete A;
}. }.
(* The Functor we need. *) (* The Functor we need. *)
Definition authGF (A : cmraT) : gFunctor := GFunctor (constRF (authR A)). Definition authGF (A : cmraT) : gFunctor := GFunctor (constRF (authR A)).
(* Show and register that they match. *) (* Show and register that they match. *)
Instance authGF_inGF (A : cmraT) `{inGF Λ Σ (authGF A)} Instance authGF_inGF (A : cmraT) `{inGF Λ Σ (authGF A)}
`{CMRAIdentity A, CMRADiscrete A} : authG Λ Σ A. `{CMRAUnit A, CMRADiscrete A} : authG Λ Σ A.
Proof. split; try apply _. apply: inGF_inG. Qed. Proof. split; try apply _. apply: inGF_inG. Qed.
Section definitions. Section definitions.
......
...@@ -19,10 +19,10 @@ Implicit Types a : A. ...@@ -19,10 +19,10 @@ Implicit Types a : A.
Instance inG_empty `{Empty A} : Instance inG_empty `{Empty A} :
Empty (Σ inG_id (iPreProp Λ (globalF Σ))) := cmra_transport inG_prf . Empty (Σ inG_id (iPreProp Λ (globalF Σ))) := cmra_transport inG_prf .
Instance inG_empty_spec `{Empty A} : Instance inG_empty_spec `{Empty A} :
CMRAIdentity A CMRAIdentity (Σ inG_id (iPreProp Λ (globalF Σ))). CMRAUnit A CMRAUnit (Σ inG_id (iPreProp Λ (globalF Σ))).
Proof. Proof.
split. split.
- apply cmra_transport_valid, cmra_empty_valid. - apply cmra_transport_valid, cmra_unit_valid.
- intros x; rewrite /empty /inG_empty; destruct inG_prf. by rewrite left_id. - intros x; rewrite /empty /inG_empty; destruct inG_prf. by rewrite left_id.
- apply _. - apply _.
Qed. Qed.
...@@ -52,7 +52,7 @@ Lemma own_valid_r γ a : own γ a ⊑ (own γ a ★ ✓ a). ...@@ -52,7 +52,7 @@ Lemma own_valid_r γ a : own γ a ⊑ (own γ a ★ ✓ a).
Proof. apply: uPred.always_entails_r. apply own_valid. Qed. Proof. apply: uPred.always_entails_r. apply own_valid. Qed.
Lemma own_valid_l γ a : own γ a ( a own γ a). Lemma own_valid_l γ a : own γ a ( a own γ a).
Proof. by rewrite comm -own_valid_r. Qed. Proof. by rewrite comm -own_valid_r. Qed.
Lemma own_empty `{CMRAIdentity A} γ : True own γ . Lemma own_empty `{CMRAUnit A} γ : True own γ .
Proof. Proof.
rewrite ownG_empty /own. apply equiv_spec, ownG_proper. rewrite ownG_empty /own. apply equiv_spec, ownG_proper.
(* FIXME: rewrite to_globalF_empty. *) (* FIXME: rewrite to_globalF_empty. *)
...@@ -99,13 +99,13 @@ Proof. ...@@ -99,13 +99,13 @@ Proof.
by apply pvs_mono, exist_elim=> a''; apply const_elim_l=> ->. by apply pvs_mono, exist_elim=> a''; apply const_elim_l=> ->.
Qed. Qed.
Lemma own_empty `{Empty A, !CMRAIdentity A} γ E : Lemma own_empty `{Empty A, !CMRAUnit A} γ E :
True (|={E}=> own γ ). True (|={E}=> own γ ).
Proof. Proof.
rewrite ownG_empty /own. apply pvs_ownG_update, cmra_update_updateP. rewrite ownG_empty /own. apply pvs_ownG_update, cmra_update_updateP.
eapply iprod_singleton_updateP_empty; eapply iprod_singleton_updateP_empty;
first by eapply map_singleton_updateP_empty', cmra_transport_updateP', first by eapply map_singleton_updateP_empty', cmra_transport_updateP',
cmra_update_updateP, cmra_update_empty. cmra_update_updateP, cmra_update_unit.
naive_solver. naive_solver.
Qed. Qed.
End global. End global.
...@@ -10,7 +10,7 @@ Structure iFunctor := IFunctor { ...@@ -10,7 +10,7 @@ Structure iFunctor := IFunctor {
iFunctor_F :> rFunctor; iFunctor_F :> rFunctor;
iFunctor_contractive : rFunctorContractive iFunctor_F; iFunctor_contractive : rFunctorContractive iFunctor_F;
iFunctor_empty (A : cofeT) : Empty (iFunctor_F A); iFunctor_empty (A : cofeT) : Empty (iFunctor_F A);
iFunctor_identity (A : cofeT) : CMRAIdentity (iFunctor_F A); iFunctor_identity (A : cofeT) : CMRAUnit (iFunctor_F A);
}. }.
Arguments IFunctor _ {_ _ _}. Arguments IFunctor _ {_ _ _}.
Existing Instances iFunctor_contractive iFunctor_empty iFunctor_identity. Existing Instances iFunctor_contractive iFunctor_empty iFunctor_identity.
......
...@@ -28,7 +28,7 @@ Qed. ...@@ -28,7 +28,7 @@ Qed.
Lemma always_ownI i P : ( ownI i P)%I ownI i P. Lemma always_ownI i P : ( ownI i P)%I ownI i P.
Proof. Proof.
apply uPred.always_ownM. apply uPred.always_ownM.
by rewrite Res_core !cmra_core_empty map_core_singleton. by rewrite Res_core !cmra_core_unit map_core_singleton.
Qed. Qed.
Global Instance ownI_always_stable i P : AlwaysStable (ownI i P). Global Instance ownI_always_stable i P : AlwaysStable (ownI i P).
Proof. by rewrite