Commit b0e4b6fa authored by Robbert's avatar Robbert

Merge branch 'robbert/fupd_new_axioms' into 'master'

More principled set of axioms for fancy updates and plainly

Closes #164

See merge request FP/iris-coq!184
parents 3c5086b2 5d3c508d
...@@ -41,17 +41,26 @@ Proof. rewrite /BiBUpdFUpd uPred_fupd_eq. by iIntros (E P) ">? [$ $] !> !>". Qed ...@@ -41,17 +41,26 @@ Proof. rewrite /BiBUpdFUpd uPred_fupd_eq. by iIntros (E P) ">? [$ $] !> !>". Qed
Instance uPred_bi_fupd_plainly `{invG Σ} : BiFUpdPlainly (uPredSI (iResUR Σ)). Instance uPred_bi_fupd_plainly `{invG Σ} : BiFUpdPlainly (uPredSI (iResUR Σ)).
Proof. Proof.
split. split.
- rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (E P Q) "HQP HQ [Hw HE]". - rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (E P) "H [Hw HE]".
iAssert ( P)%I as "#>HP'". iAssert ( P)%I as "#>HP".
{ by iMod ("HQP" with "HQ [$]") as "(_ & _ & HP)". } { by iMod ("H" with "[$]") as "(_ & _ & HP)". }
by iFrame.
- rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (E P Q) "[H HQ] [Hw HE]".
iAssert ( P)%I as "#>HP".
{ by iMod ("H" with "HQ [$]") as "(_ & _ & HP)". }
by iFrame.
- rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (E P) "H [Hw HE]".
iAssert ( P)%I as "#HP".
{ iNext. by iMod ("H" with "[$]") as "(_ & _ & HP)". }
iFrame. iIntros "!> !> !>". by iMod "HP".
- rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (E A Φ) "HΦ [Hw HE]".
iAssert ( x : A, Φ x)%I as "#>HP".
{ iIntros (x). by iMod ("HΦ" with "[$Hw $HE]") as "(_&_&?)". }
by iFrame. by iFrame.
- rewrite uPred_fupd_eq /uPred_fupd_def. iIntros (p E1 E2 P) "HP [Hw HE]".
iAssert (?p P)%I with "[-]" as "#HP'"; last by (rewrite plainly_elim; iFrame).
iNext. by iMod ("HP" with "[$]") as "(_ & _ & HP)".
Qed. Qed.
Lemma fupd_plain_soundness `{invPreG Σ} E (P: iProp Σ) `{!Plain P}: Lemma fupd_plain_soundness `{invPreG Σ} E (P: iProp Σ) `{!Plain P}:
( `{Hinv: invG Σ}, (|={, E}=> P)%I) ( P)%I. ( `{Hinv: invG Σ}, (|={,E}=> P)%I) ( P)%I.
Proof. Proof.
iIntros (Hfupd). iMod wsat_alloc as (Hinv) "[Hw HE]". iIntros (Hfupd). iMod wsat_alloc as (Hinv) "[Hw HE]".
iPoseProof (Hfupd Hinv) as "H". iPoseProof (Hfupd Hinv) as "H".
...@@ -60,30 +69,28 @@ Proof. ...@@ -60,30 +69,28 @@ Proof.
Qed. Qed.
Lemma step_fupdN_soundness `{invPreG Σ} φ n : Lemma step_fupdN_soundness `{invPreG Σ} φ n :
( `{Hinv: invG Σ}, (|={, }=>^n |={, }=> φ : iProp Σ)%I) ( `{Hinv: invG Σ}, (|={,}=>^n |={,}=> φ : iProp Σ)%I)
φ. φ.
Proof. Proof.
intros Hiter. intros Hiter.
apply (soundness (M:=iResUR Σ) _ (S (S n))); simpl. apply (soundness (M:=iResUR Σ) _ (S (S n))); simpl.
apply (fupd_plain_soundness _). apply (fupd_plain_soundness _)=> Hinv.
intros Hinv. iPoseProof (Hiter Hinv) as "H". iPoseProof (Hiter Hinv) as "H". clear Hiter.
destruct n as [|n]. destruct n as [|n].
- rewrite //=. iPoseProof (fupd_plain_strong with "H") as "H'". - iApply fupd_plainly_mask_empty. iMod "H" as %?; auto.
do 2 iMod "H'"; iModIntro; auto. - iDestruct (step_fupdN_wand _ _ _ _ (|={}=> ⌜φ⌝)%I with "H []") as "H'".
- iPoseProof (step_fupdN_mono _ _ _ _ (|={}=> ⌜φ⌝)%I with "H") as "H'". { by iApply fupd_plain_mask_empty. }
{ iIntros "H". iMod (fupd_plain_strong with "H"); auto. }
rewrite -step_fupdN_S_fupd. rewrite -step_fupdN_S_fupd.
iMod (step_fupdN_plain with "H'") as "Hφ". iModIntro. iNext. iMod (step_fupdN_plain with "H'") as "Hφ". iModIntro. iNext.
rewrite -later_laterN laterN_later. rewrite -later_laterN laterN_later.
iNext. by do 2 iMod "Hφ". iNext. by iMod "Hφ".
Qed. Qed.
Lemma step_fupdN_soundness' `{invPreG Σ} φ n : Lemma step_fupdN_soundness' `{invPreG Σ} φ n :
( `{Hinv: invG Σ}, (|={, }=>^n φ : iProp Σ)%I) ( `{Hinv: invG Σ}, (|={,}=>^n φ : iProp Σ)%I)
φ. φ.
Proof. Proof.
iIntros (Hiter). eapply (step_fupdN_soundness _ n). iIntros (Hiter). eapply (step_fupdN_soundness _ n).
iIntros (Hinv). iPoseProof (Hiter Hinv) as "Hiter". iIntros (Hinv). iPoseProof (Hiter Hinv) as "Hiter".
iApply (step_fupdN_mono with "Hiter"). iApply (step_fupdN_wand with "Hiter"). by iApply (fupd_mask_weaken _ _ _).
iIntros (?). iMod (fupd_intro_mask' _ ) as "_"; auto.
Qed. Qed.
...@@ -956,11 +956,17 @@ Proof. move => [] /(_ i). rewrite /Plain monPred_at_plainly bi.forall_elim //. Q ...@@ -956,11 +956,17 @@ Proof. move => [] /(_ i). rewrite /Plain monPred_at_plainly bi.forall_elim //. Q
Global Instance monPred_bi_fupd_plainly `{BiFUpdPlainly PROP} : BiFUpdPlainly monPredSI. Global Instance monPred_bi_fupd_plainly `{BiFUpdPlainly PROP} : BiFUpdPlainly monPredSI.
Proof. Proof.
split; rewrite monPred_fupd_eq; unseal. split; rewrite !monPred_fupd_eq; try unseal.
- intros E P Q. split=>/= i. do 3 f_equiv. - intros E P. split=>/= i.
rewrite monPred_at_plainly (bi.forall_elim _) fupd_plainly_weak //=. by rewrite monPred_at_plainly (bi.forall_elim i) fupd_plainly_mask_empty.
- intros p E1 E2 P; split=>/= i; specialize (later_fupd_plainly p) => HFP. - intros E P R. split=>/= i.
destruct p; simpl; [ unseal | ]; rewrite monPred_at_plainly (bi.forall_elim _); apply HFP. rewrite (bi.forall_elim i) bi.pure_True // bi.True_impl.
by rewrite monPred_at_plainly (bi.forall_elim i) fupd_plainly_keep_l.
- intros E P. split=>/= i.
by rewrite monPred_at_plainly (bi.forall_elim i) fupd_plainly_later.
- intros E A Φ. split=>/= i.
rewrite -fupd_plainly_forall_2. apply bi.forall_mono=> x.
by rewrite monPred_at_plainly (bi.forall_elim i).
Qed. Qed.
Global Instance plainly_objective `{BiPlainly PROP} P : Objective ( P). Global Instance plainly_objective `{BiPlainly PROP} P : Objective ( P).
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ Notation wptp s t := ([∗ list] ef ∈ t, WP ef @ s; ⊤ {{ _, True }})%I. ...@@ -44,7 +44,7 @@ Notation wptp s t := ([∗ list] ef ∈ t, WP ef @ s; ⊤ {{ _, True }})%I.
Lemma wp_step s E e1 σ1 κ κs e2 σ2 efs Φ : Lemma wp_step s E e1 σ1 κ κs e2 σ2 efs Φ :
prim_step e1 σ1 κ e2 σ2 efs prim_step e1 σ1 κ e2 σ2 efs
state_interp σ1 (κ ++ κs) WP e1 @ s; E {{ Φ }} state_interp σ1 (κ ++ κs) WP e1 @ s; E {{ Φ }}
={E, }= (state_interp σ2 κs WP e2 @ s; E {{ Φ }} wptp s efs). ={E,}= (state_interp σ2 κs WP e2 @ s; E {{ Φ }} wptp s efs).
Proof. Proof.
rewrite {1}wp_unfold /wp_pre. iIntros (?) "[Hσ H]". rewrite {1}wp_unfold /wp_pre. iIntros (?) "[Hσ H]".
rewrite (val_stuck e1 σ1 κ e2 σ2 efs) //. rewrite (val_stuck e1 σ1 κ e2 σ2 efs) //.
...@@ -57,7 +57,7 @@ Lemma wptp_step s e1 t1 t2 κ κs σ1 σ2 Φ : ...@@ -57,7 +57,7 @@ Lemma wptp_step s e1 t1 t2 κ κs σ1 σ2 Φ :
step (e1 :: t1,σ1) κ (t2, σ2) step (e1 :: t1,σ1) κ (t2, σ2)
state_interp σ1 (κ ++ κs) WP e1 @ s; {{ Φ }} wptp s t1 state_interp σ1 (κ ++ κs) WP e1 @ s; {{ Φ }} wptp s t1
== e2 t2', == e2 t2',
t2 = e2 :: t2' |={, }=> (state_interp σ2 κs WP e2 @ s; {{ Φ }} wptp s t2'). t2 = e2 :: t2' |={,}=> (state_interp σ2 κs WP e2 @ s; {{ Φ }} wptp s t2').
Proof. Proof.
iIntros (Hstep) "(HW & He & Ht)". iIntros (Hstep) "(HW & He & Ht)".
destruct Hstep as [e1' σ1' e2' σ2' efs [|? t1'] t2' ?? Hstep]; simplify_eq/=. destruct Hstep as [e1' σ1' e2' σ2' efs [|? t1'] t2' ?? Hstep]; simplify_eq/=.
...@@ -71,7 +71,7 @@ Qed. ...@@ -71,7 +71,7 @@ Qed.
Lemma wptp_steps s n e1 t1 κs κs' t2 σ1 σ2 Φ : Lemma wptp_steps s n e1 t1 κs κs' t2 σ1 σ2 Φ :
nsteps n (e1 :: t1, σ1) κs (t2, σ2) nsteps n (e1 :: t1, σ1) κs (t2, σ2)
state_interp σ1 (κs ++ κs') WP e1 @ s; {{ Φ }} wptp s t1 state_interp σ1 (κs ++ κs') WP e1 @ s; {{ Φ }} wptp s t1
|={, }=>^n ( e2 t2', |={,}=>^n ( e2 t2',
t2 = e2 :: t2' state_interp σ2 κs' WP e2 @ s; {{ Φ }} wptp s t2'). t2 = e2 :: t2' state_interp σ2 κs' WP e2 @ s; {{ Φ }} wptp s t2').
Proof. Proof.
revert e1 t1 κs κs' t2 σ1 σ2; simpl; induction n as [|n IH]=> e1 t1 κs κs' t2 σ1 σ2 /=. revert e1 t1 κs κs' t2 σ1 σ2; simpl; induction n as [|n IH]=> e1 t1 κs κs' t2 σ1 σ2 /=.
...@@ -88,15 +88,15 @@ Lemma wptp_result s n e1 t1 κs κs' v2 t2 σ1 σ2 φ : ...@@ -88,15 +88,15 @@ Lemma wptp_result s n e1 t1 κs κs' v2 t2 σ1 σ2 φ :
state_interp σ1 (κs ++ κs') state_interp σ1 (κs ++ κs')
WP e1 @ s; {{ v, σ, state_interp σ κs' ={,}= ⌜φ v σ⌝ }} WP e1 @ s; {{ v, σ, state_interp σ κs' ={,}= ⌜φ v σ⌝ }}
wptp s t1 wptp s t1
|={, }=>^(S n) ⌜φ v2 σ2. |={,}=>^(S n) ⌜φ v2 σ2.
Proof. Proof.
intros. rewrite Nat_iter_S_r wptp_steps //. intros. rewrite Nat_iter_S_r wptp_steps //.
apply step_fupdN_mono. apply step_fupdN_mono.
iDestruct 1 as (e2 t2' ?) "(Hσ & H & _)"; simplify_eq. iDestruct 1 as (e2 t2' ?) "(Hσ & H & _)"; simplify_eq.
iMod (wp_value_inv' with "H") as "H". iMod (wp_value_inv' with "H") as "H".
iMod (later_fupd_plain false (⌜φ v2 σ2)%I with "[H Hσ]") as ">#%". iMod (fupd_plain_mask_empty _ ⌜φ v2 σ2%I with "[H Hσ]") as %?.
{ rewrite //=. by iMod ("H" with "Hσ") as "$". } { by iMod ("H" with "Hσ") as "$". }
iApply (step_fupd_mask_mono _ _ ); auto. by iApply step_fupd_intro.
Qed. Qed.
Lemma wp_safe E e σ κs Φ : Lemma wp_safe E e σ κs Φ :
...@@ -105,8 +105,8 @@ Proof. ...@@ -105,8 +105,8 @@ Proof.
rewrite wp_unfold /wp_pre. iIntros "Hσ H". rewrite wp_unfold /wp_pre. iIntros "Hσ H".
destruct (to_val e) as [v|] eqn:?. destruct (to_val e) as [v|] eqn:?.
{ iApply (step_fupd_mask_mono _ _ ); eauto. set_solver. } { iApply (step_fupd_mask_mono _ _ ); eauto. set_solver. }
iMod (later_fupd_plain false E (reducible e σ⌝)%I with "[H Hσ]") as ">#%". iMod (fupd_plain_mask_empty _ reducible e σ⌝%I with "[H Hσ]") as %?.
{ rewrite //=. by iMod ("H" $! σ [] κs with "Hσ") as "($&H)". } { by iMod ("H" $! σ [] κs with "Hσ") as "($&H)". }
iApply step_fupd_intro; first by set_solver+. iApply step_fupd_intro; first by set_solver+.
iIntros "!> !%". by right. iIntros "!> !%". by right.
Qed. Qed.
...@@ -114,7 +114,7 @@ Qed. ...@@ -114,7 +114,7 @@ Qed.
Lemma wptp_safe n e1 κs κs' e2 t1 t2 σ1 σ2 Φ : Lemma wptp_safe n e1 κs κs' e2 t1 t2 σ1 σ2 Φ :
nsteps n (e1 :: t1, σ1) κs (t2, σ2) e2 t2 nsteps n (e1 :: t1, σ1) κs (t2, σ2) e2 t2
state_interp σ1 (κs ++ κs') WP e1 {{ Φ }} wptp NotStuck t1 state_interp σ1 (κs ++ κs') WP e1 {{ Φ }} wptp NotStuck t1
|={, }=>^(S n) is_Some (to_val e2) reducible e2 σ2. |={,}=>^(S n) is_Some (to_val e2) reducible e2 σ2.
Proof. Proof.
intros ? He2. rewrite Nat_iter_S_r wptp_steps //. intros ? He2. rewrite Nat_iter_S_r wptp_steps //.
apply step_fupdN_mono. apply step_fupdN_mono.
...@@ -126,14 +126,14 @@ Qed. ...@@ -126,14 +126,14 @@ Qed.
Lemma wptp_invariance s n e1 κs κs' e2 t1 t2 σ1 σ2 φ Φ : Lemma wptp_invariance s n e1 κs κs' e2 t1 t2 σ1 σ2 φ Φ :
nsteps n (e1 :: t1, σ1) κs (t2, σ2) nsteps n (e1 :: t1, σ1) κs (t2, σ2)
(state_interp σ2 κs' ={,}= ⌜φ⌝) state_interp σ1 (κs ++ κs') WP e1 @ s; {{ Φ }} wptp s t1 (state_interp σ2 κs' ={,}= ⌜φ⌝)
|={, }=>^(S n) |={,}=> ⌜φ⌝. state_interp σ1 (κs ++ κs') WP e1 @ s; {{ Φ }} wptp s t1
|={,}=>^(S n) |={,}=> ⌜φ⌝.
Proof. Proof.
intros ?. rewrite Nat_iter_S_r wptp_steps // step_fupdN_frame_l. intros ?. rewrite Nat_iter_S_r wptp_steps // step_fupdN_frame_l.
apply step_fupdN_mono. apply step_fupdN_mono.
iIntros "[Hback H]"; iDestruct "H" as (e2' t2' ->) "[Hσ _]". iIntros "[Hback H]"; iDestruct "H" as (e2' t2' ->) "[Hσ _]".
iSpecialize ("Hback" with "Hσ"). iSpecialize ("Hback" with "Hσ"). by iApply step_fupd_intro.
iApply (step_fupd_mask_mono _ _ ); auto.
Qed. Qed.
End adequacy. End adequacy.
...@@ -146,15 +146,13 @@ Theorem wp_strong_adequacy Σ Λ `{invPreG Σ} s e σ φ : ...@@ -146,15 +146,13 @@ Theorem wp_strong_adequacy Σ Λ `{invPreG Σ} s e σ φ :
Proof. Proof.
intros Hwp; split. intros Hwp; split.
- intros t2 σ2 v2 [n [κs ?]]%erased_steps_nsteps. - intros t2 σ2 v2 [n [κs ?]]%erased_steps_nsteps.
eapply (step_fupdN_soundness' _ (S (S n))). eapply (step_fupdN_soundness' _ (S (S n)))=> Hinv.
iIntros (Hinv).
rewrite Nat_iter_S. rewrite Nat_iter_S.
iMod Hwp as (Istate) "[HI Hwp]". iMod Hwp as (Istate) "[HI Hwp]".
iApply (step_fupd_mask_mono _ _ ); auto. iModIntro. iNext; iModIntro. iApply (step_fupd_mask_mono _ _ ); auto. iModIntro. iNext; iModIntro.
iApply (@wptp_result _ _ (IrisG _ _ _ Hinv Istate) _ _ _ _ _ []); eauto with iFrame. iApply (@wptp_result _ _ (IrisG _ _ _ Hinv Istate) _ _ _ _ _ []); eauto with iFrame.
- destruct s; last done. intros t2 σ2 e2 _ [n [κs ?]]%erased_steps_nsteps ?. - destruct s; last done. intros t2 σ2 e2 _ [n [κs ?]]%erased_steps_nsteps ?.
eapply (step_fupdN_soundness' _ (S (S n))). eapply (step_fupdN_soundness' _ (S (S n)))=> Hinv.
iIntros (Hinv).
rewrite Nat_iter_S. rewrite Nat_iter_S.
iMod Hwp as (Istate) "[HI Hwp]". iMod Hwp as (Istate) "[HI Hwp]".
iApply (step_fupd_mask_mono _ _ ); auto. iApply (step_fupd_mask_mono _ _ ); auto.
...@@ -184,11 +182,10 @@ Theorem wp_invariance Σ Λ `{invPreG Σ} s e σ1 t2 σ2 φ : ...@@ -184,11 +182,10 @@ Theorem wp_invariance Σ Λ `{invPreG Σ} s e σ1 t2 σ2 φ :
φ. φ.
Proof. Proof.
intros Hwp [n [κs ?]]%erased_steps_nsteps. intros Hwp [n [κs ?]]%erased_steps_nsteps.
eapply (step_fupdN_soundness _ (S (S n))). eapply (step_fupdN_soundness _ (S (S n)))=> Hinv.
iIntros (Hinv).
rewrite Nat_iter_S. rewrite Nat_iter_S.
iMod (Hwp Hinv κs []) as (Istate) "(HIstate & Hwp & Hclose)". iMod (Hwp Hinv κs []) as (Istate) "(HIstate & Hwp & Hclose)".
iApply (step_fupd_mask_mono _ _ ); auto. iApply step_fupd_intro; first done.
iApply (@wptp_invariance _ _ (IrisG _ _ _ Hinv Istate)); eauto with iFrame. iApply (@wptp_invariance _ _ (IrisG _ _ _ Hinv Istate)); eauto with iFrame.
Qed. Qed.
......
From iris.program_logic Require Export total_weakestpre adequacy. From iris.program_logic Require Export total_weakestpre adequacy.
From iris.algebra Require Import gmap auth agree gset coPset list. From iris.algebra Require Import gmap auth agree gset coPset list.
From iris.bi Require Import big_op fixpoint. From iris.bi Require Import big_op fixpoint.
From iris.base_logic.lib Require Import wsat.
From iris.proofmode Require Import tactics. From iris.proofmode Require Import tactics.
Set Default Proof Using "Type". Set Default Proof Using "Type".
Import uPred. Import uPred.
...@@ -99,18 +98,15 @@ Proof. ...@@ -99,18 +98,15 @@ Proof.
iApply (twptp_app [_] with "[IH']"); [by iApply "IH'"|by iApply "IH"]. iApply (twptp_app [_] with "[IH']"); [by iApply "IH'"|by iApply "IH"].
Qed. Qed.
Notation world σ := (wsat ownE state_interp σ [])%I. Lemma twptp_total σ t :
state_interp σ [] - twptp t ={}= sn erased_step (t, σ).
Lemma twptp_total σ t : world σ - twptp t - sn erased_step (t, σ).
Proof. Proof.
iIntros "Hw Ht". iRevert (σ) "Hw". iRevert (t) "Ht". iIntros "Hw Ht". iRevert (σ) "Hw". iRevert (t) "Ht".
iApply twptp_ind; iIntros "!#" (t) "IH"; iIntros (σ) "(Hw&HE&Hσ)". iApply twptp_ind; iIntros "!#" (t) "IH"; iIntros (σ) "".
iApply (pure_mono _ _ (Acc_intro _)). iIntros ([t' σ'] [κ Hstep]). iApply (pure_mono _ _ (Acc_intro _)). iIntros ([t' σ'] [κ Hstep]).
rewrite /twptp_pre uPred_fupd_eq /uPred_fupd_def. iMod ("IH" with "[% //] Hσ") as (->) "[Hσ [H _]]".
iMod ("IH" with "[% //] Hσ [$Hw $HE]") as ">(Hw & HE & % & Hσ & [IH _])". by iApply "H".
iApply "IH". by iFrame.
Qed. Qed.
End adequacy. End adequacy.
Theorem twp_total Σ Λ `{invPreG Σ} s e σ Φ : Theorem twp_total Σ Λ `{invPreG Σ} s e σ Φ :
...@@ -120,11 +116,9 @@ Theorem twp_total Σ Λ `{invPreG Σ} s e σ Φ : ...@@ -120,11 +116,9 @@ Theorem twp_total Σ Λ `{invPreG Σ} s e σ Φ :
stateI σ [] WP e @ s; [{ Φ }])%I) stateI σ [] WP e @ s; [{ Φ }])%I)
sn erased_step ([e], σ). (* i.e. ([e], σ) is strongly normalizing *) sn erased_step ([e], σ). (* i.e. ([e], σ) is strongly normalizing *)
Proof. Proof.
intros Hwp. intros Hwp. apply (soundness (M:=iResUR Σ) _ 2); simpl.
eapply (soundness (M:=iResUR Σ) _ 1); iIntros "/=". apply (fupd_plain_soundness _)=> Hinv.
iMod wsat_alloc as (Hinv) "[Hw HE]". specialize (Hwp Hinv). iMod (Hwp) as (stateI) "[Hσ H]".
rewrite uPred_fupd_eq in Hwp; iMod (Hwp with "[$Hw $HE]") as ">(Hw & HE & Hwp)". iApply (@twptp_total _ _ (IrisG _ _ _ Hinv stateI) with "Hσ").
iDestruct "Hwp" as (Istate) "[HI Hwp]". by iApply (@twp_twptp _ _ (IrisG _ _ _ Hinv stateI)).
iApply (@twptp_total _ _ (IrisG _ _ _ Hinv Istate) with "[$Hw $HE $HI]").
by iApply (@twp_twptp _ _ (IrisG _ _ _ Hinv Istate)).
Qed. Qed.
...@@ -321,6 +321,24 @@ Global Instance from_forall_plainly `{BiPlainly PROP} {A} P (Φ : A → PROP) : ...@@ -321,6 +321,24 @@ Global Instance from_forall_plainly `{BiPlainly PROP} {A} P (Φ : A → PROP) :
FromForall P Φ FromForall ( P)%I (λ a, (Φ a))%I. FromForall P Φ FromForall ( P)%I (λ a, (Φ a))%I.
Proof. rewrite /FromForall=> <-. by rewrite plainly_forall. Qed. Proof. rewrite /FromForall=> <-. by rewrite plainly_forall. Qed.
Global Instance from_forall_fupd `{BiFUpdPlainly PROP} E1 E2 {A} P (Φ : A PROP) :
(* Some cases in which [E2 ⊆ E1] holds *)
TCOr (TCEq E1 E2) (TCOr (TCEq E1 ) (TCEq E2 ))
FromForall P Φ ( x, Plain (Φ x))
FromForall (|={E1,E2}=> P)%I (λ a, |={E1,E2}=> (Φ a))%I.
Proof.
rewrite /FromForall=> -[->|[->|->]] <- ?; rewrite fupd_plain_forall; set_solver.
Qed.
Global Instance from_forall_step_fupd `{BiFUpdPlainly PROP} E1 E2 {A} P (Φ : A PROP) :
(* Some cases in which [E2 ⊆ E1] holds *)
TCOr (TCEq E1 E2) (TCOr (TCEq E1 ) (TCEq E2 ))
FromForall P Φ ( x, Plain (Φ x))
FromForall (|={E1,E2}=> P)%I (λ a, |={E1,E2}=> (Φ a))%I.
Proof.
rewrite /FromForall=> -[->|[->|->]] <- ?; rewrite step_fupd_plain_forall; set_solver.
Qed.
(** IsExcept0 *) (** IsExcept0 *)
Global Instance is_except_0_except_0 P : IsExcept0 ( P). Global Instance is_except_0_except_0 P : IsExcept0 ( P).
Proof. by rewrite /IsExcept0 except_0_idemp. Qed. Proof. by rewrite /IsExcept0 except_0_idemp. Qed.
......
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