Commit 143fbc52 authored by Robbert Krebbers's avatar Robbert Krebbers

Prove that the dec_agree CMRA is total.

parent 59829441
...@@ -31,21 +31,19 @@ Instance dec_agree_pcore : PCore (dec_agree A) := Some. ...@@ -31,21 +31,19 @@ Instance dec_agree_pcore : PCore (dec_agree A) := Some.
Definition dec_agree_ra_mixin : RAMixin (dec_agree A). Definition dec_agree_ra_mixin : RAMixin (dec_agree A).
Proof. Proof.
split. apply ra_total_mixin; apply _ || eauto.
- apply _.
- intros x y cx ? [=<-]; eauto.
- apply _.
- intros [?|] [?|] [?|]; by repeat (simplify_eq/= || case_match). - intros [?|] [?|] [?|]; by repeat (simplify_eq/= || case_match).
- intros [?|] [?|]; by repeat (simplify_eq/= || case_match). - intros [?|] [?|]; by repeat (simplify_eq/= || case_match).
- intros [?|] ? [=<-]; by repeat (simplify_eq/= || case_match).
- intros [?|]; by repeat (simplify_eq/= || case_match). - intros [?|]; by repeat (simplify_eq/= || case_match).
- intros [?|] [?|] ?? [=<-]; eauto.
- by intros [?|] [?|] ?. - by intros [?|] [?|] ?.
Qed. 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_total : CMRATotal dec_agreeR.
Proof. intros x. by exists x. Qed.
(* Some properties of this CMRA *) (* Some properties of this CMRA *)
Global Instance dec_agree_persistent (x : dec_agreeR) : Persistent x. Global Instance dec_agree_persistent (x : dec_agreeR) : Persistent x.
Proof. by constructor. Qed. Proof. by constructor. Qed.
...@@ -59,8 +57,10 @@ Proof. destruct x; by rewrite /= ?decide_True. Qed. ...@@ -59,8 +57,10 @@ Proof. destruct x; by rewrite /= ?decide_True. Qed.
Lemma dec_agree_op_inv (x1 x2 : dec_agree A) : (x1 x2) x1 = x2. Lemma dec_agree_op_inv (x1 x2 : dec_agree A) : (x1 x2) x1 = x2.
Proof. destruct x1, x2; by repeat (simplify_eq/= || case_match). Qed. Proof. destruct x1, x2; by repeat (simplify_eq/= || case_match). Qed.
Lemma DecAgree_included a b : DecAgree a DecAgree b a = b. Lemma DecAgree_included a b : DecAgree a DecAgree b a = b.
Proof. intros [[c|] [=]%leibniz_equiv_iff]. by simplify_option_eq. Qed. Proof.
split. intros [[c|] [=]%leibniz_equiv]. by simplify_option_eq. by intros ->.
Qed.
End dec_agree. End dec_agree.
Arguments dec_agreeC : clear implicits. Arguments dec_agreeC : clear implicits.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment