Skip to content
Snippets Groups Projects
Commit 59ebd81e authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan
Browse files

Mask-changing updates that take a step.

parent 2d0e1f3e
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,12 @@ Reserved Notation "P ={ E }=∗ Q"
(at level 99, E at level 50, Q at level 200,
format "'[' P '/' ={ E }=∗ Q ']'").
Reserved Notation "|={ E1 , E2 , E3 }▷=> Q"
(at level 99, E1, E2 at level 50, Q at level 200,
format "|={ E1 , E2 , E3 }▷=> Q").
Reserved Notation "P ={ E1 , E2 , E3 }▷=∗ Q"
(at level 99, E1, E2 at level 50, Q at level 200,
format "'[' P '/' ={ E1 , E2 , E3 }▷=∗ Q ']'").
Reserved Notation "|={ E1 , E2 }▷=> Q"
(at level 99, E1, E2 at level 50, Q at level 200,
format "|={ E1 , E2 }▷=> Q").
......
......@@ -25,11 +25,15 @@ Notation "P ={ E }=∗ Q" := (P -∗ |={E}=> Q)%I : bi_scope.
Notation "P ={ E }=∗ Q" := (P -∗ |={E}=> Q) : stdpp_scope.
(** Fancy updates that take a step. *)
Notation "|={ E1 , E2 }▷=> Q" := (|={E1,E2}=> ( |={E2,E1}=> Q))%I : bi_scope.
Notation "P ={ E1 , E2 }▷=∗ Q" := (P -∗ |={ E1 , E2 }▷=> Q)%I : bi_scope.
Notation "|={ E1 , E2 , E3 }▷=> Q" := (|={E1,E2}=> ( |={E2,E3}=> Q))%I : bi_scope.
Notation "P ={ E1 , E2 , E3 }▷=∗ Q" := (P -∗ |={ E1,E2,E3 }▷=> Q)%I : bi_scope.
Notation "|={ E1 , E2 }▷=> Q" := (|={E1,E2,E1}▷=> Q)%I : bi_scope.
Notation "P ={ E1 , E2 }▷=∗ Q" := (P -∗ |={ E1 , E2, E1 }▷=> Q)%I : bi_scope.
Notation "|={ E }▷=> Q" := (|={E,E}▷=> Q)%I : bi_scope.
Notation "P ={ E }▷=∗ Q" := (P ={E,E}▷=∗ Q)%I : bi_scope.
(** Bundled versions *)
(* Mixins allow us to create instances easily without having to use Program *)
Record BiBUpdMixin (PROP : bi) `(BUpd PROP) := {
......@@ -277,15 +281,15 @@ Section fupd_derived.
Qed.
(** Fancy updates that take a step derived rules. *)
Lemma step_fupd_wand E1 E2 P Q : (|={E1,E2}▷=> P) -∗ (P -∗ Q) -∗ |={E1,E2}▷=> Q.
Lemma step_fupd_wand E1 E2 E3 P Q : (|={E1,E2,E3}▷=> P) -∗ (P -∗ Q) -∗ |={E1,E2,E3}▷=> Q.
Proof.
apply wand_intro_l.
by rewrite (later_intro (P -∗ Q)%I) fupd_frame_l -later_sep fupd_frame_l
wand_elim_l.
Qed.
Lemma step_fupd_mask_frame_r E1 E2 Ef P :
E1 ## Ef E2 ## Ef (|={E1,E2}▷=> P) |={E1 Ef,E2 Ef}▷=> P.
Lemma step_fupd_mask_frame_r E1 E2 E3 Ef P :
E1 ## Ef E2 ## Ef (|={E1,E2,E3}▷=> P) |={E1 Ef,E2 Ef,E3 Ef}▷=> P.
Proof.
intros. rewrite -fupd_mask_frame_r //. do 2 f_equiv. by apply fupd_mask_frame_r.
Qed.
......
......@@ -18,7 +18,7 @@ Lemma wp_lift_head_step_fupd {s E Φ} e1 :
to_val e1 = None
( σ1, state_interp σ1 ={E,}=∗
head_reducible e1 σ1
e2 σ2 efs, head_step e1 σ1 e2 σ2 efs ={}=∗ |={,E}=>
e2 σ2 efs, head_step e1 σ1 e2 σ2 efs ={,,E}▷=∗
state_interp σ2 WP e2 @ s; E {{ Φ }} [ list] ef efs, WP ef @ s; {{ _, True }})
WP e1 @ s; E {{ Φ }}.
Proof.
......
......@@ -15,7 +15,7 @@ Lemma wp_lift_step_fupd s E Φ e1 :
to_val e1 = None
( σ1, state_interp σ1 ={E,}=∗
if s is NotStuck then reducible e1 σ1 else True
e2 σ2 efs, prim_step e1 σ1 e2 σ2 efs ={}=∗ |={,E}=>
e2 σ2 efs, prim_step e1 σ1 e2 σ2 efs ={,,E}▷=∗
state_interp σ2 WP e2 @ s; E {{ Φ }} [ list] ef efs, WP ef @ s; {{ _, True }})
WP e1 @ s; E {{ Φ }}.
Proof.
......
......@@ -32,7 +32,7 @@ Definition wp_pre `{irisG Λ Σ} (s : stuckness)
| Some v => |={E}=> Φ v
| None => σ1,
state_interp σ1 ={E,}=∗ if s is NotStuck then reducible e1 σ1 else True
e2 σ2 efs, prim_step e1 σ1 e2 σ2 efs ={}=∗ |={,E}=>
e2 σ2 efs, prim_step e1 σ1 e2 σ2 efs ={,,E}▷=∗
state_interp σ2 wp E e2 Φ
[ list] ef efs, wp ef (λ _, True)
end%I.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment