File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
iris/logrel/compat_lemmas Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,42 @@ Section Fundamental.
244244 cbn [of_val].
245245 rewrite v_to_e_list1.
246246
247+ (* Store tag *)
248+ lwp_chomp 2.
249+ iApply (lenient_wp_seq with "[Hfr Hrun]").
250+ {
251+ set (Φ := {| lp_fr_inv := λ _, True;
252+ lp_val := λ f vs',
253+ ⌜∀ j, j ≠ (fe_wlocal_offset fe + length (wl ++ wl_save))%nat -> f_locs f !! j = f_locs fr_saved !! j⌝ ∗
254+ ⌜f_locs f !! (fe_wlocal_offset fe + length (wl ++ wl_save))%nat = Some (VAL_int32 (Wasm_int.Int32.repr i))⌝ ∗
255+ ⌜vs' = []⌝;
256+ lp_trap := False;
257+ lp_br := λ _ _, False;
258+ lp_ret := λ _, False;
259+ lp_host := λ _ _ _ _, False |}%I : @logpred Σ).
260+ iApply (lenient_wp_set_local _ _ _ Φ); last iFrame.
261+ 1: admit. (* fe_wlocal_offset fe + length (wl ++ wl_save) < length (f_locs fr_saved) *)
262+ unfold lp_val, Φ.
263+ iSplit.
264+ - iIntros "!> %j".
265+ iPureIntro.
266+ intros Hneq.
267+ simpl.
268+ apply util.set_nth_neq; try done.
269+ admit. (* fe_wlocal_offset fe + length (wl ++ wl_save) < length (f_locs fr_saved) *)
270+ - iSimpl.
271+ iSplit; last done.
272+ iPureIntro.
273+ apply set_nth_read.
274+ }
275+ { by iIntros. }
276+ iIntros (w fr_saved_and_tag) "Hnotrap Hfr _".
277+ destruct w; iEval (cbn) in "Hnotrap"; try done;
278+ try (iDestruct "Hnotrap" as "[? ?]"; done).
279+ iDestruct "Hnotrap" as "(Hrun & %Hsame' & %Hsaved_and_tag' & ->)".
280+ clear_nils.
281+
282+
247283Admitted .
248284
249285 Lemma compat_case M F L L' n_skip wt wt' wtf wl wl' wlf es' ess τs τs' κ :
Original file line number Diff line number Diff line change @@ -115,6 +115,18 @@ Proof.
115115 destruct (@ssrnat.ltP x y); auto.
116116Qed .
117117
118+ Lemma set_nth_neq:
119+ ∀ {A : Type} (l : seq.seq A) (i j : nat) (x : A),
120+ i < length l ->
121+ i <> j ->
122+ seq.set_nth x l i x !! j = l !! j.
123+ Proof .
124+ intros.
125+ rewrite properties.update_list_at_is_set_nth.
126+ rewrite stdpp_aux.update_ne; auto.
127+ auto using lt_ssrleq.
128+ Qed .
129+
118130Lemma set_nth_read_neq:
119131 ∀ {A : Type} (l : seq.seq A) (i j : nat) (x y : A),
120132 i <> j ->
You can’t perform that action at this time.
0 commit comments