Skip to content

Commit b1fdc24

Browse files
committed
conc adeq
1 parent 34b803c commit b1fdc24

File tree

3 files changed

+296
-166
lines changed

3 files changed

+296
-166
lines changed

theories/effects/store.v

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,40 @@ Definition state_cas X `{!Cofe X} : (loc * (laterO X) * (laterO X) * (laterO (X
7373
Some (later_map fst r, <[l := later_map snd r]>σ, []).
7474
#[export] Instance state_cas_ne X `{!Cofe X} :
7575
NonExpansive (state_cas X : prodO _ (stateF ♯ X) → optionO (laterO X * (stateF ♯ X) * listO (laterO X))%type).
76-
(* Proof. *)
77-
(* intros n [[[[m1 k1] p1] n1] s1] [[[[m2 k2] p2] n2] s2]. simpl. *)
78-
(* intros [[[[Hm Hk] Hp] Hn] Hs]. simpl in *. *)
79-
(* f_equiv. *)
80-
(* - intros ?? Hxy; simpl. *)
81-
(* do 3 f_equiv; first solve_proper. *)
82-
(* rewrite Hs Hm. *)
83-
(* do 3 f_equiv; solve_proper. *)
84-
(* - by rewrite Hs Hm. *)
85-
(* Qed. *)
86-
Admitted.
76+
Proof.
77+
intros n [[[[m1 k1] p1] n1] s1] [[[[m2 k2] p2] n2] s2]. simpl.
78+
intros [[[[Hm Hk] Hp] Hn] Hs]. simpl in *.
79+
f_equiv.
80+
- intros ?? Hxy; simpl.
81+
do 3 f_equiv.
82+
+ rewrite !later_map_Next.
83+
apply Next_contractive.
84+
destruct n.
85+
* apply dist_later_0.
86+
* apply dist_later_S.
87+
do 2 f_equiv.
88+
-- f_equiv.
89+
++ f_equiv.
90+
** apply Hn; lia.
91+
** apply Hxy; lia.
92+
++ apply Hk; lia.
93+
-- apply Hp; lia.
94+
+ rewrite !later_map_Next.
95+
rewrite Hm.
96+
f_equiv; last done.
97+
apply Next_contractive.
98+
destruct n.
99+
-- apply dist_later_0.
100+
-- apply dist_later_S.
101+
do 2 f_equiv.
102+
++ f_equiv.
103+
** f_equiv.
104+
--- apply Hn; lia.
105+
--- apply Hxy; lia.
106+
** apply Hk; lia.
107+
++ apply Hp; lia.
108+
- by rewrite Hs Hm.
109+
Qed.
87110

88111
Program Definition ReadE : opInterp := {|
89112
Ins := locO;
@@ -262,7 +285,7 @@ Section wp.
262285
iIntros "Ha Hf".
263286
iPoseProof (own_valid_2 with "Ha Hf") as "H".
264287
rewrite gmap_view_both_validI.
265-
iDestruct "H" as "[%H [G Hval]]".
288+
iDestruct "H" as "[%H Hval]".
266289
rewrite lookup_fmap.
267290
rewrite option_equivI.
268291
destruct (σ !! l) as [o |] eqn:Heq.
@@ -286,8 +309,7 @@ Section wp.
286309
Proof.
287310
iIntros "H Hl".
288311
iMod (own_update_2 with "H Hl") as "[$ $]"; last done.
289-
apply gmap_view_replace.
290-
done.
312+
apply gmap_view_update.
291313
Qed.
292314
Lemma istate_delete l α σ :
293315
own heapG_name (●V σ) -∗ pointsto l α ==∗ own heapG_name (●V delete l σ).

theories/gitree/reductions.v

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ Section external_step.
109109
++ rewrite Hs Hs' //.
110110
Qed.
111111

112+
Lemma tp_external_step_mono αs σ βs σ'
113+
: tp_external_step αs σ βs σ' → length αs <= length βs.
114+
Proof.
115+
induction 1 as [????????? H1 H2].
116+
rewrite H1 H2.
117+
rewrite !app_length !cons_length app_length.
118+
apply Nat.add_le_mono_l.
119+
rewrite -plus_Sn_m.
120+
apply Nat.le_add_r.
121+
Qed.
122+
112123
Lemma external_step_tp_external_step α β σ σ' e1 e2 l
113124
: external_step α σ β σ' l
114125
→ tp_external_step (e1 ++ α :: e2) σ (e1 ++ β :: e2 ++ l) σ'.
@@ -157,6 +168,15 @@ Section external_step.
157168
++ rewrite Ha Hs//.
158169
Qed.
159170

171+
Lemma tp_external_steps_mono αs σ βs σ' k
172+
: tp_external_steps αs σ βs σ' k → length αs <= length βs.
173+
Proof.
174+
induction 1 as [???? H1 H2 | ??????? H1 H2 H3].
175+
- by rewrite H1.
176+
- etransitivity; last apply H3.
177+
eapply tp_external_step_mono; done.
178+
Qed.
179+
160180
Lemma external_steps_tp_external_steps α β σ σ' e1 e2 l n
161181
: external_steps α σ β σ' l n
162182
→ tp_external_steps (e1 ++ α :: e2) σ (e1 ++ β :: e2 ++ l) σ' n.

0 commit comments

Comments
 (0)