Commit 1fc3937f authored by Robbert Krebbers's avatar Robbert Krebbers

Rename uPred_const -> uPred_pure.

This is more consistent with the proofmode, where we also call it pure.
parent d59fa2f7
Pipeline #1610 passed with stage
...@@ -123,15 +123,15 @@ Instance uPred_entails_rewrite_relation M : RewriteRelation (@uPred_entails M). ...@@ -123,15 +123,15 @@ Instance uPred_entails_rewrite_relation M : RewriteRelation (@uPred_entails M).
Hint Resolve uPred_mono uPred_closed : uPred_def. Hint Resolve uPred_mono uPred_closed : uPred_def.
(** logical connectives *) (** logical connectives *)
Program Definition uPred_const_def {M} (φ : Prop) : uPred M := Program Definition uPred_pure_def {M} (φ : Prop) : uPred M :=
{| uPred_holds n x := φ |}. {| uPred_holds n x := φ |}.
Solve Obligations with done. Solve Obligations with done.
Definition uPred_const_aux : { x | x = @uPred_const_def }. by eexists. Qed. Definition uPred_pure_aux : { x | x = @uPred_pure_def }. by eexists. Qed.
Definition uPred_const {M} := proj1_sig uPred_const_aux M. Definition uPred_pure {M} := proj1_sig uPred_pure_aux M.
Definition uPred_const_eq : Definition uPred_pure_eq :
@uPred_const = @uPred_const_def := proj2_sig uPred_const_aux. @uPred_pure = @uPred_pure_def := proj2_sig uPred_pure_aux.
Instance uPred_inhabited M : Inhabited (uPred M) := populate (uPred_const True). Instance uPred_inhabited M : Inhabited (uPred M) := populate (uPred_pure True).
Program Definition uPred_and_def {M} (P Q : uPred M) : uPred M := Program Definition uPred_and_def {M} (P Q : uPred M) : uPred M :=
{| uPred_holds n x := P n x Q n x |}. {| uPred_holds n x := P n x Q n x |}.
...@@ -263,12 +263,12 @@ Notation "(⊢)" := uPred_entails (only parsing) : C_scope. ...@@ -263,12 +263,12 @@ Notation "(⊢)" := uPred_entails (only parsing) : C_scope.
Notation "P ⊣⊢ Q" := (equiv (A:=uPred _) P%I Q%I) Notation "P ⊣⊢ Q" := (equiv (A:=uPred _) P%I Q%I)
(at level 95, no associativity) : C_scope. (at level 95, no associativity) : C_scope.
Notation "(⊣⊢)" := (equiv (A:=uPred _)) (only parsing) : C_scope. Notation "(⊣⊢)" := (equiv (A:=uPred _)) (only parsing) : C_scope.
Notation "■ φ" := (uPred_const φ%C%type) Notation "■ φ" := (uPred_pure φ%C%type)
(at level 20, right associativity) : uPred_scope. (at level 20, right associativity) : uPred_scope.
Notation "x = y" := (uPred_const (x%C%type = y%C%type)) : uPred_scope. Notation "x = y" := (uPred_pure (x%C%type = y%C%type)) : uPred_scope.
Notation "x ⊥ y" := (uPred_const (x%C%type y%C%type)) : uPred_scope. Notation "x ⊥ y" := (uPred_pure (x%C%type y%C%type)) : uPred_scope.
Notation "'False'" := (uPred_const False) : uPred_scope. Notation "'False'" := (uPred_pure False) : uPred_scope.
Notation "'True'" := (uPred_const True) : uPred_scope. Notation "'True'" := (uPred_pure True) : uPred_scope.
Infix "∧" := uPred_and : uPred_scope. Infix "∧" := uPred_and : uPred_scope.
Notation "(∧)" := uPred_and (only parsing) : uPred_scope. Notation "(∧)" := uPred_and (only parsing) : uPred_scope.
Infix "∨" := uPred_or : uPred_scope. Infix "∨" := uPred_or : uPred_scope.
...@@ -308,7 +308,7 @@ Arguments persistentP {_} _ {_}. ...@@ -308,7 +308,7 @@ Arguments persistentP {_} _ {_}.
Module uPred. Module uPred.
Definition unseal := Definition unseal :=
(uPred_const_eq, uPred_and_eq, uPred_or_eq, uPred_impl_eq, uPred_forall_eq, (uPred_pure_eq, uPred_and_eq, uPred_or_eq, uPred_impl_eq, uPred_forall_eq,
uPred_exist_eq, uPred_eq_eq, uPred_sep_eq, uPred_wand_eq, uPred_always_eq, uPred_exist_eq, uPred_eq_eq, uPred_sep_eq, uPred_wand_eq, uPred_always_eq,
uPred_later_eq, uPred_ownM_eq, uPred_valid_eq). uPred_later_eq, uPred_ownM_eq, uPred_valid_eq).
Ltac unseal := rewrite !unseal /=. Ltac unseal := rewrite !unseal /=.
...@@ -353,7 +353,7 @@ Lemma entails_equiv_r (P Q R : uPred M) : (P ⊢ Q) → (Q ⊣⊢ R) → (P ⊢ ...@@ -353,7 +353,7 @@ Lemma entails_equiv_r (P Q R : uPred M) : (P ⊢ Q) → (Q ⊣⊢ R) → (P ⊢
Proof. by intros ? <-. Qed. Proof. by intros ? <-. Qed.
(** Non-expansiveness and setoid morphisms *) (** Non-expansiveness and setoid morphisms *)
Global Instance const_proper : Proper (iff ==> ()) (@uPred_const M). Global Instance pure_proper : Proper (iff ==> ()) (@uPred_pure M).
Proof. intros φ1 φ2 Hφ. by unseal; split=> -[|n] ?; try apply Hφ. Qed. Proof. intros φ1 φ2 Hφ. by unseal; split=> -[|n] ?; try apply Hφ. Qed.
Global Instance and_ne n : Proper (dist n ==> dist n ==> dist n) (@uPred_and M). Global Instance and_ne n : Proper (dist n ==> dist n ==> dist n) (@uPred_and M).
Proof. Proof.
...@@ -459,9 +459,9 @@ Global Instance iff_proper : ...@@ -459,9 +459,9 @@ Global Instance iff_proper :
Proper (() ==> () ==> ()) (@uPred_iff M) := ne_proper_2 _. Proper (() ==> () ==> ()) (@uPred_iff M) := ne_proper_2 _.
(** Introduction and elimination rules *) (** Introduction and elimination rules *)
Lemma const_intro φ P : φ P φ. Lemma pure_intro φ P : φ P φ.
Proof. by intros ?; unseal; split. Qed. Proof. by intros ?; unseal; split. Qed.
Lemma const_elim φ Q R : (Q φ) (φ Q R) Q R. Lemma pure_elim φ Q R : (Q φ) (φ Q R) Q R.
Proof. Proof.
unseal; intros HQP HQR; split=> n x ??; apply HQR; first eapply HQP; eauto. unseal; intros HQP HQR; split=> n x ??; apply HQR; first eapply HQP; eauto.
Qed. Qed.
...@@ -517,9 +517,9 @@ Qed. ...@@ -517,9 +517,9 @@ Qed.
(* Derived logical stuff *) (* Derived logical stuff *)
Lemma False_elim P : False P. Lemma False_elim P : False P.
Proof. by apply (const_elim False). Qed. Proof. by apply (pure_elim False). Qed.
Lemma True_intro P : P True. Lemma True_intro P : P True.
Proof. by apply const_intro. Qed. Proof. by apply pure_intro. Qed.
Lemma and_elim_l' P Q R : (P R) P Q R. Lemma and_elim_l' P Q R : (P R) P Q R.
Proof. by rewrite and_elim_l. Qed. Proof. by rewrite and_elim_l. Qed.
Lemma and_elim_r' P Q R : (Q R) P Q R. Lemma and_elim_r' P Q R : (Q R) P Q R.
...@@ -562,8 +562,8 @@ Qed. ...@@ -562,8 +562,8 @@ Qed.
Lemma equiv_iff P Q : (P Q) True P Q. Lemma equiv_iff P Q : (P Q) True P Q.
Proof. intros ->; apply iff_refl. Qed. Proof. intros ->; apply iff_refl. Qed.
Lemma const_mono φ1 φ2 : (φ1 φ2) φ1 φ2. Lemma pure_mono φ1 φ2 : (φ1 φ2) φ1 φ2.
Proof. intros; apply const_elim with φ1; eauto using const_intro. Qed. Proof. intros; apply pure_elim with φ1; eauto using pure_intro. Qed.
Lemma and_mono P P' Q Q' : (P Q) (P' Q') P P' Q Q'. Lemma and_mono P P' Q Q' : (P Q) (P' Q') P P' Q Q'.
Proof. auto. Qed. Proof. auto. Qed.
Lemma and_mono_l P P' Q : (P Q) P P' Q P'. Lemma and_mono_l P P' Q : (P Q) P P' Q P'.
...@@ -589,8 +589,8 @@ Qed. ...@@ -589,8 +589,8 @@ Qed.
Lemma exist_mono {A} (Φ Ψ : A uPred M) : Lemma exist_mono {A} (Φ Ψ : A uPred M) :
( a, Φ a Ψ a) ( a, Φ a) a, Ψ a. ( a, Φ a Ψ a) ( a, Φ a) a, Ψ a.
Proof. intros HΦ. apply exist_elim=> a; rewrite (HΦ a); apply exist_intro. Qed. Proof. intros HΦ. apply exist_elim=> a; rewrite (HΦ a); apply exist_intro. Qed.
Global Instance const_mono' : Proper (impl ==> ()) (@uPred_const M). Global Instance pure_mono' : Proper (impl ==> ()) (@uPred_pure M).
Proof. intros φ1 φ2; apply const_mono. Qed. Proof. intros φ1 φ2; apply pure_mono. Qed.
Global Instance and_mono' : Proper (() ==> () ==> ()) (@uPred_and M). Global Instance and_mono' : Proper (() ==> () ==> ()) (@uPred_and M).
Proof. by intros P P' HP Q Q' HQ; apply and_mono. Qed. Proof. by intros P P' HP Q Q' HQ; apply and_mono. Qed.
Global Instance and_flip_mono' : Global Instance and_flip_mono' :
...@@ -673,18 +673,18 @@ Proof. ...@@ -673,18 +673,18 @@ Proof.
rewrite -(comm _ P) and_exist_l. apply exist_proper=>a. by rewrite comm. rewrite -(comm _ P) and_exist_l. apply exist_proper=>a. by rewrite comm.
Qed. Qed.
Lemma const_intro_l φ Q R : φ ( φ Q R) Q R. Lemma pure_intro_l φ Q R : φ ( φ Q R) Q R.
Proof. intros ? <-; auto using const_intro. Qed. Proof. intros ? <-; auto using pure_intro. Qed.
Lemma const_intro_r φ Q R : φ (Q φ R) Q R. Lemma pure_intro_r φ Q R : φ (Q φ R) Q R.
Proof. intros ? <-; auto using const_intro. Qed. Proof. intros ? <-; auto using pure_intro. Qed.
Lemma const_intro_impl φ Q R : φ (Q φ R) Q R. Lemma pure_intro_impl φ Q R : φ (Q φ R) Q R.
Proof. intros ? ->. eauto using const_intro_l, impl_elim_r. Qed. Proof. intros ? ->. eauto using pure_intro_l, impl_elim_r. Qed.
Lemma const_elim_l φ Q R : (φ Q R) φ Q R. Lemma pure_elim_l φ Q R : (φ Q R) φ Q R.
Proof. intros; apply const_elim with φ; eauto. Qed. Proof. intros; apply pure_elim with φ; eauto. Qed.
Lemma const_elim_r φ Q R : (φ Q R) Q φ R. Lemma pure_elim_r φ Q R : (φ Q R) Q φ R.
Proof. intros; apply const_elim with φ; eauto. Qed. Proof. intros; apply pure_elim with φ; eauto. Qed.
Lemma const_equiv (φ : Prop) : φ φ True. Lemma pure_equiv (φ : Prop) : φ φ True.
Proof. intros; apply (anti_symm _); auto using const_intro. Qed. Proof. intros; apply (anti_symm _); auto using pure_intro. Qed.
Lemma eq_refl' {A : cofeT} (a : A) P : P a a. Lemma eq_refl' {A : cofeT} (a : A) P : P a a.
Proof. rewrite (True_intro P). apply eq_refl. Qed. Proof. rewrite (True_intro P). apply eq_refl. Qed.
...@@ -822,10 +822,10 @@ Lemma sep_and P Q : (P ★ Q) ⊢ (P ∧ Q). ...@@ -822,10 +822,10 @@ Lemma sep_and P Q : (P ★ Q) ⊢ (P ∧ Q).
Proof. auto. Qed. Proof. auto. Qed.
Lemma impl_wand P Q : (P Q) P - Q. Lemma impl_wand P Q : (P Q) P - Q.
Proof. apply wand_intro_r, impl_elim with P; auto. Qed. Proof. apply wand_intro_r, impl_elim with P; auto. Qed.
Lemma const_elim_sep_l φ Q R : (φ Q R) φ Q R. Lemma pure_elim_sep_l φ Q R : (φ Q R) φ Q R.
Proof. intros; apply const_elim with φ; eauto. Qed. Proof. intros; apply pure_elim with φ; eauto. Qed.
Lemma const_elim_sep_r φ Q R : (φ Q R) Q φ R. Lemma pure_elim_sep_r φ Q R : (φ Q R) Q φ R.
Proof. intros; apply const_elim with φ; eauto. Qed. Proof. intros; apply pure_elim with φ; eauto. Qed.
Global Instance sep_False : LeftAbsorb () False%I (@uPred_sep M). Global Instance sep_False : LeftAbsorb () False%I (@uPred_sep M).
Proof. intros P; apply (anti_symm _); auto. Qed. Proof. intros P; apply (anti_symm _); auto. Qed.
...@@ -858,7 +858,7 @@ Lemma sep_forall_r {A} (Φ : A → uPred M) Q : (∀ a, Φ a) ★ Q ⊢ ∀ a, ...@@ -858,7 +858,7 @@ Lemma sep_forall_r {A} (Φ : A → uPred M) Q : (∀ a, Φ a) ★ Q ⊢ ∀ a,
Proof. by apply forall_intro=> a; rewrite forall_elim. Qed. Proof. by apply forall_intro=> a; rewrite forall_elim. Qed.
(* Always *) (* Always *)
Lemma always_const φ : φ φ. Lemma always_pure φ : φ φ.
Proof. by unseal. Qed. Proof. by unseal. Qed.
Lemma always_elim P : P P. Lemma always_elim P : P P.
Proof. Proof.
...@@ -910,7 +910,7 @@ Proof. ...@@ -910,7 +910,7 @@ Proof.
apply (anti_symm ()); auto using always_elim. apply (anti_symm ()); auto using always_elim.
apply (eq_rewrite a b (λ b, (a b))%I); auto. apply (eq_rewrite a b (λ b, (a b))%I); auto.
{ intros n; solve_proper. } { intros n; solve_proper. }
rewrite -(eq_refl a) always_const; auto. rewrite -(eq_refl a) always_pure; auto.
Qed. Qed.
Lemma always_and_sep P Q : (P Q) (P Q). Lemma always_and_sep P Q : (P Q) (P Q).
Proof. apply (anti_symm ()); auto using always_and_sep_1. Qed. Proof. apply (anti_symm ()); auto using always_and_sep_1. Qed.
...@@ -1098,7 +1098,7 @@ Proof. ...@@ -1098,7 +1098,7 @@ Proof.
apply HP, uPred_closed with n; eauto using cmra_validN_le. apply HP, uPred_closed with n; eauto using cmra_validN_le.
Qed. Qed.
Global Instance const_timeless φ : TimelessP ( φ : uPred M)%I. Global Instance pure_timeless φ : TimelessP ( φ : uPred M)%I.
Proof. by apply timelessP_spec; unseal => -[|n] x. Qed. Proof. by apply timelessP_spec; unseal => -[|n] x. Qed.
Global Instance valid_timeless {A : cmraT} `{CMRADiscrete A} (a : A) : Global Instance valid_timeless {A : cmraT} `{CMRADiscrete A} (a : A) :
TimelessP ( a : uPred M)%I. TimelessP ( a : uPred M)%I.
...@@ -1141,7 +1141,7 @@ Qed. ...@@ -1141,7 +1141,7 @@ Qed.
Global Instance always_timeless P : TimelessP P TimelessP ( P). Global Instance always_timeless P : TimelessP P TimelessP ( P).
Proof. Proof.
intros ?; rewrite /TimelessP. intros ?; rewrite /TimelessP.
by rewrite -always_const -!always_later -always_or; apply always_mono. by rewrite -always_pure -!always_later -always_or; apply always_mono.
Qed. Qed.
Global Instance always_if_timeless p P : TimelessP P TimelessP (?p P). Global Instance always_if_timeless p P : TimelessP P TimelessP (?p P).
Proof. destruct p; apply _. Qed. Proof. destruct p; apply _. Qed.
...@@ -1157,8 +1157,8 @@ Proof. ...@@ -1157,8 +1157,8 @@ Proof.
Qed. Qed.
(* Persistence *) (* Persistence *)
Global Instance const_persistent φ : PersistentP ( φ : uPred M)%I. Global Instance pure_persistent φ : PersistentP ( φ : uPred M)%I.
Proof. by rewrite /PersistentP always_const. Qed. Proof. by rewrite /PersistentP always_pure. Qed.
Global Instance always_persistent P : PersistentP ( P). Global Instance always_persistent P : PersistentP ( P).
Proof. by intros; apply always_intro'. Qed. Proof. by intros; apply always_intro'. Qed.
Global Instance and_persistent P Q : Global Instance and_persistent P Q :
...@@ -1210,7 +1210,7 @@ Proof. by rewrite -(always_always Q); apply always_entails_r'. Qed. ...@@ -1210,7 +1210,7 @@ Proof. by rewrite -(always_always Q); apply always_entails_r'. Qed.
End uPred_logic. End uPred_logic.
(* Hint DB for the logic *) (* Hint DB for the logic *)
Hint Resolve const_intro. Hint Resolve pure_intro.
Hint Resolve or_elim or_intro_l' or_intro_r' : I. Hint Resolve or_elim or_intro_l' or_intro_r' : I.
Hint Resolve and_intro and_elim_l' and_elim_r' : I. Hint Resolve and_intro and_elim_l' and_elim_r' : I.
Hint Resolve always_mono : I. Hint Resolve always_mono : I.
......
...@@ -223,7 +223,7 @@ Section gmap. ...@@ -223,7 +223,7 @@ Section gmap.
( [ map] kx m, Φ k x) ([ map] kx m, Φ k x). ( [ map] kx m, Φ k x) ([ map] kx m, Φ k x).
Proof. Proof.
rewrite /uPred_big_sepM. rewrite /uPred_big_sepM.
induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?always_const //. induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?always_pure //.
by rewrite always_sep IH. by rewrite always_sep IH.
Qed. Qed.
...@@ -237,14 +237,14 @@ Section gmap. ...@@ -237,14 +237,14 @@ Section gmap.
Proof. Proof.
intros. apply (anti_symm _). intros. apply (anti_symm _).
{ apply forall_intro=> k; apply forall_intro=> x. { apply forall_intro=> k; apply forall_intro=> x.
apply impl_intro_l, const_elim_l=> ?; by apply big_sepM_lookup. } apply impl_intro_l, pure_elim_l=> ?; by apply big_sepM_lookup. }
rewrite /uPred_big_sepM. setoid_rewrite <-elem_of_map_to_list. rewrite /uPred_big_sepM. setoid_rewrite <-elem_of_map_to_list.
induction (map_to_list m) as [|[i x] l IH]; csimpl; auto. induction (map_to_list m) as [|[i x] l IH]; csimpl; auto.
rewrite -always_and_sep_l; apply and_intro. rewrite -always_and_sep_l; apply and_intro.
- rewrite (forall_elim i) (forall_elim x) const_equiv; last by left. - rewrite (forall_elim i) (forall_elim x) pure_equiv; last by left.
by rewrite True_impl. by rewrite True_impl.
- rewrite -IH. apply forall_mono=> k; apply forall_mono=> y. - rewrite -IH. apply forall_mono=> k; apply forall_mono=> y.
apply impl_intro_l, const_elim_l=> ?. rewrite const_equiv; last by right. apply impl_intro_l, pure_elim_l=> ?. rewrite pure_equiv; last by right.
by rewrite True_impl. by rewrite True_impl.
Qed. Qed.
...@@ -253,7 +253,7 @@ Section gmap. ...@@ -253,7 +253,7 @@ Section gmap.
[ map] kx m, Ψ k x. [ map] kx m, Ψ k x.
Proof. Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall. rewrite always_and_sep_l. do 2 setoid_rewrite always_forall.
setoid_rewrite always_impl; setoid_rewrite always_const. setoid_rewrite always_impl; setoid_rewrite always_pure.
rewrite -big_sepM_forall -big_sepM_sepM. apply big_sepM_mono; auto=> k x ?. rewrite -big_sepM_forall -big_sepM_sepM. apply big_sepM_mono; auto=> k x ?.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -always_wand_impl always_elim wand_elim_l.
Qed. Qed.
...@@ -345,7 +345,7 @@ Section gset. ...@@ -345,7 +345,7 @@ Section gset.
Lemma big_sepS_always Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y). Lemma big_sepS_always Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y).
Proof. Proof.
rewrite /uPred_big_sepS. rewrite /uPred_big_sepS.
induction (elements X) as [|x l IH]; csimpl; first by rewrite ?always_const. induction (elements X) as [|x l IH]; csimpl; first by rewrite ?always_pure.
by rewrite always_sep IH. by rewrite always_sep IH.
Qed. Qed.
...@@ -358,13 +358,13 @@ Section gset. ...@@ -358,13 +358,13 @@ Section gset.
Proof. Proof.
intros. apply (anti_symm _). intros. apply (anti_symm _).
{ apply forall_intro=> x. { apply forall_intro=> x.
apply impl_intro_l, const_elim_l=> ?; by apply big_sepS_elem_of. } apply impl_intro_l, pure_elim_l=> ?; by apply big_sepS_elem_of. }
rewrite /uPred_big_sepS. setoid_rewrite <-elem_of_elements. rewrite /uPred_big_sepS. setoid_rewrite <-elem_of_elements.
induction (elements X) as [|x l IH]; csimpl; auto. induction (elements X) as [|x l IH]; csimpl; auto.
rewrite -always_and_sep_l; apply and_intro. rewrite -always_and_sep_l; apply and_intro.
- rewrite (forall_elim x) const_equiv; last by left. by rewrite True_impl. - rewrite (forall_elim x) pure_equiv; last by left. by rewrite True_impl.
- rewrite -IH. apply forall_mono=> y. - rewrite -IH. apply forall_mono=> y.
apply impl_intro_l, const_elim_l=> ?. rewrite const_equiv; last by right. apply impl_intro_l, pure_elim_l=> ?. rewrite pure_equiv; last by right.
by rewrite True_impl. by rewrite True_impl.
Qed. Qed.
...@@ -372,7 +372,7 @@ Section gset. ...@@ -372,7 +372,7 @@ Section gset.
( x, (x X) Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x. ( x, (x X) Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x.
Proof. Proof.
rewrite always_and_sep_l always_forall. rewrite always_and_sep_l always_forall.
setoid_rewrite always_impl; setoid_rewrite always_const. setoid_rewrite always_impl; setoid_rewrite always_pure.
rewrite -big_sepS_forall -big_sepS_sepS. apply big_sepS_mono; auto=> x ?. rewrite -big_sepS_forall -big_sepS_sepS. apply big_sepS_mono; auto=> x ?.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -always_wand_impl always_elim wand_elim_l.
Qed. Qed.
......
...@@ -136,12 +136,12 @@ Section heap. ...@@ -136,12 +136,12 @@ Section heap.
l {q1} v1 l {q2} v2 v1 = v2 l {q1+q2} v1. l {q1} v1 l {q2} v2 v1 = v2 l {q1+q2} v1.
Proof. Proof.
destruct (decide (v1 = v2)) as [->|]. destruct (decide (v1 = v2)) as [->|].
{ by rewrite heap_mapsto_op_eq const_equiv // left_id. } { by rewrite heap_mapsto_op_eq pure_equiv // left_id. }
rewrite heap_mapsto_eq -auth_own_op op_singleton pair_op dec_agree_ne //. rewrite heap_mapsto_eq -auth_own_op op_singleton pair_op dec_agree_ne //.
apply (anti_symm ()); last by apply const_elim_l. apply (anti_symm ()); last by apply pure_elim_l.
rewrite auth_own_valid gmap_validI (forall_elim l) lookup_singleton. rewrite auth_own_valid gmap_validI (forall_elim l) lookup_singleton.
rewrite option_validI prod_validI frac_validI discrete_valid. rewrite option_validI prod_validI frac_validI discrete_valid.
by apply const_elim_r. by apply pure_elim_r.
Qed. Qed.
Lemma heap_mapsto_op_split l q v : l {q} v (l {q/2} v l {q/2} v). Lemma heap_mapsto_op_split l q v : l {q} v (l {q/2} v l {q/2} v).
......
...@@ -19,5 +19,5 @@ Lemma wp_assert' {Σ} (Φ : val → iProp heap_lang Σ) e : ...@@ -19,5 +19,5 @@ Lemma wp_assert' {Σ} (Φ : val → iProp heap_lang Σ) e :
WP e {{ v, v = #true Φ #() }} WP Assert e {{ Φ }}. WP e {{ v, v = #true Φ #() }} WP Assert e {{ Φ }}.
Proof. Proof.
rewrite /Assert. wp_focus e; apply wp_mono=>v. rewrite /Assert. wp_focus e; apply wp_mono=>v.
apply uPred.const_elim_l=>->. apply wp_assert. apply uPred.pure_elim_l=>->. apply wp_assert.
Qed. Qed.
...@@ -54,8 +54,8 @@ Proof. ...@@ -54,8 +54,8 @@ Proof.
eapply pvs_ownG_updateP, (iprod_singleton_updateP_empty (inG_id i)); eapply pvs_ownG_updateP, (iprod_singleton_updateP_empty (inG_id i));
first (eapply alloc_updateP_strong', cmra_transport_valid, Ha); first (eapply alloc_updateP_strong', cmra_transport_valid, Ha);
naive_solver. naive_solver.
- apply exist_elim=>m; apply const_elim_l=>-[γ [Hfresh ->]]. - apply exist_elim=>m; apply pure_elim_l=>-[γ [Hfresh ->]].
by rewrite !own_eq /own_def -(exist_intro γ) const_equiv // left_id. by rewrite !own_eq /own_def -(exist_intro γ) pure_equiv // left_id.
Qed. Qed.
Lemma own_alloc a E : a True ={E}=> γ, own γ a. Lemma own_alloc a E : a True ={E}=> γ, own γ a.
Proof. Proof.
...@@ -70,14 +70,14 @@ Proof. ...@@ -70,14 +70,14 @@ Proof.
- eapply pvs_ownG_updateP, iprod_singleton_updateP; - eapply pvs_ownG_updateP, iprod_singleton_updateP;
first by (eapply singleton_updateP', cmra_transport_updateP', Ha). first by (eapply singleton_updateP', cmra_transport_updateP', Ha).
naive_solver. naive_solver.
- apply exist_elim=>m; apply const_elim_l=>-[a' [-> HP]]. - apply exist_elim=>m; apply pure_elim_l=>-[a' [-> HP]].
rewrite -(exist_intro a'). by apply and_intro; [apply const_intro|]. rewrite -(exist_intro a'). by apply and_intro; [apply pure_intro|].
Qed. Qed.
Lemma own_update γ a a' E : a ~~> a' own γ a ={E}=> own γ a'. Lemma own_update γ a a' E : a ~~> a' own γ a ={E}=> own γ a'.
Proof. Proof.
intros; rewrite (own_updateP (a' =)); last by apply cmra_update_updateP. intros; rewrite (own_updateP (a' =)); last by apply cmra_update_updateP.
by apply pvs_mono, exist_elim=> a''; apply const_elim_l=> ->. by apply pvs_mono, exist_elim=> a''; apply pure_elim_l=> ->.
Qed. Qed.
End global. End global.
......
...@@ -76,9 +76,9 @@ Proof. ...@@ -76,9 +76,9 @@ Proof.
apply forall_intro=>e2'; apply forall_intro=>σ2'. apply forall_intro=>e2'; apply forall_intro=>σ2'.
apply forall_intro=>ef; apply wand_intro_l. apply forall_intro=>ef; apply wand_intro_l.
rewrite always_and_sep_l -assoc -always_and_sep_l. rewrite always_and_sep_l -assoc -always_and_sep_l.
apply const_elim_l=>-[[v2 Hv] ?] /=. apply pure_elim_l=>-[[v2 Hv] ?] /=.
rewrite -pvs_intro. rewrite -pvs_intro.
rewrite (forall_elim v2) (forall_elim σ2') (forall_elim ef) const_equiv //. rewrite (forall_elim v2) (forall_elim σ2') (forall_elim ef) pure_equiv //.
rewrite left_id wand_elim_r -(wp_value _ _ e2' v2) //. rewrite left_id wand_elim_r -(wp_value _ _ e2' v2) //.
by erewrite of_to_val. by erewrite of_to_val.
Qed. Qed.
...@@ -96,7 +96,7 @@ Proof. ...@@ -96,7 +96,7 @@ Proof.
apply forall_intro=>e2'; apply forall_intro=>σ2'; apply forall_intro=>ef'. apply forall_intro=>e2'; apply forall_intro=>σ2'; apply forall_intro=>ef'.
apply wand_intro_l. apply wand_intro_l.
rewrite always_and_sep_l -assoc -always_and_sep_l to_of_val. rewrite always_and_sep_l -assoc -always_and_sep_l to_of_val.
apply const_elim_l=>-[-> [[->] ->]] /=. by rewrite wand_elim_r. apply pure_elim_l=>-[-> [[->] ->]] /=. by rewrite wand_elim_r.
Qed. Qed.
Lemma wp_lift_pure_det_step {E Φ} e1 e2 ef : Lemma wp_lift_pure_det_step {E Φ} e1 e2 ef :
...@@ -108,6 +108,6 @@ Proof. ...@@ -108,6 +108,6 @@ Proof.
intros. intros.
rewrite -(wp_lift_pure_step E (λ e2' ef', e2 = e2' ef = ef') _ e1) //=. rewrite -(wp_lift_pure_step E (λ e2' ef', e2 = e2' ef = ef') _ e1) //=.
apply later_mono, forall_intro=>e'; apply forall_intro=>ef'. apply later_mono, forall_intro=>e'; apply forall_intro=>ef'.
by apply impl_intro_l, const_elim_l=>-[-> ->]. by apply impl_intro_l, pure_elim_l=>-[-> ->].
Qed. Qed.
End lifting. End lifting.
...@@ -224,7 +224,7 @@ Proof. auto using pvs_mask_frame'. Qed. ...@@ -224,7 +224,7 @@ Proof. auto using pvs_mask_frame'. Qed.
Lemma pvs_ownG_update E m m' : m ~~> m' ownG m ={E}=> ownG m'. Lemma pvs_ownG_update E m m' : m ~~> m' ownG m ={E}=> ownG m'.
Proof. Proof.
intros; rewrite (pvs_ownG_updateP E _ (m' =)); last by apply cmra_update_updateP. intros; rewrite (pvs_ownG_updateP E _ (m' =)); last by apply cmra_update_updateP.
by apply pvs_mono, uPred.exist_elim=> m''; apply uPred.const_elim_l=> ->. by apply pvs_mono, uPred.exist_elim=> m''; apply uPred.pure_elim_l=> ->.
Qed. Qed.
End pvs. End pvs.
......
...@@ -117,15 +117,15 @@ Qed. ...@@ -117,15 +117,15 @@ Qed.
Lemma envs_lookup_sound Δ i p P : Lemma envs_lookup_sound Δ i p P :
envs_lookup i Δ = Some (p,P) Δ ?p P envs_delete i p Δ. envs_lookup i Δ = Some (p,P) Δ ?p P envs_delete i p Δ.
Proof. Proof.
rewrite /envs_lookup /envs_delete /of_envs=>?; apply const_elim_sep_l=> Hwf. rewrite /envs_lookup /envs_delete /of_envs=>?; apply pure_elim_sep_l=> Hwf.
destruct Δ as [Γp Γs], (Γp !! i) eqn:?; simplify_eq/=. destruct Δ as [Γp Γs], (Γp !! i) eqn:?; simplify_eq/=.
- rewrite (env_lookup_perm Γp) //= always_and_sep always_sep. - rewrite (env_lookup_perm Γp) //= always_and_sep always_sep.
ecancel [ [] _; P; [] _]%I; apply const_intro. ecancel [ [] _; P; [] _]%I; apply pure_intro.
destruct Hwf; constructor; destruct Hwf; constructor;
naive_solver eauto using env_delete_wf, env_delete_fresh. naive_solver eauto using env_delete_wf, env_delete_fresh.
- destruct (Γs !! i) eqn:?; simplify_eq/=. - destruct (Γs !! i) eqn:?; simplify_eq/=.
rewrite (env_lookup_perm Γs) //=. rewrite (env_lookup_perm Γs) //=.
ecancel [ [] _; P; [] _]%I; apply const_intro. ecancel [ [] _; P; [] _]%I; apply pure_intro.
destruct Hwf; constructor; destruct Hwf; constructor;
naive_solver eauto using env_delete_wf, env_delete_fresh. naive_solver eauto using env_delete_wf, env_delete_fresh.
Qed. Qed.
...@@ -141,13 +141,13 @@ Qed. ...@@ -141,13 +141,13 @@ Qed.
Lemma envs_lookup_split Δ i p P : Lemma envs_lookup_split Δ i p P :
envs_lookup i Δ = Some (p,P) Δ ?p P (?p P - Δ). envs_lookup i Δ = Some (p,P) Δ ?p P (?p P - Δ).
Proof. Proof.
rewrite /envs_lookup /of_envs=>?; apply const_elim_sep_l=> Hwf. rewrite /envs_lookup /of_envs=>?; apply pure_elim_sep_l=> Hwf.
destruct Δ as [Γp Γs], (Γp !! i) eqn:?; simplify_eq/=. destruct Δ as [Γp Γs], (Γp !! i) eqn:?; simplify_eq/=.
- rewrite (env_lookup_perm Γp) //= always_and_sep always_sep. - rewrite (env_lookup_perm Γp) //= always_and_sep always_sep.
rewrite const_equiv // left_id. rewrite pure_equiv // left_id.
cancel [ P]%I. apply wand_intro_l. solve_sep_entails. cancel [ P]%I. apply wand_intro_l. solve_sep_entails.
- destruct (Γs !! i) eqn:?; simplify_eq/=. - destruct (Γs !! i) eqn:?; simplify_eq/=.
rewrite (env_lookup_perm Γs) //=. rewrite const_equiv // left_id. rewrite (env_lookup_perm Γs) //=. rewrite pure_equiv // left_id.
cancel [P]. apply wand_intro_l. solve_sep_entails. cancel [P]. apply wand_intro_l. solve_sep_entails.
Qed. Qed.
...@@ -160,11 +160,11 @@ Proof. intros [? ->]%envs_lookup_delete_Some. by apply envs_lookup_sound'. Qed. ...@@ -160,11 +160,11 @@ Proof. intros [? ->]%envs_lookup_delete_Some. by apply envs_lookup_sound'. Qed.
Lemma envs_app_sound Δ Δ' p Γ : envs_app p Γ Δ = Some Δ' Δ ?p [] Γ - Δ'. Lemma envs_app_sound Δ Δ' p Γ : envs_app p Γ Δ = Some Δ' Δ ?p [] Γ - Δ'.
Proof. Proof.
rewrite /of_envs /envs_app=> ?; apply const_elim_sep_l=> Hwf. rewrite /of_envs /envs_app=> ?; apply pure_elim_sep_l=> Hwf.
destruct Δ as [Γp Γs], p; simplify_eq/=. destruct Δ as [Γp Γs], p; simplify_eq/=.
- destruct (env_app Γ Γs) eqn:Happ, - destruct (env_app Γ Γs) eqn:Happ,
(env_app Γ Γp) as [Γp'|] eqn:?; simplify_eq/=. (env_app Γ Γp) as [Γp'|] eqn:?; simplify_eq/=.
apply wand_intro_l, sep_intro_True_l; [apply const_intro|]. apply wand_intro_l, sep_intro_True_l; [apply pure_intro|].
+ destruct Hwf; constructor; simpl; eauto using env_app_wf. + destruct Hwf; constructor; simpl; eauto using env_app_wf.
intros j. apply (env_app_disjoint _ _ _ j) in Happ. intros j. apply (env_app_disjoint _ _ _ j) in Happ.
naive_solver eauto using env_app_fresh. naive_solver eauto using env_app_fresh.
...@@ -173,7 +173,7 @@ Proof. ...@@ -173,7 +173,7 @@ Proof.
solve_sep_entails. solve_sep_entails.
- destruct (env_app Γ Γp) eqn:Happ, - destruct (env_app Γ Γp) eqn:Happ,
(env_app Γ Γs) as [Γs'|] eqn:?; simplify_eq/=. (env_app Γ Γs) as [Γs'|] eqn:?; simplify_eq/=.
apply wand_intro_l, sep_intro_True_l; [apply const_intro|]. apply wand_intro_l, sep_intro_True_l; [apply pure_intro|].
+ destruct Hwf; constructor; simpl; eauto using env_app_wf. + destruct Hwf; constructor; simpl; eauto using env_app_wf.
intros j. apply (env_app_disjoint _ _ _ j) in Happ. intros j. apply (env_app_disjoint _ _ _ j) in Happ.
naive_solver eauto using env_app_fresh.