Commit 96aa3f7a authored by Dan Frumin's avatar Dan Frumin

Add some rel_ tactics for the LHS, enough to do the late-early choice refinement

parent bbf10435
......@@ -280,12 +280,12 @@ Section CG_Counter.
Proof.
iIntros "#H".
Transparent FG_increment. unfold FG_increment. unlock. simpl.
iLöb as "IH".
iApply (bin_log_related_rec_l _ E1 K); auto. iNext. simpl.
iLöb as "IH".
rel_rec_l.
Opaque FG_increment.
rel_bind_l (Load (Loc x)).
iPoseProof "H" as "H2". (* lolwhat *)
Opaque bin_log_related.
rel_bind_l (Load (Loc x)).
iPoseProof "H" as "H2". (* lolwhat *)
iApply (bin_log_related_load_l).
iMod "H" as (n) "[Hx [HR Hrev]]". iModIntro.
iExists (#nv n). iFrame. iIntros "Hx".
......@@ -293,10 +293,8 @@ Section CG_Counter.
iApply fupd_logrel.
iMod ("Hrev" with "[HR Hx]").
{ iExists _. iFrame. } iModIntro. simpl.
iApply (bin_log_related_rec_l); auto. simpl.
iNext.
rel_bind_l (BinOp _ _ _).
iApply (bin_log_related_binop_l). iNext. simpl.
rel_rec_l.
rel_op_l. simpl.
rel_bind_l (CAS _ _ _).
iApply (bin_log_related_cas_l); auto.
iMod "H2" as (n') "[Hx [HR HQ]]". iModIntro. simpl.
......
......@@ -139,18 +139,16 @@ Section Refinement.
Proof.
iIntros "#Hspec Hx Hx'".
unfold lateChoice, earlyChoice. unlock.
rel_rec_l. rel_rec_r.
rel_rec_l.
rel_rec_r.
rel_bind_l (#x <- _)%E.
iApply (bin_log_related_store_l' with "Hx"); eauto. iIntros "Hx".
simpl.
rel_store_l. simpl.
rel_rec_l.
unfold rand at 1. unlock.
iApply (bin_log_related_rec_l _ _ []); eauto. iNext. simpl.
rel_bind_l (Alloc _).
iApply bin_log_related_alloc_l'; eauto. iIntros (y) "Hy". simpl.
iApply (bin_log_related_rec_l _ _ []); eauto. iNext. simpl.
rel_rec_l.
rel_alloc_l as y "Hy". simpl.
rel_rec_l.
unfold rand. unlock.
rel_rec_r.
......@@ -161,11 +159,11 @@ Section Refinement.
{ iExists false. by iFrame. }
iMod (inv_alloc choiceN with "[Hinv]") as "#Hinv".
{ iNext. iApply "Hinv". }
rel_bind_r (Fork _).
iApply bin_log_related_fork_r; eauto. iIntros (i) "Hi".
rel_fork_r as i "Hi".
rel_rec_r.
rel_bind_l (Fork _).
iApply bin_log_related_fork_l;simpl. iModIntro.
rel_fork_l. iModIntro.
iSplitL "Hi".
- iNext.
iInv choiceN as (f) "[Hy Hy']" "Hcl".
......@@ -175,11 +173,10 @@ Section Refinement.
{ iNext. iExists true. by iFrame. }
done.
- rel_rec_l.
rel_rec_r.
iApply (bin_log_related_load_l _ _ _ []).
iInv choiceN as (f) "[Hy >Hy']" "Hcl". iModIntro.
iExists (#v f). iFrame. iIntros "Hy".
rel_load_l under choiceN as "Hys" "Hcl".
iDestruct "Hys" as (f) "[Hy >Hy']". iModIntro.
iExists (#v f). iFrame. iIntros "Hy". simpl.
rel_load_r.
iMod ("Hcl" with "[Hy Hy']").
{ iNext. iExists f. iFrame. }
......@@ -187,8 +184,7 @@ Section Refinement.
rel_rec_r.
rel_store_r. simpl.
rel_seq_r.
iApply bin_log_related_val; eauto.
{ iIntros (Δ). iModIntro. simpl. eauto. }
rel_vals. eauto.
Qed.
Lemma refinement Γ ρ :
......
This diff is collapsed.
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