Commit b2e55982 authored by Dan Frumin's avatar Dan Frumin

Bring some uniformity to [relational_properties]

- Make sure that arguments to the lemmas are in the consistent order:
\Gamma, E1, E2, K, e1, e2, \tau -- from left to right, as you write it
 on paper
- Add masks to all the lemmas
- Add missing rules
- Remove unnecessary closedness conditions
parent a1285d86
......@@ -401,8 +401,8 @@ Section CG_Counter.
iApply (bin_log_related_rec_l _ []); auto.
iNext. simpl.
rel_bind_r (App _ (#cnt')%E).
iApply (bin_log_related_rec_r _ _ ); auto. simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ [] ); auto. simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ _); auto. simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ _ _ []); auto. simpl. rewrite !Closed_subst_id.
unfold with_lock. unlock.
rel_bind_r (App _ (λ: "l", _))%E.
......@@ -411,7 +411,7 @@ Section CG_Counter.
{ simpl. by rewrite decide_left. }
simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ [] ); eauto. simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ _ _ []); eauto. simpl. rewrite !Closed_subst_id.
iApply bin_log_related_arrow.
iAlways. iIntros (Δ [v v']) "[% %]"; simpl in *; subst. clear Δ.
......@@ -434,7 +434,7 @@ Section CG_Counter.
(* simpl. *)
(* iApply bin_log_related_unit. *)
(* Opaque CG_locked_increment with_lock. *)
iApply (bin_log_related_rec_r _ []); eauto. simpl. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ _ _ []); eauto. simpl. rewrite !Closed_subst_id.
iLöb as "IH".
iApply (bin_log_related_rec_l _ _ []); eauto. iNext. simpl.
rel_bind_l (! #cnt)%E.
......@@ -459,27 +459,27 @@ Section CG_Counter.
rel_bind_r (acquire #l).
iApply (bin_log_related_acquire_r with "Hl"); simpl; eauto. solve_ndisj.
iIntros "Hl".
iApply (bin_log_related_rec_r _ []); simpl; eauto. solve_ndisj.
iApply (bin_log_related_rec_r _ _ _ []); simpl; eauto. solve_ndisj.
rel_bind_r (App _ #())%E.
iApply (bin_log_related_rec_r _ _); simpl; eauto. solve_ndisj. rewrite !Closed_subst_id.
rel_bind_r (CG_increment _ _).
iApply (bin_log_related_CG_increment_r with "Hcnt'"). solve_ndisj. simpl.
iIntros "Hcnt'".
iApply (bin_log_related_rec_r _ []); simpl; eauto. solve_ndisj. rewrite !Closed_subst_id.
iApply (bin_log_related_rec_r _ _ _ []); simpl; eauto. solve_ndisj. rewrite !Closed_subst_id.
rel_bind_r (release #l)%E.
iApply (bin_log_related_release_r with "Hl"). solve_ndisj.
iIntros "Hl". simpl.
iMod ("Hcl" with "[-]").
{ iNext. iExists _. by iFrame. }
iApply (bin_log_related_if_true_l _ _ []). iNext. simpl.
iApply (bin_log_related_rec_r _ []); simpl; eauto.
iApply (bin_log_related_rec_r _ _ _ []); simpl; eauto.
iApply bin_log_related_unit.
- (* CASE [m n], CAS fails *)
iSplitL; last first. iIntros "%". exfalso. apply Hmn. by inversion H1.
iIntros "% Hcnt". simpl.
iMod ("Hcl" with "[-]").
{ iNext. iExists _. by iFrame. }
iApply (bin_log_related_if_false_l _ []). iNext. simpl.
iApply (bin_log_related_if_false_l _ _ []). iNext. simpl.
iApply "IH".
Qed.
......@@ -490,7 +490,7 @@ Section CG_Counter.
rel_bind_r newlock.
iApply (bin_log_related_newlock_r); auto; simpl.
iIntros (l) "Hl".
iApply (bin_log_related_rec_r _ []); auto. rewrite /= !Closed_subst_id /=.
iApply (bin_log_related_rec_r _ _ _ []); auto. rewrite /= !Closed_subst_id /=.
rel_bind_l (Alloc _).
iApply (bin_log_related_alloc_l); auto; simpl. iModIntro.
iIntros (cnt) "Hcnt".
......@@ -507,19 +507,19 @@ Section CG_Counter.
iApply (bin_log_related_rec_l _ _ []); auto.
iNext. rewrite /= !Closed_subst_id /=.
iApply (bin_log_related_rec_r _ []); auto. simpl.
iApply (bin_log_related_rec_r _ _ _ []); auto. simpl.
rewrite /= !Closed_subst_id /=.
rel_bind_r (CG_counter_body _).
unfold CG_counter_body. unlock.
iApply (bin_log_related_rec_r _ _); auto.
rewrite /= !Closed_subst_id /=.
iApply (bin_log_related_rec_r _ []); auto.
iApply (bin_log_related_rec_r _ _ _ []); auto.
rewrite /= !Closed_subst_id /=.
iApply (bin_log_related_pair _ with "[]"); last first.
- Transparent counter_read.
unfold counter_read. unlock.
iApply (bin_log_related_rec_r _ []); auto. simpl.
iApply (bin_log_related_rec_r _ _ _ []); auto. simpl.
iApply (bin_log_related_rec_l _ _ []); auto. simpl. iNext.
iApply bin_log_related_rec; simpl. iAlways. cbn.
iApply (bin_log_related_load_l _ _ _ []).
......
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