Commit a3028b92 authored by Robbert Krebbers's avatar Robbert Krebbers

Consistently de-capitalize acronyms.

Rename `UCMRA` → `Ucmra`
Rename `CMRA` → `Cmra`
Rename `OFE` → `Ofe` (`Ofe` was already used partially, but many occurences were missing)
Rename `STS` → `Sts`
Rename `DRA` → `Dra`
parent 4886e15f
...@@ -131,7 +131,7 @@ Proof. ...@@ -131,7 +131,7 @@ Proof.
- destruct (elem_of_agree x1); naive_solver. - destruct (elem_of_agree x1); naive_solver.
Qed. Qed.
Definition agree_cmra_mixin : CMRAMixin (agree A). Definition agree_cmra_mixin : CmraMixin (agree A).
Proof. Proof.
apply cmra_total_mixin; try apply _ || by eauto. apply cmra_total_mixin; try apply _ || by eauto.
- intros n x; rewrite !agree_validN_def; eauto using dist_S. - intros n x; rewrite !agree_validN_def; eauto using dist_S.
...@@ -142,14 +142,14 @@ Proof. ...@@ -142,14 +142,14 @@ Proof.
+ by rewrite agree_idemp. + by rewrite agree_idemp.
+ by move: Hval; rewrite Hx; move=> /agree_op_invN->; rewrite agree_idemp. + by move: Hval; rewrite Hx; move=> /agree_op_invN->; rewrite agree_idemp.
Qed. Qed.
Canonical Structure agreeR : cmraT := CMRAT (agree A) agree_cmra_mixin. Canonical Structure agreeR : cmraT := CmraT (agree A) agree_cmra_mixin.
Global Instance agree_total : CMRATotal agreeR. Global Instance agree_cmra_total : CmraTotal agreeR.
Proof. rewrite /CMRATotal; eauto. Qed. Proof. rewrite /CmraTotal; eauto. Qed.
Global Instance agree_persistent (x : agree A) : Persistent x. Global Instance agree_persistent (x : agree A) : Persistent x.
Proof. by constructor. Qed. Proof. by constructor. Qed.
Global Instance agree_cmra_discrete : OFEDiscrete A CMRADiscrete agreeR. Global Instance agree_cmra_discrete : OfeDiscrete A CmraDiscrete agreeR.
Proof. Proof.
intros HD. split. intros HD. split.
- intros x y [H H'] n; split=> a; setoid_rewrite <-(discrete_iff_0 _ _); auto. - intros x y [H H'] n; split=> a; setoid_rewrite <-(discrete_iff_0 _ _); auto.
...@@ -267,7 +267,7 @@ Section agree_map. ...@@ -267,7 +267,7 @@ Section agree_map.
- intros (a&->&?). exists (f a). rewrite -Hfg; eauto. - intros (a&->&?). exists (f a). rewrite -Hfg; eauto.
Qed. Qed.
Global Instance agree_map_morphism : CMRAMorphism (agree_map f). Global Instance agree_map_morphism : CmraMorphism (agree_map f).
Proof using Hf. Proof using Hf.
split; first apply _. split; first apply _.
- intros n x. rewrite !agree_validN_def=> Hv b b' /=. - intros n x. rewrite !agree_validN_def=> Hv b b' /=.
......
...@@ -52,7 +52,7 @@ Qed. ...@@ -52,7 +52,7 @@ Qed.
Global Instance Auth_discrete a b : Global Instance Auth_discrete a b :
Discrete a Discrete b Discrete (Auth a b). Discrete a Discrete b Discrete (Auth a b).
Proof. by intros ?? [??] [??]; split; apply: discrete. Qed. Proof. by intros ?? [??] [??]; split; apply: discrete. Qed.
Global Instance auth_ofe_discrete : OFEDiscrete A OFEDiscrete authC. Global Instance auth_ofe_discrete : OfeDiscrete A OfeDiscrete authC.
Proof. intros ? [??]; apply _. Qed. Proof. intros ? [??]; apply _. Qed.
Global Instance auth_leibniz : LeibnizEquiv A LeibnizEquiv (auth A). Global Instance auth_leibniz : LeibnizEquiv A LeibnizEquiv (auth A).
Proof. by intros ? [??] [??] [??]; f_equal/=; apply leibniz_equiv. Qed. Proof. by intros ? [??] [??] [??]; f_equal/=; apply leibniz_equiv. Qed.
...@@ -113,7 +113,7 @@ Proof. ...@@ -113,7 +113,7 @@ Proof.
destruct x as [[[]|]]; naive_solver eauto using cmra_validN_includedN. destruct x as [[[]|]]; naive_solver eauto using cmra_validN_includedN.
Qed. Qed.
Lemma auth_valid_discrete `{CMRADiscrete A} x : Lemma auth_valid_discrete `{CmraDiscrete A} x :
x match authoritative x with x match authoritative x with
| Excl' a => auth_own x a a | Excl' a => auth_own x a a
| None => auth_own x | None => auth_own x
...@@ -125,18 +125,18 @@ Proof. ...@@ -125,18 +125,18 @@ Proof.
Qed. Qed.
Lemma auth_validN_2 n a b : {n} ( a b) b {n} a {n} a. Lemma auth_validN_2 n a b : {n} ( a b) b {n} a {n} a.
Proof. by rewrite auth_validN_eq /= left_id. Qed. Proof. by rewrite auth_validN_eq /= left_id. Qed.
Lemma auth_valid_discrete_2 `{CMRADiscrete A} a b : ( a b) b a a. Lemma auth_valid_discrete_2 `{CmraDiscrete A} a b : ( a b) b a a.
Proof. by rewrite auth_valid_discrete /= left_id. Qed. Proof. by rewrite auth_valid_discrete /= left_id. Qed.
Lemma authoritative_valid x : x authoritative x. Lemma authoritative_valid x : x authoritative x.
Proof. by destruct x as [[[]|]]. Qed. Proof. by destruct x as [[[]|]]. Qed.
Lemma auth_own_valid `{CMRADiscrete A} x : x auth_own x. Lemma auth_own_valid `{CmraDiscrete A} x : x auth_own x.
Proof. Proof.
rewrite auth_valid_discrete. rewrite auth_valid_discrete.
destruct x as [[[]|]]; naive_solver eauto using cmra_valid_included. destruct x as [[[]|]]; naive_solver eauto using cmra_valid_included.
Qed. Qed.
Lemma auth_cmra_mixin : CMRAMixin (auth A). Lemma auth_cmra_mixin : CmraMixin (auth A).
Proof. Proof.
apply cmra_total_mixin. apply cmra_total_mixin.
- eauto. - eauto.
...@@ -166,9 +166,9 @@ Proof. ...@@ -166,9 +166,9 @@ Proof.
as (b1&b2&?&?&?); auto using auth_own_validN. as (b1&b2&?&?&?); auto using auth_own_validN.
by exists (Auth ea1 b1), (Auth ea2 b2). by exists (Auth ea1 b1), (Auth ea2 b2).
Qed. Qed.
Canonical Structure authR := CMRAT (auth A) auth_cmra_mixin. Canonical Structure authR := CmraT (auth A) auth_cmra_mixin.
Global Instance auth_cmra_discrete : CMRADiscrete A CMRADiscrete authR. Global Instance auth_cmra_discrete : CmraDiscrete A CmraDiscrete authR.
Proof. Proof.
split; first apply _. split; first apply _.
intros [[[?|]|] ?]; rewrite auth_valid_eq auth_validN_eq /=; auto. intros [[[?|]|] ?]; rewrite auth_valid_eq auth_validN_eq /=; auto.
...@@ -178,14 +178,14 @@ Proof. ...@@ -178,14 +178,14 @@ Proof.
Qed. Qed.
Instance auth_empty : Unit (auth A) := Auth ε ε. Instance auth_empty : Unit (auth A) := Auth ε ε.
Lemma auth_ucmra_mixin : UCMRAMixin (auth A). Lemma auth_ucmra_mixin : UcmraMixin (auth A).
Proof. Proof.
split; simpl. split; simpl.
- rewrite auth_valid_eq /=. apply ucmra_unit_valid. - rewrite auth_valid_eq /=. apply ucmra_unit_valid.
- by intros x; constructor; rewrite /= left_id. - by intros x; constructor; rewrite /= left_id.
- do 2 constructor; simpl; apply (persistent_core _). - do 2 constructor; simpl; apply (persistent_core _).
Qed. Qed.
Canonical Structure authUR := UCMRAT (auth A) auth_ucmra_mixin. Canonical Structure authUR := UcmraT (auth A) auth_ucmra_mixin.
Global Instance auth_frag_persistent a : Persistent a Persistent ( a). Global Instance auth_frag_persistent a : Persistent a Persistent ( a).
Proof. do 2 constructor; simpl; auto. by apply persistent_core. Qed. Proof. do 2 constructor; simpl; auto. by apply persistent_core. Qed.
...@@ -274,7 +274,7 @@ Proof. ...@@ -274,7 +274,7 @@ Proof.
apply option_fmap_ne; [|done]=> x y ?; by apply excl_map_ne. apply option_fmap_ne; [|done]=> x y ?; by apply excl_map_ne.
Qed. Qed.
Instance auth_map_cmra_morphism {A B : ucmraT} (f : A B) : Instance auth_map_cmra_morphism {A B : ucmraT} (f : A B) :
CMRAMorphism f CMRAMorphism (auth_map f). CmraMorphism f CmraMorphism (auth_map f).
Proof. Proof.
split; try apply _. split; try apply _.
- intros n [[[a|]|] b]; rewrite !auth_validN_eq; try - intros n [[[a|]|] b]; rewrite !auth_validN_eq; try
......
This diff is collapsed.
...@@ -39,12 +39,12 @@ Section coPset. ...@@ -39,12 +39,12 @@ Section coPset.
Qed. Qed.
Canonical Structure coPsetR := discreteR coPset coPset_ra_mixin. Canonical Structure coPsetR := discreteR coPset coPset_ra_mixin.
Global Instance coPset_cmra_discrete : CMRADiscrete coPsetR. Global Instance coPset_cmra_discrete : CmraDiscrete coPsetR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
Lemma coPset_ucmra_mixin : UCMRAMixin coPset. Lemma coPset_ucmra_mixin : UcmraMixin coPset.
Proof. split. done. intros X. by rewrite coPset_op_union left_id_L. done. Qed. Proof. split. done. intros X. by rewrite coPset_op_union left_id_L. done. Qed.
Canonical Structure coPsetUR := UCMRAT coPset coPset_ucmra_mixin. Canonical Structure coPsetUR := UcmraT coPset coPset_ucmra_mixin.
Lemma coPset_opM X mY : X ? mY = X from_option id mY. Lemma coPset_opM X mY : X ? mY = X from_option id mY.
Proof. destruct mY; by rewrite /= ?right_id_L. Qed. Proof. destruct mY; by rewrite /= ?right_id_L. Qed.
...@@ -112,10 +112,10 @@ Section coPset_disj. ...@@ -112,10 +112,10 @@ Section coPset_disj.
Qed. Qed.
Canonical Structure coPset_disjR := discreteR coPset_disj coPset_disj_ra_mixin. Canonical Structure coPset_disjR := discreteR coPset_disj coPset_disj_ra_mixin.
Global Instance coPset_disj_cmra_discrete : CMRADiscrete coPset_disjR. Global Instance coPset_disj_cmra_discrete : CmraDiscrete coPset_disjR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
Lemma coPset_disj_ucmra_mixin : UCMRAMixin coPset_disj. Lemma coPset_disj_ucmra_mixin : UcmraMixin coPset_disj.
Proof. split; try apply _ || done. intros [X|]; coPset_disj_solve. Qed. Proof. split; try apply _ || done. intros [X|]; coPset_disj_solve. Qed.
Canonical Structure coPset_disjUR := UCMRAT coPset_disj coPset_disj_ucmra_mixin. Canonical Structure coPset_disjUR := UcmraT coPset_disj coPset_disj_ucmra_mixin.
End coPset_disj. End coPset_disj.
...@@ -96,7 +96,8 @@ Next Obligation. ...@@ -96,7 +96,8 @@ Next Obligation.
+ rewrite (conv_compl n (csum_chain_r c b')) /=. destruct (c n); naive_solver. + rewrite (conv_compl n (csum_chain_r c b')) /=. destruct (c n); naive_solver.
Qed. Qed.
Global Instance csum_ofe_discrete : OFEDiscrete A OFEDiscrete B OFEDiscrete csumC. Global Instance csum_ofe_discrete :
OfeDiscrete A OfeDiscrete B OfeDiscrete csumC.
Proof. by inversion_clear 3; constructor; apply (discrete _). Qed. Proof. by inversion_clear 3; constructor; apply (discrete _). Qed.
Global Instance csum_leibniz : Global Instance csum_leibniz :
LeibnizEquiv A LeibnizEquiv B LeibnizEquiv (csumC A B). LeibnizEquiv A LeibnizEquiv B LeibnizEquiv (csumC A B).
...@@ -202,7 +203,7 @@ Proof. ...@@ -202,7 +203,7 @@ Proof.
+ exists (Cinr c); by constructor. + exists (Cinr c); by constructor.
Qed. Qed.
Lemma csum_cmra_mixin : CMRAMixin (csum A B). Lemma csum_cmra_mixin : CmraMixin (csum A B).
Proof. Proof.
split. split.
- intros [] n; destruct 1; constructor; by ofe_subst. - intros [] n; destruct 1; constructor; by ofe_subst.
...@@ -246,10 +247,10 @@ Proof. ...@@ -246,10 +247,10 @@ Proof.
exists (Cinr z1), (Cinr z2). by repeat constructor. exists (Cinr z1), (Cinr z2). by repeat constructor.
+ by exists CsumBot, CsumBot; destruct y1, y2; inversion_clear Hx'. + by exists CsumBot, CsumBot; destruct y1, y2; inversion_clear Hx'.
Qed. Qed.
Canonical Structure csumR := CMRAT (csum A B) csum_cmra_mixin. Canonical Structure csumR := CmraT (csum A B) csum_cmra_mixin.
Global Instance csum_cmra_discrete : Global Instance csum_cmra_discrete :
CMRADiscrete A CMRADiscrete B CMRADiscrete csumR. CmraDiscrete A CmraDiscrete B CmraDiscrete csumR.
Proof. Proof.
split; first apply _. split; first apply _.
by move=>[a|b|] HH /=; try apply cmra_discrete_valid. by move=>[a|b|] HH /=; try apply cmra_discrete_valid.
...@@ -357,7 +358,7 @@ Arguments csumR : clear implicits. ...@@ -357,7 +358,7 @@ Arguments csumR : clear implicits.
(* Functor *) (* Functor *)
Instance csum_map_cmra_morphism {A A' B B' : cmraT} (f : A A') (g : B B') : Instance csum_map_cmra_morphism {A A' B B' : cmraT} (f : A A') (g : B B') :
CMRAMorphism f CMRAMorphism g CMRAMorphism (csum_map f g). CmraMorphism f CmraMorphism g CmraMorphism (csum_map f g).
Proof. Proof.
split; try apply _. split; try apply _.
- intros n [a|b|]; simpl; auto using cmra_morphism_validN. - intros n [a|b|]; simpl; auto using cmra_morphism_validN.
......
...@@ -50,9 +50,9 @@ Qed. ...@@ -50,9 +50,9 @@ Qed.
Canonical Structure dec_agreeR : cmraT := Canonical Structure dec_agreeR : cmraT :=
discreteR (dec_agree A) dec_agree_ra_mixin. discreteR (dec_agree A) dec_agree_ra_mixin.
Global Instance dec_agree_cmra_discrete : CMRADiscrete dec_agreeR. Global Instance dec_agree_cmra_discrete : CmraDiscrete dec_agreeR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
Global Instance dec_agree_total : CMRATotal dec_agreeR. Global Instance dec_agree_cmra_total : CmraTotal dec_agreeR.
Proof. intros x. by exists x. Qed. Proof. intros x. by exists x. Qed.
(* Some properties of this CMRA *) (* Some properties of this CMRA *)
......
From iris.algebra Require Export cmra updates. From iris.algebra Require Export cmra updates.
Set Default Proof Using "Type". Set Default Proof Using "Type".
Record DRAMixin A `{Equiv A, Core A, Disjoint A, Op A, Valid A} := { Record DraMixin A `{Equiv A, Core A, Disjoint A, Op A, Valid A} := {
(* setoids *) (* setoids *)
mixin_dra_equivalence : Equivalence (() : relation A); mixin_dra_equivalence : Equivalence (() : relation A);
mixin_dra_op_proper : Proper (() ==> () ==> ()) (); mixin_dra_op_proper : Proper (() ==> () ==> ()) ();
...@@ -24,16 +24,16 @@ Record DRAMixin A `{Equiv A, Core A, Disjoint A, Op A, Valid A} := { ...@@ -24,16 +24,16 @@ Record DRAMixin A `{Equiv A, Core A, Disjoint A, Op A, Valid A} := {
mixin_dra_core_mono x y : mixin_dra_core_mono x y :
z, x y x y core (x y) core x z z core x z z, x y x y core (x y) core x z z core x z
}. }.
Structure draT := DRAT { Structure draT := DraT {
dra_car :> Type; dra_car :> Type;
dra_equiv : Equiv dra_car; dra_equiv : Equiv dra_car;
dra_core : Core dra_car; dra_core : Core dra_car;
dra_disjoint : Disjoint dra_car; dra_disjoint : Disjoint dra_car;
dra_op : Op dra_car; dra_op : Op dra_car;
dra_valid : Valid dra_car; dra_valid : Valid dra_car;
dra_mixin : DRAMixin dra_car dra_mixin : DraMixin dra_car
}. }.
Arguments DRAT _ {_ _ _ _ _} _. Arguments DraT _ {_ _ _ _ _} _.
Arguments dra_car : simpl never. Arguments dra_car : simpl never.
Arguments dra_equiv : simpl never. Arguments dra_equiv : simpl never.
Arguments dra_core : simpl never. Arguments dra_core : simpl never.
...@@ -177,10 +177,10 @@ Qed. ...@@ -177,10 +177,10 @@ Qed.
Canonical Structure validityR : cmraT := Canonical Structure validityR : cmraT :=
discreteR (validity A) validity_ra_mixin. discreteR (validity A) validity_ra_mixin.
Global Instance validity_cmra_disrete : CMRADiscrete validityR. Global Instance validity_disrete_cmra : CmraDiscrete validityR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
Global Instance validity_cmra_total : CMRATotal validityR. Global Instance validity_cmra_total : CmraTotal validityR.
Proof. rewrite /CMRATotal; eauto. Qed. Proof. rewrite /CmraTotal; eauto. Qed.
Lemma validity_update x y : Lemma validity_update x y :
( c, x c validity_car x c y validity_car y c) x ~~> y. ( c, x c validity_car x c y validity_car y c) x ~~> y.
......
...@@ -59,7 +59,7 @@ Proof. ...@@ -59,7 +59,7 @@ Proof.
- by intros []; constructor. - by intros []; constructor.
Qed. Qed.
Global Instance excl_ofe_discrete : OFEDiscrete A OFEDiscrete exclC. Global Instance excl_ofe_discrete : OfeDiscrete A OfeDiscrete exclC.
Proof. by inversion_clear 2; constructor; apply (discrete _). Qed. Proof. by inversion_clear 2; constructor; apply (discrete _). Qed.
Global Instance excl_leibniz : LeibnizEquiv A LeibnizEquiv (excl A). Global Instance excl_leibniz : LeibnizEquiv A LeibnizEquiv (excl A).
Proof. by destruct 2; f_equal; apply leibniz_equiv. Qed. Proof. by destruct 2; f_equal; apply leibniz_equiv. Qed.
...@@ -77,7 +77,7 @@ Instance excl_validN : ValidN (excl A) := λ n x, ...@@ -77,7 +77,7 @@ Instance excl_validN : ValidN (excl A) := λ n x,
Instance excl_pcore : PCore (excl A) := λ _, None. Instance excl_pcore : PCore (excl A) := λ _, None.
Instance excl_op : Op (excl A) := λ x y, ExclBot. Instance excl_op : Op (excl A) := λ x y, ExclBot.
Lemma excl_cmra_mixin : CMRAMixin (excl A). Lemma excl_cmra_mixin : CmraMixin (excl A).
Proof. Proof.
split; try discriminate. split; try discriminate.
- by intros n []; destruct 1; constructor. - by intros n []; destruct 1; constructor.
...@@ -89,9 +89,9 @@ Proof. ...@@ -89,9 +89,9 @@ Proof.
- by intros n [?|] [?|]. - by intros n [?|] [?|].
- intros n x [?|] [?|] ?; inversion_clear 1; eauto. - intros n x [?|] [?|] ?; inversion_clear 1; eauto.
Qed. Qed.
Canonical Structure exclR := CMRAT (excl A) excl_cmra_mixin. Canonical Structure exclR := CmraT (excl A) excl_cmra_mixin.
Global Instance excl_cmra_discrete : OFEDiscrete A CMRADiscrete exclR. Global Instance excl_cmra_discrete : OfeDiscrete A CmraDiscrete exclR.
Proof. split. apply _. by intros []. Qed. Proof. split. apply _. by intros []. Qed.
(** Internalized properties *) (** Internalized properties *)
...@@ -142,7 +142,7 @@ Instance excl_map_ne {A B : ofeT} n : ...@@ -142,7 +142,7 @@ Instance excl_map_ne {A B : ofeT} n :
Proper ((dist n ==> dist n) ==> dist n ==> dist n) (@excl_map A B). Proper ((dist n ==> dist n) ==> dist n ==> dist n) (@excl_map A B).
Proof. by intros f f' Hf; destruct 1; constructor; apply Hf. Qed. Proof. by intros f f' Hf; destruct 1; constructor; apply Hf. Qed.
Instance excl_map_cmra_morphism {A B : ofeT} (f : A B) : Instance excl_map_cmra_morphism {A B : ofeT} (f : A B) :
NonExpansive f CMRAMorphism (excl_map f). NonExpansive f CmraMorphism (excl_map f).
Proof. split; try done; try apply _. by intros n [a|]. Qed. Proof. split; try done; try apply _. by intros n [a|]. Qed.
Definition exclC_map {A B} (f : A -n> B) : exclC A -n> exclC B := Definition exclC_map {A B} (f : A -n> B) : exclC A -n> exclC B :=
CofeMor (excl_map f). CofeMor (excl_map f).
......
...@@ -26,7 +26,7 @@ Proof. ...@@ -26,7 +26,7 @@ Proof.
Qed. Qed.
Canonical Structure fracR := discreteR frac frac_ra_mixin. Canonical Structure fracR := discreteR frac frac_ra_mixin.
Global Instance frac_cmra_discrete : CMRADiscrete fracR. Global Instance frac_cmra_discrete : CmraDiscrete fracR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
End frac. End frac.
......
...@@ -58,13 +58,13 @@ Section frac_auth. ...@@ -58,13 +58,13 @@ Section frac_auth.
Lemma frac_auth_includedN n q a b : {n} (! a !{q} b) Some b {n} Some a. Lemma frac_auth_includedN n q a b : {n} (! a !{q} b) Some b {n} Some a.
Proof. by rewrite auth_validN_eq /= => -[/Some_pair_includedN [_ ?] _]. Qed. Proof. by rewrite auth_validN_eq /= => -[/Some_pair_includedN [_ ?] _]. Qed.
Lemma frac_auth_included `{CMRADiscrete A} q a b : Lemma frac_auth_included `{CmraDiscrete A} q a b :
(! a !{q} b) Some b Some a. (! a !{q} b) Some b Some a.
Proof. by rewrite auth_valid_discrete /= => -[/Some_pair_included [_ ?] _]. Qed. Proof. by rewrite auth_valid_discrete /= => -[/Some_pair_included [_ ?] _]. Qed.
Lemma frac_auth_includedN_total `{CMRATotal A} n q a b : Lemma frac_auth_includedN_total `{CmraTotal A} n q a b :
{n} (! a !{q} b) b {n} a. {n} (! a !{q} b) b {n} a.
Proof. intros. by eapply Some_includedN_total, frac_auth_includedN. Qed. Proof. intros. by eapply Some_includedN_total, frac_auth_includedN. Qed.
Lemma frac_auth_included_total `{CMRADiscrete A, CMRATotal A} q a b : Lemma frac_auth_included_total `{CmraDiscrete A, CmraTotal A} q a b :
(! a !{q} b) b a. (! a !{q} b) b a.
Proof. intros. by eapply Some_included_total, frac_auth_included. Qed. Proof. intros. by eapply Some_included_total, frac_auth_included. Qed.
......
...@@ -37,7 +37,7 @@ Next Obligation. ...@@ -37,7 +37,7 @@ Next Obligation.
by rewrite conv_compl /=; apply reflexive_eq. by rewrite conv_compl /=; apply reflexive_eq.
Qed. Qed.
Global Instance gmap_ofe_discrete : OFEDiscrete A OFEDiscrete gmapC. Global Instance gmap_ofe_discrete : OfeDiscrete A OfeDiscrete gmapC.
Proof. intros ? m m' ? i. by apply (discrete _). Qed. Proof. intros ? m m' ? i. by apply (discrete _). Qed.
(* why doesn't this go automatic? *) (* why doesn't this go automatic? *)
Global Instance gmapC_leibniz: LeibnizEquiv A LeibnizEquiv gmapC. Global Instance gmapC_leibniz: LeibnizEquiv A LeibnizEquiv gmapC.
...@@ -127,7 +127,7 @@ Proof. ...@@ -127,7 +127,7 @@ Proof.
lookup_insert_ne // lookup_partial_alter_ne. lookup_insert_ne // lookup_partial_alter_ne.
Qed. Qed.
Lemma gmap_cmra_mixin : CMRAMixin (gmap K A). Lemma gmap_cmra_mixin : CmraMixin (gmap K A).
Proof. Proof.
apply cmra_total_mixin. apply cmra_total_mixin.
- eauto. - eauto.
...@@ -171,19 +171,19 @@ Proof. ...@@ -171,19 +171,19 @@ Proof.
* by rewrite lookup_partial_alter. * by rewrite lookup_partial_alter.
* by rewrite lookup_partial_alter_ne // Hm2' lookup_delete_ne. * by rewrite lookup_partial_alter_ne // Hm2' lookup_delete_ne.
Qed. Qed.
Canonical Structure gmapR := CMRAT (gmap K A) gmap_cmra_mixin. Canonical Structure gmapR := CmraT (gmap K A) gmap_cmra_mixin.
Global Instance gmap_cmra_discrete : CMRADiscrete A CMRADiscrete gmapR. Global Instance gmap_cmra_discrete : CmraDiscrete A CmraDiscrete gmapR.
Proof. split; [apply _|]. intros m ? i. by apply: cmra_discrete_valid. Qed. Proof. split; [apply _|]. intros m ? i. by apply: cmra_discrete_valid. Qed.
Lemma gmap_ucmra_mixin : UCMRAMixin (gmap K A). Lemma gmap_ucmra_mixin : UcmraMixin (gmap K A).
Proof. Proof.
split. split.
- by intros i; rewrite lookup_empty. - by intros i; rewrite lookup_empty.
- by intros m i; rewrite /= lookup_op lookup_empty (left_id_L None _). - by intros m i; rewrite /= lookup_op lookup_empty (left_id_L None _).
- constructor=> i. by rewrite lookup_omap lookup_empty. - constructor=> i. by rewrite lookup_omap lookup_empty.
Qed. Qed.
Canonical Structure gmapUR := UCMRAT (gmap K A) gmap_ucmra_mixin. Canonical Structure gmapUR := UcmraT (gmap K A) gmap_ucmra_mixin.
(** Internalized properties *) (** Internalized properties *)
Lemma gmap_equivI {M} m1 m2 : m1 m2 ( i, m1 !! i m2 !! i : uPred M). Lemma gmap_equivI {M} m1 m2 : m1 m2 ( i, m1 !! i m2 !! i : uPred M).
...@@ -477,7 +477,7 @@ Instance gmap_fmap_ne `{Countable K} {A B : ofeT} (f : A → B) n : ...@@ -477,7 +477,7 @@ Instance gmap_fmap_ne `{Countable K} {A B : ofeT} (f : A → B) n :
Proper (dist n ==> dist n) f Proper (dist n ==>dist n) (fmap (M:=gmap K) f). Proper (dist n ==> dist n) f Proper (dist n ==>dist n) (fmap (M:=gmap K) f).
Proof. by intros ? m m' Hm k; rewrite !lookup_fmap; apply option_fmap_ne. Qed. Proof. by intros ? m m' Hm k; rewrite !lookup_fmap; apply option_fmap_ne. Qed.
Instance gmap_fmap_cmra_morphism `{Countable K} {A B : cmraT} (f : A B) Instance gmap_fmap_cmra_morphism `{Countable K} {A B : cmraT} (f : A B)
`{!CMRAMorphism f} : CMRAMorphism (fmap f : gmap K A gmap K B). `{!CmraMorphism f} : CmraMorphism (fmap f : gmap K A gmap K B).
Proof. Proof.
split; try apply _. split; try apply _.
- by intros n m ? i; rewrite lookup_fmap; apply (cmra_morphism_validN _). - by intros n m ? i; rewrite lookup_fmap; apply (cmra_morphism_validN _).
......
...@@ -38,12 +38,12 @@ Section gset. ...@@ -38,12 +38,12 @@ Section gset.
Qed. Qed.
Canonical Structure gsetR := discreteR (gset K) gset_ra_mixin. Canonical Structure gsetR := discreteR (gset K) gset_ra_mixin.
Global Instance gset_cmra_discrete : CMRADiscrete gsetR. Global Instance gset_cmra_discrete : CmraDiscrete gsetR.
Proof. apply discrete_cmra_discrete. Qed. Proof. apply discrete_cmra_discrete. Qed.
Lemma gset_ucmra_mixin : UCMRAMixin (gset K). Lemma gset_ucmra_mixin : UcmraMixin (gset K).
Proof. split. done. intros X. by rewrite gset_op_union left_id_L. done. Qed. Proof. split. done. intros X. by rewrite gset_op_union left_id_L. done. Qed.
Canonical Structure gsetUR := UCMRAT (gset K) gset_ucmra_mixin. Canonical Structure gsetUR := UcmraT (gset K) gset_ucmra_mixin.
Lemma gset_opM X mY : X ? mY = X from_option id mY. Lemma gset_opM X mY : X ? mY = X from_option id mY.
Proof. destruct mY; by rewrite /= ?right_id_L. Qed. Proof. destruct mY; by rewrite /= ?right_id_L. Qed.
...@@ -123,12 +123,12 @@ Section gset_disj. ...@@ -123,12 +123,12 @@ Section gset_disj.
Qed.