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.
- destruct (elem_of_agree x1); naive_solver.
Qed.
Definition agree_cmra_mixin : CMRAMixin (agree A).
Definition agree_cmra_mixin : CmraMixin (agree A).
Proof.
apply cmra_total_mixin; try apply _ || by eauto.
- intros n x; rewrite !agree_validN_def; eauto using dist_S.
......@@ -142,14 +142,14 @@ Proof.
+ by rewrite agree_idemp.
+ by move: Hval; rewrite Hx; move=> /agree_op_invN->; rewrite agree_idemp.
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.
Proof. rewrite /CMRATotal; eauto. Qed.
Global Instance agree_cmra_total : CmraTotal agreeR.
Proof. rewrite /CmraTotal; eauto. Qed.
Global Instance agree_persistent (x : agree A) : Persistent x.
Proof. by constructor. Qed.
Global Instance agree_cmra_discrete : OFEDiscrete A CMRADiscrete agreeR.
Global Instance agree_cmra_discrete : OfeDiscrete A CmraDiscrete agreeR.
Proof.
intros HD. split.
- intros x y [H H'] n; split=> a; setoid_rewrite <-(discrete_iff_0 _ _); auto.
......@@ -267,7 +267,7 @@ Section agree_map.
- intros (a&->&?). exists (f a). rewrite -Hfg; eauto.
Qed.
Global Instance agree_map_morphism : CMRAMorphism (agree_map f).
Global Instance agree_map_morphism : CmraMorphism (agree_map f).
Proof using Hf.
split; first apply _.
- intros n x. rewrite !agree_validN_def=> Hv b b' /=.
......
......@@ -52,7 +52,7 @@ Qed.
Global Instance Auth_discrete a b :
Discrete a Discrete b Discrete (Auth a b).
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.
Global Instance auth_leibniz : LeibnizEquiv A LeibnizEquiv (auth A).
Proof. by intros ? [??] [??] [??]; f_equal/=; apply leibniz_equiv. Qed.
......@@ -113,7 +113,7 @@ Proof.
destruct x as [[[]|]]; naive_solver eauto using cmra_validN_includedN.
Qed.
Lemma auth_valid_discrete `{CMRADiscrete A} x :
Lemma auth_valid_discrete `{CmraDiscrete A} x :
x match authoritative x with
| Excl' a => auth_own x a a
| None => auth_own x
......@@ -125,18 +125,18 @@ Proof.
Qed.
Lemma auth_validN_2 n a b : {n} ( a b) b {n} a {n} a.
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.
Lemma authoritative_valid x : x authoritative x.
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.
rewrite auth_valid_discrete.
destruct x as [[[]|]]; naive_solver eauto using cmra_valid_included.
Qed.
Lemma auth_cmra_mixin : CMRAMixin (auth A).
Lemma auth_cmra_mixin : CmraMixin (auth A).
Proof.
apply cmra_total_mixin.
- eauto.
......@@ -166,9 +166,9 @@ Proof.
as (b1&b2&?&?&?); auto using auth_own_validN.
by exists (Auth ea1 b1), (Auth ea2 b2).
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.
split; first apply _.
intros [[[?|]|] ?]; rewrite auth_valid_eq auth_validN_eq /=; auto.
......@@ -178,14 +178,14 @@ Proof.
Qed.
Instance auth_empty : Unit (auth A) := Auth ε ε.
Lemma auth_ucmra_mixin : UCMRAMixin (auth A).
Lemma auth_ucmra_mixin : UcmraMixin (auth A).
Proof.
split; simpl.
- rewrite auth_valid_eq /=. apply ucmra_unit_valid.
- by intros x; constructor; rewrite /= left_id.
- do 2 constructor; simpl; apply (persistent_core _).
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).
Proof. do 2 constructor; simpl; auto. by apply persistent_core. Qed.
......@@ -274,7 +274,7 @@ Proof.
apply option_fmap_ne; [|done]=> x y ?; by apply excl_map_ne.
Qed.
Instance auth_map_cmra_morphism {A B : ucmraT} (f : A B) :
CMRAMorphism f CMRAMorphism (auth_map f).
CmraMorphism f CmraMorphism (auth_map f).
Proof.
split; try apply _.
- intros n [[[a|]|] b]; rewrite !auth_validN_eq; try
......
This diff is collapsed.
......@@ -39,12 +39,12 @@ Section coPset.
Qed.
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.
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.
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.
Proof. destruct mY; by rewrite /= ?right_id_L. Qed.
......@@ -112,10 +112,10 @@ Section coPset_disj.
Qed.
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.
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.
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.
......@@ -96,7 +96,8 @@ Next Obligation.
+ rewrite (conv_compl n (csum_chain_r c b')) /=. destruct (c n); naive_solver.
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.
Global Instance csum_leibniz :
LeibnizEquiv A LeibnizEquiv B LeibnizEquiv (csumC A B).
......@@ -202,7 +203,7 @@ Proof.
+ exists (Cinr c); by constructor.
Qed.
Lemma csum_cmra_mixin : CMRAMixin (csum A B).
Lemma csum_cmra_mixin : CmraMixin (csum A B).
Proof.
split.
- intros [] n; destruct 1; constructor; by ofe_subst.
......@@ -246,10 +247,10 @@ Proof.
exists (Cinr z1), (Cinr z2). by repeat constructor.
+ by exists CsumBot, CsumBot; destruct y1, y2; inversion_clear Hx'.
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 :
CMRADiscrete A CMRADiscrete B CMRADiscrete csumR.
CmraDiscrete A CmraDiscrete B CmraDiscrete csumR.
Proof.
split; first apply _.
by move=>[a|b|] HH /=; try apply cmra_discrete_valid.
......@@ -357,7 +358,7 @@ Arguments csumR : clear implicits.
(* Functor *)
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.
split; try apply _.
- intros n [a|b|]; simpl; auto using cmra_morphism_validN.
......
......@@ -50,9 +50,9 @@ Qed.
Canonical Structure dec_agreeR : cmraT :=
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.
Global Instance dec_agree_total : CMRATotal dec_agreeR.
Global Instance dec_agree_cmra_total : CmraTotal dec_agreeR.
Proof. intros x. by exists x. Qed.
(* Some properties of this CMRA *)
......
From iris.algebra Require Export cmra updates.
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 *)
mixin_dra_equivalence : Equivalence (() : relation A);
mixin_dra_op_proper : Proper (() ==> () ==> ()) ();
......@@ -24,16 +24,16 @@ Record DRAMixin A `{Equiv A, Core A, Disjoint A, Op A, Valid A} := {
mixin_dra_core_mono x y :
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_equiv : Equiv dra_car;
dra_core : Core dra_car;
dra_disjoint : Disjoint dra_car;
dra_op : Op 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_equiv : simpl never.
Arguments dra_core : simpl never.
......@@ -177,10 +177,10 @@ Qed.
Canonical Structure validityR : cmraT :=
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.
Global Instance validity_cmra_total : CMRATotal validityR.
Proof. rewrite /CMRATotal; eauto. Qed.
Global Instance validity_cmra_total : CmraTotal validityR.
Proof. rewrite /CmraTotal; eauto. Qed.
Lemma validity_update x y :
( c, x c validity_car x c y validity_car y c) x ~~> y.
......
......@@ -59,7 +59,7 @@ Proof.
- by intros []; constructor.
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.
Global Instance excl_leibniz : LeibnizEquiv A LeibnizEquiv (excl A).
Proof. by destruct 2; f_equal; apply leibniz_equiv. Qed.
......@@ -77,7 +77,7 @@ Instance excl_validN : ValidN (excl A) := λ n x,
Instance excl_pcore : PCore (excl A) := λ _, None.
Instance excl_op : Op (excl A) := λ x y, ExclBot.
Lemma excl_cmra_mixin : CMRAMixin (excl A).
Lemma excl_cmra_mixin : CmraMixin (excl A).
Proof.
split; try discriminate.
- by intros n []; destruct 1; constructor.
......@@ -89,9 +89,9 @@ Proof.
- by intros n [?|] [?|].
- intros n x [?|] [?|] ?; inversion_clear 1; eauto.
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.
(** Internalized properties *)
......@@ -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).
Proof. by intros f f' Hf; destruct 1; constructor; apply Hf. Qed.
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.
Definition exclC_map {A B} (f : A -n> B) : exclC A -n> exclC B :=
CofeMor (excl_map f).
......
......@@ -26,7 +26,7 @@ Proof.
Qed.
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.
End frac.
......
......@@ -58,13 +58,13 @@ Section frac_auth.
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.
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.
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.
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.
Proof. intros. by eapply Some_included_total, frac_auth_included. Qed.
......
......@@ -37,7 +37,7 @@ Next Obligation.
by rewrite conv_compl /=; apply reflexive_eq.
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.
(* why doesn't this go automatic? *)
Global Instance gmapC_leibniz: LeibnizEquiv A LeibnizEquiv gmapC.
......@@ -127,7 +127,7 @@ Proof.
lookup_insert_ne // lookup_partial_alter_ne.
Qed.
Lemma gmap_cmra_mixin : CMRAMixin (gmap K A).
Lemma gmap_cmra_mixin : CmraMixin (gmap K A).
Proof.
apply cmra_total_mixin.
- eauto.
......@@ -171,19 +171,19 @@ Proof.
* by rewrite lookup_partial_alter.
* by rewrite lookup_partial_alter_ne // Hm2' lookup_delete_ne.
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.
Lemma gmap_ucmra_mixin : UCMRAMixin (gmap K A).
Lemma gmap_ucmra_mixin : UcmraMixin (gmap K A).
Proof.
split.
- by intros i; rewrite lookup_empty.
- by intros m i; rewrite /= lookup_op lookup_empty (left_id_L None _).
- constructor=> i. by rewrite lookup_omap lookup_empty.
Qed.
Canonical Structure gmapUR := UCMRAT (gmap K A) gmap_ucmra_mixin.
Canonical Structure gmapUR := UcmraT (gmap K A) gmap_ucmra_mixin.
(** Internalized properties *)
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 :
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.
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.
split; try apply _.
- by intros n m ? i; rewrite lookup_fmap; apply (cmra_morphism_validN _).
......
......@@ -38,12 +38,12 @@ Section gset.
Qed.
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.
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.
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.
Proof. destruct mY; by rewrite /= ?right_id_L. Qed.
......@@ -123,12 +123,12 @@ Section gset_disj.
Qed.
Canonical Structure gset_disjR := discreteR (gset_disj K) gset_disj_ra_mixin.
Global Instance gset_disj_cmra_discrete : CMRADiscrete gset_disjR.
Global Instance gset_disj_cmra_discrete : CmraDiscrete gset_disjR.
Proof. apply discrete_cmra_discrete. Qed.
Lemma gset_disj_ucmra_mixin : UCMRAMixin (gset_disj K).
Lemma gset_disj_ucmra_mixin : UcmraMixin (gset_disj K).
Proof. split; try apply _ || done. intros [X|]; gset_disj_solve. Qed.
Canonical Structure gset_disjUR := UCMRAT (gset_disj K) gset_disj_ucmra_mixin.
Canonical Structure gset_disjUR := UcmraT (gset_disj K) gset_disj_ucmra_mixin.
Arguments op _ _ _ _ : simpl never.
......
......@@ -100,7 +100,7 @@ Section iprod_cmra.
intros [h ?]%finite_choice. by exists h.
Qed.
Lemma iprod_cmra_mixin : CMRAMixin (iprod B).
Lemma iprod_cmra_mixin : CmraMixin (iprod B).
Proof.
apply cmra_total_mixin.
- eauto.
......@@ -126,21 +126,21 @@ Section iprod_cmra.
exists (y1,y2); eauto. }
exists (λ x, gg x.1), (λ x, gg x.2). split_and!=> -?; naive_solver.
Qed.
Canonical Structure iprodR := CMRAT (iprod B) iprod_cmra_mixin.
Canonical Structure iprodR := CmraT (iprod B) iprod_cmra_mixin.
Instance iprod_unit : Unit (iprod B) := λ x, ε.
Definition iprod_lookup_empty x : ε x = ε := eq_refl.
Lemma iprod_ucmra_mixin : UCMRAMixin (iprod B).
Lemma iprod_ucmra_mixin : UcmraMixin (iprod B).
Proof.
split.
- intros x; apply ucmra_unit_valid.
- by intros f x; rewrite iprod_lookup_op left_id.
- constructor=> x. apply persistent_core, _.
Qed.
Canonical Structure iprodUR := UCMRAT (iprod B) iprod_ucmra_mixin.
Canonical Structure iprodUR := UcmraT (iprod B) iprod_ucmra_mixin.
Global Instance iprod_empty_discrete :
Global Instance iprod_unit_discrete :
( i, Discrete (ε : B i)) Discrete (ε : iprod B).
Proof. intros ? f Hf x. by apply: discrete. Qed.
......@@ -284,7 +284,7 @@ Instance iprod_map_ne `{Finite A} {B1 B2 : A → ofeT} (f : ∀ x, B1 x → B2 x
Proof. by intros ? y1 y2 Hy x; rewrite /iprod_map (Hy x). Qed.
Instance iprod_map_cmra_morphism
`{Finite A} {B1 B2 : A ucmraT} (f : x, B1 x B2 x) :
( x, CMRAMorphism (f x)) CMRAMorphism (iprod_map f).
( x, CmraMorphism (f x)) CmraMorphism (iprod_map f).
Proof.
split; first apply _.
- intros n g Hg x; rewrite /iprod_map; apply (cmra_morphism_validN (f _)), Hg.
......
......@@ -77,7 +77,7 @@ Next Obligation.
by rewrite Hcn.
Qed.
Global Instance list_ofe_discrete : OFEDiscrete A OFEDiscrete listC.
Global Instance list_ofe_discrete : OfeDiscrete A OfeDiscrete listC.
Proof. induction 2; constructor; try apply (discrete _); auto. Qed.
Global Instance nil_discrete : Discrete (@nil A).
......@@ -186,7 +186,7 @@ Section cmra.
+ exists (core x :: l3); constructor; by rewrite ?cmra_core_r.
Qed.
Definition list_cmra_mixin : CMRAMixin (list A).
Definition list_cmra_mixin : CmraMixin (list A).
Proof.
apply cmra_total_mixin.
- eauto.
......@@ -219,19 +219,19 @@ Section cmra.
(cmra_extend n x y1 y2) as (y1'&y2'&?&?&?); simplify_eq/=; auto.
exists (y1' :: l1'), (y2' :: l2'); repeat constructor; auto.
Qed.
Canonical Structure listR := CMRAT (list A) list_cmra_mixin.
Canonical Structure listR := CmraT (list A) list_cmra_mixin.
Global Instance list_unit : Unit (list A) := [].
Definition list_ucmra_mixin : UCMRAMixin (list A).
Definition list_ucmra_mixin : UcmraMixin (list A).
Proof.
split.
- constructor.
- by intros l.
- by constructor.
Qed.
Canonical Structure listUR := UCMRAT (list A) list_ucmra_mixin.
Canonical Structure listUR := UcmraT (list A) list_ucmra_mixin.
Global Instance list_cmra_discrete : CMRADiscrete A CMRADiscrete listR.
Global Instance list_cmra_discrete : CmraDiscrete A CmraDiscrete listR.
Proof.
split; [apply _|]=> l; rewrite list_lookup_valid list_lookup_validN=> Hl i.
by apply cmra_discrete_valid.
......@@ -436,7 +436,7 @@ End properties.
(** Functor *)
Instance list_fmap_cmra_morphism {A B : ucmraT} (f : A B)
`{!CMRAMorphism f} : CMRAMorphism (fmap f : list A list B).
`{!CmraMorphism f} : CmraMorphism (fmap f : list A list B).
Proof.
split; try apply _.
- intros n l. rewrite !list_lookup_validN=> Hl i. rewrite list_lookup_fmap.
......
......@@ -31,7 +31,7 @@ Section updates.
intros Hv n mz Hxv Hx; simpl in *; split; [by auto|].
by rewrite Hx -cmra_opM_assoc.
Qed.
Lemma op_local_update_discrete `{!CMRADiscrete A} x y z :
Lemma op_local_update_discrete `{!CmraDiscrete A} x y z :
( x (z x)) (x,y) ~l~> (z x, z y).
Proof.
intros; apply op_local_update=> n. by rewrite -!(cmra_discrete_valid_iff n).
......@@ -52,7 +52,7 @@ Section updates.
apply (cancelableN x); first done. by rewrite -cmra_opM_assoc.
Qed.
Lemma local_update_discrete `{!CMRADiscrete A} (x y x' y' : A) :
Lemma local_update_discrete `{!CmraDiscrete A} (x y x' y' : A) :
(x,y) ~l~> (x',y') mz, x x y ? mz x' x' y' ? mz.
Proof.
rewrite /local_update /=. setoid_rewrite <-cmra_discrete_valid_iff.
......@@ -72,7 +72,7 @@ Section updates.
+ right. exists z. apply dist_le with n; auto with lia.
+ left. apply dist_le with n; auto with lia.
Qed.
Lemma local_update_valid `{!CMRADiscrete A} x y x' y' :
Lemma local_update_valid `{!CmraDiscrete A} x y x' y' :
( x y x y y x (x,y) ~l~> (x',y')) (x,y) ~l~> (x',y').
Proof.
rewrite !(cmra_discrete_valid_iff 0)
......@@ -80,13 +80,13 @@ Section updates.
apply local_update_valid0.
Qed.
Lemma local_update_total_valid0 `{!CMRATotal A} x y x' y' :
Lemma local_update_total_valid0 `{!CmraTotal A} x y x' y' :
({0} x {0} y y {0} x (x,y) ~l~> (x',y')) (x,y) ~l~> (x',y').
Proof.
intros Hup. apply local_update_valid0=> ?? [Hx|?]; apply Hup; auto.
by rewrite Hx.
Qed.
Lemma local_update_total_valid `{!CMRATotal A, !CMRADiscrete A} x y x' y' :
Lemma local_update_total_valid `{!CmraTotal A, !CmraDiscrete A} x y x' y' :
( x y y x (x,y) ~l~> (x',y')) (x,y) ~l~> (x',y').
Proof.
rewrite !(cmra_discrete_valid_iff 0) (cmra_discrete_included_iff 0).
......@@ -108,7 +108,7 @@ Section updates_unital.
rewrite -(right_id ε op y) -(right_id ε op y'). auto.
Qed.
Lemma local_update_unital_discrete `{!CMRADiscrete A} (x y x' y' : A) :
Lemma local_update_unital_discrete `{!CmraDiscrete A} (x y x' y' : A) :
(x,y) ~l~> (x',y') z, x x y z x' x' y' z.
Proof.
rewrite local_update_discrete. split.
......
......@@ -63,7 +63,7 @@ Arguments ofe_mixin : simpl never.
(** When declaring instances of subclasses of OFE (like CMRAs and unital CMRAs)
we need Coq to *infer* the canonical OFE instance of a given type and take the
mixin out of it. This makes sure we do not use two different OFE instances in
different places (see for example the constructors [CMRAT] and [UCMRAT] in the
different places (see for example the constructors [CmraT] and [UcmraT] in the
file [cmra.v].)
In order to infer the OFE instance, we use the definition [ofe_mixin_of'] which
......@@ -105,8 +105,7 @@ Arguments discrete {_} _ {_} _ _.
Hint Mode Discrete + ! : typeclass_instances.
Instance: Params (@Discrete) 1.
Class OFEDiscrete (A : ofeT) := ofe_discrete_discrete (x : A) :> Discrete x.
Hint Mode OFEDiscrete ! : typeclass_instances.
Class OfeDiscrete (A : ofeT) := ofe_discrete_discrete (x : A) :> Discrete x.
(** OFEs with a completion *)
Record chain (A : ofeT) := {
......@@ -651,7 +650,7 @@ Section unit.
Global Program Instance unit_cofe : Cofe unitC := { compl x := () }.
Next Obligation. by repeat split; try exists 0. Qed.
Global Instance unit_ofe_discrete : OFEDiscrete unitC.
Global Instance unit_ofe_discrete : OfeDiscrete unitC.
Proof. done. Qed.
End unit.
......@@ -684,7 +683,8 @@ Section product.
Global Instance prod_discrete (x : A * B) :
Discrete (x.1) Discrete (x.2) Discrete x.
Proof. by intros ???[??]; split; apply (discrete _). Qed.