Skip to content
Snippets Groups Projects
Commit ce3a01eb authored by Ralf Jung's avatar Ralf Jung
Browse files

avoid wp_bindi

parent a3413622
No related branches found
No related tags found
No related merge requests found
...@@ -237,15 +237,17 @@ Section proof. ...@@ -237,15 +237,17 @@ Section proof.
heapN N (recv l P (P -★ Φ '())) || wait (LocV l) {{ Φ }}. heapN N (recv l P (P -★ Φ '())) || wait (LocV l) {{ Φ }}.
Proof. Proof.
rename P into R. rename P into R.
intros Hdisj. rewrite /wait. rewrite [(_ _)%I](pvs_intro ). intros Hdisj.
apply löb_strong_sep. rewrite pvs_frame_r. apply wp_strip_pvs. (* TODO we probably want a tactic or lemma that does the next 2 lines for us.
It should be general enough to also cover FindPred_spec. Probably this
should be the default behavior of wp_rec - since this is what we need every time
we prove a recursive function correct. *)
rewrite /wait. rewrite [(_ _)%I](pvs_intro ).
apply löb_strong_sep. rewrite pvs_frame_r. apply wp_strip_pvs. wp_rec.
rewrite {1}/recv /barrier_ctx. rewrite !sep_exist_r. rewrite {1}/recv /barrier_ctx. rewrite !sep_exist_r.
apply exist_elim=>γ. rewrite !sep_exist_r. apply exist_elim=>P. apply exist_elim=>γ. rewrite !sep_exist_r. apply exist_elim=>P.
rewrite !sep_exist_r. apply exist_elim=>Q. rewrite !sep_exist_r. rewrite !sep_exist_r. apply exist_elim=>Q. rewrite !sep_exist_r.
apply exist_elim=>i. wp_rec. apply exist_elim=>i. wp_focus (! _)%L.
(* TODO use automatic binding *)
rewrite -(wp_bindi (IfCtx _ _)) /=.
rewrite -(wp_bindi (BinOpLCtx _ _)) /=.
(* I think some evars here are better than repeating *everything* *) (* I think some evars here are better than repeating *everything* *)
eapply (sts_fsaS _ (wp_fsa _)) with (N0:=N) (γ0:=γ); simpl; eapply (sts_fsaS _ (wp_fsa _)) with (N0:=N) (γ0:=γ); simpl;
eauto with I ndisj. eauto with I ndisj.
......
...@@ -19,11 +19,6 @@ Lemma wp_bind {E e} K Φ : ...@@ -19,11 +19,6 @@ Lemma wp_bind {E e} K Φ :
|| e @ E {{ λ v, || fill K (of_val v) @ E {{ Φ }}}} || fill K e @ E {{ Φ }}. || e @ E {{ λ v, || fill K (of_val v) @ E {{ Φ }}}} || fill K e @ E {{ Φ }}.
Proof. apply weakestpre.wp_bind. Qed. Proof. apply weakestpre.wp_bind. Qed.
Lemma wp_bindi {E e} Ki Φ :
|| e @ E {{ λ v, || fill_item Ki (of_val v) @ E {{ Φ }}}}
|| fill_item Ki e @ E {{ Φ }}.
Proof. apply weakestpre.wp_bind. Qed.
(** Base axioms for core primitives of the language: Stateful reductions. *) (** Base axioms for core primitives of the language: Stateful reductions. *)
Lemma wp_alloc_pst E σ e v Φ : Lemma wp_alloc_pst E σ e v Φ :
to_val e = Some v to_val e = Some v
......
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