Commit b6a32bbb authored by Ralf Jung's avatar Ralf Jung

derive that when we obtain validity of an ownG, we can keep ownership

parent e241324a
...@@ -55,6 +55,8 @@ Proof. ...@@ -55,6 +55,8 @@ Proof.
Qed. Qed.
Lemma ownG_valid m : (ownG m) ( m). Lemma ownG_valid m : (ownG m) ( m).
Proof. by rewrite /ownG uPred.own_valid; apply uPred.valid_mono=> n [? []]. Qed. Proof. by rewrite /ownG uPred.own_valid; apply uPred.valid_mono=> n [? []]. Qed.
Lemma ownG_valid_r m : (ownG m) (ownG m m).
Proof. apply uPred.always_entails_r', ownG_valid; by apply _. Qed.
Global Instance ownG_timeless m : Timeless m TimelessP (ownG m). Global Instance ownG_timeless m : Timeless m TimelessP (ownG m).
Proof. rewrite /ownG; apply _. Qed. Proof. rewrite /ownG; apply _. Qed.
......
...@@ -19,7 +19,7 @@ Implicit Types P Q : iProp Σ. ...@@ -19,7 +19,7 @@ Implicit Types P Q : iProp Σ.
Implicit Types m : iGst Σ. Implicit Types m : iGst Σ.
Import uPred. Import uPred.
Lemma vs_alt E1 E2 P Q : P pvs E1 E2 Q P >{E1,E2}> Q. Lemma vs_alt E1 E2 P Q : (P pvs E1 E2 Q) P >{E1,E2}> Q.
Proof. Proof.
intros; rewrite -{1}always_const; apply always_intro, impl_intro_l. intros; rewrite -{1}always_const; apply always_intro, impl_intro_l.
by rewrite always_const (right_id _ _). by rewrite always_const (right_id _ _).
......
...@@ -433,6 +433,15 @@ Lemma impl_elim_l' P Q R : P ⊑ (Q → R) → (P ∧ Q) ⊑ R. ...@@ -433,6 +433,15 @@ Lemma impl_elim_l' P Q R : P ⊑ (Q → R) → (P ∧ Q) ⊑ R.
Proof. intros; apply impl_elim with Q; auto. Qed. Proof. intros; apply impl_elim with Q; auto. Qed.
Lemma impl_elim_r' P Q R : Q (P R) (P Q) R. Lemma impl_elim_r' P Q R : Q (P R) (P Q) R.
Proof. intros; apply impl_elim with P; auto. Qed. Proof. intros; apply impl_elim with P; auto. Qed.
Lemma impl_entails P Q : True (P Q) P Q.
Proof.
intros H; eapply impl_elim; last reflexivity. rewrite -H.
by apply True_intro.
Qed.
Lemma entails_impl P Q : (P Q) True (P Q).
Proof.
intros H; apply impl_intro_l. by rewrite -H and_elim_l.
Qed.
Lemma const_elim_l φ Q R : (φ Q R) ( φ Q) R. Lemma const_elim_l φ Q R : (φ Q R) ( φ Q) R.
Proof. intros; apply const_elim with φ; eauto. Qed. Proof. intros; apply const_elim with φ; eauto. Qed.
...@@ -737,6 +746,26 @@ Proof. ...@@ -737,6 +746,26 @@ Proof.
apply always_intro, impl_intro_r. apply always_intro, impl_intro_r.
by rewrite always_and_sep_l always_elim wand_elim_l. by rewrite always_and_sep_l always_elim wand_elim_l.
Qed. Qed.
Lemma always_impl_l P Q : (P Q) (P Q P).
Proof.
rewrite -always_and_sep_l. apply impl_intro_l, and_intro.
- by rewrite impl_elim_r.
- by rewrite and_elim_l.
Qed.
Lemma always_impl_r P Q : (P Q) (P P Q).
Proof.
by rewrite commutative always_impl_l.
Qed.
Lemma always_entails_l P Q : (P Q) P ( Q P).
Proof.
intros H. apply impl_entails. rewrite -always_impl_l.
by apply entails_impl.
Qed.
Lemma always_entails_r P Q : (P Q) P (P Q).
Proof.
intros H. apply impl_entails. rewrite -always_impl_r.
by apply entails_impl.
Qed.
(* Own *) (* Own *)
Lemma own_op (a1 a2 : M) : Lemma own_op (a1 a2 : M) :
...@@ -909,4 +938,13 @@ Lemma always_and_sep_r' P Q `{!AlwaysStable Q} : (P ∧ Q)%I ≡ (P ★ Q)%I. ...@@ -909,4 +938,13 @@ Lemma always_and_sep_r' P Q `{!AlwaysStable Q} : (P ∧ Q)%I ≡ (P ★ Q)%I.
Proof. by rewrite -(always_always Q) always_and_sep_r. Qed. Proof. by rewrite -(always_always Q) always_and_sep_r. Qed.
Lemma always_sep_dup' P `{!AlwaysStable P} : P (P P)%I. Lemma always_sep_dup' P `{!AlwaysStable P} : P (P P)%I.
Proof. by rewrite -(always_always P) -always_sep_dup. Qed. Proof. by rewrite -(always_always P) -always_sep_dup. Qed.
Lemma always_impl_l' P Q `{!AlwaysStable Q} : (P Q) (P Q P).
Proof. by rewrite -(always_always Q) always_impl_l. Qed.
Lemma always_impl_r' P Q `{!AlwaysStable Q} : (P Q) (P P Q).
Proof. by rewrite -(always_always Q) always_impl_r. Qed.
Lemma always_entails_l' P Q `{!AlwaysStable Q} : (P Q) P (Q P).
Proof. by rewrite -(always_always Q); apply always_entails_l. Qed.
Lemma always_entails_r' P Q `{!AlwaysStable Q} : (P Q) P (P Q).
Proof. by rewrite -(always_always Q); apply always_entails_r. Qed.
End uPred_logic. End uPred. End uPred_logic. End uPred.
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