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