Skip to content
Snippets Groups Projects
Commit 6f1bdd8f authored by Jonas Kastberg Hinrichsen's avatar Jonas Kastberg Hinrichsen
Browse files

Updated receive specifications to use persistent view shift instead of fixpoint

parent e8747a6d
No related branches found
No related tags found
No related merge requests found
...@@ -284,23 +284,11 @@ Section channel. ...@@ -284,23 +284,11 @@ Section channel.
by iApply "HΦ". by iApply "HΦ".
Qed. Qed.
Definition recv_vs_rec E γ c s Φ vs :=
(|={,E}=> ls rs,
is_chan γ c ls rs
((try_recv_upd_fail γ c ls rs s ={E,}=∗ vs)
( v, try_recv_upd_succ γ c ls rs s v ={E,}=∗ Φ v)))%I.
Global Instance recv_vs_rec_contractive E γ c s Φ :
Contractive (recv_vs_rec E γ c s Φ).
Proof.
intros n P Q Heq.
rewrite /recv_vs_rec.
do 9 f_equiv.
by apply later_contractive.
Qed.
Definition recv_vs E γ c s Φ := Definition recv_vs E γ c s Φ :=
fixpoint (recv_vs_rec E γ c s Φ). ( (|={,E}=> ls rs,
is_chan γ c ls rs
((try_recv_upd_fail γ c ls rs s ={E,}=∗ True)
( v, try_recv_upd_succ γ c ls rs s v ={E,}=∗ Φ v))))%I.
Lemma recv_spec Φ E γ c s : Lemma recv_spec Φ E γ c s :
is_side s is_side s
...@@ -308,10 +296,9 @@ Section channel. ...@@ -308,10 +296,9 @@ Section channel.
recv_vs E γ c s Φ -∗ recv_vs E γ c s Φ -∗
WP recv c s {{ Φ }}. WP recv c s {{ Φ }}.
Proof. Proof.
iIntros (Hside) "#Hc HΦ". iIntros (Hside) "#Hc #HΦ".
rewrite /recv. rewrite /recv.
iLöb as "IH". iLöb as "IH".
iDestruct (fixpoint_unfold with "HΦ") as "HΦ".
wp_apply (try_recv_spec with "Hc")=> //. wp_apply (try_recv_spec with "Hc")=> //.
iMod "HΦ" as (ls rs) "[Hchan [HΦfail HΦsucc]]". iMod "HΦ" as (ls rs) "[Hchan [HΦfail HΦsucc]]".
iModIntro. iModIntro.
......
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