Skip to content
Snippets Groups Projects
Commit b3de22f7 authored by Yusuke Matsushita's avatar Yusuke Matsushita
Browse files

Minor fix

parent aa76daa6
Branches
Tags
No related merge requests found
...@@ -109,9 +109,8 @@ Section smallvec_basic. ...@@ -109,9 +109,8 @@ Section smallvec_basic.
typed_val (smallvec_new n ty) (fn() smallvec n ty) (λ post _, post []). typed_val (smallvec_new n ty) (fn() smallvec n ty) (λ post _, post []).
Proof. Proof.
eapply type_fn; [apply _|]=> _ ???. simpl_subst. eapply type_fn; [apply _|]=> _ ???. simpl_subst.
iIntros (???) "_ #TIME _ _ _ Na L C _ Obs". iIntros (???) "_ #TIME _ _ _ Na L C _ Obs". iMod persistent_time_receipt_0 as "⧖".
iMod persistent_time_receipt_0 as "⧖". wp_bind (new _). wp_bind (new _). iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|].
iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|].
iApply wp_new; [done..|]. iIntros "!>" (r). iApply wp_new; [done..|]. iIntros "!>" (r).
rewrite !Nat2Z.id/= !heap_mapsto_vec_cons !shift_loc_assoc. rewrite !Nat2Z.id/= !heap_mapsto_vec_cons !shift_loc_assoc.
iIntros "[† (↦₀ & ↦₁ & ↦₂ & ↦₃ & ↦ex)] ⧖". wp_seq. wp_write. iIntros "[† (↦₀ & ↦₁ & ↦₂ & ↦₃ & ↦ex)] ⧖". wp_seq. wp_write.
...@@ -120,7 +119,7 @@ Section smallvec_basic. ...@@ -120,7 +119,7 @@ Section smallvec_basic.
iExists _, _. do 2 (iSplit; [done|]). rewrite/= freeable_sz_full. iExists _, _. do 2 (iSplit; [done|]). rewrite/= freeable_sz_full.
iFrame "†". iNext. rewrite split_mt_smallvec. iExists true, _, 0, 0, [#]. iFrame "†". iNext. rewrite split_mt_smallvec. iExists true, _, 0, 0, [#].
rewrite/= !heap_mapsto_vec_cons !shift_loc_assoc heap_mapsto_vec_nil. rewrite/= !heap_mapsto_vec_cons !shift_loc_assoc heap_mapsto_vec_nil.
iFrame "↦₀ ↦₁ ↦₂ ↦₃". do 2 (iSplit; [done|]). iExists _. iFrame. iFrame "↦₀ ↦₁ ↦₂ ↦₃". do 2 (iSplit; [done|]). iExists _. iFrame "↦ex".
by rewrite repeat_length. by rewrite repeat_length.
Qed. Qed.
......
...@@ -87,11 +87,10 @@ Section vec_basic. ...@@ -87,11 +87,10 @@ Section vec_basic.
typed_val vec_new (fn() vec_ty ty) (λ post _, post []). typed_val vec_new (fn() vec_ty ty) (λ post _, post []).
Proof. Proof.
eapply type_fn; [apply _|]=> _ ???. simpl_subst. eapply type_fn; [apply _|]=> _ ???. simpl_subst.
iIntros (???) "_ #TIME _ _ _ Na L C _ Obs". iIntros (???) "_ #TIME _ _ _ Na L C _ Obs". wp_apply wp_new; [done..|].
wp_apply wp_new; [done..|]. iIntros (r). iIntros (r). rewrite !heap_mapsto_vec_cons shift_loc_assoc.
rewrite !heap_mapsto_vec_cons shift_loc_assoc. iIntros "[† (↦₀ & ↦₁ & ↦₂ &_)]". iIntros "[† (↦₀ & ↦₁ & ↦₂ &_)]". wp_seq. iMod persistent_time_receipt_0 as "⧖".
wp_seq. iMod persistent_time_receipt_0 as "⧖". wp_bind (new _). wp_bind (new _). iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|].
iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|].
iApply wp_new; [done..|]. iIntros "!>" (l) "[†' _] ⧖". wp_bind (_ <- _)%E. iApply wp_new; [done..|]. iIntros "!>" (l) "[†' _] ⧖". wp_bind (_ <- _)%E.
iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|]. wp_write. iApply (wp_persistent_time_receipt with "TIME ⧖"); [done|]. wp_write.
iIntros "⧖". wp_seq. wp_op. wp_write. wp_op. wp_write. do 2 wp_seq. iIntros "⧖". wp_seq. wp_op. wp_write. wp_op. wp_write. do 2 wp_seq.
...@@ -100,7 +99,7 @@ Section vec_basic. ...@@ -100,7 +99,7 @@ Section vec_basic.
iExists _, _. do 2 (iSplit; [done|]). rewrite/= freeable_sz_full split_mt_vec'. iExists _, _. do 2 (iSplit; [done|]). rewrite/= freeable_sz_full split_mt_vec'.
iFrame "†". iNext. iExists _, 0, 0, [#]=>/=. iSplit; [done|]. iFrame "†". iNext. iExists _, 0, 0, [#]=>/=. iSplit; [done|].
rewrite !heap_mapsto_vec_cons heap_mapsto_vec_nil shift_loc_assoc. rewrite !heap_mapsto_vec_cons heap_mapsto_vec_nil shift_loc_assoc.
iFrame "↦₀ ↦₁ ↦₂ †'". iSplit; [by iNext|]. iExists []. by rewrite heap_mapsto_vec_nil. iFrame "↦₀ ↦₁ ↦₂ †'". iSplit; [done|]. iExists []. by rewrite heap_mapsto_vec_nil.
Qed. Qed.
Definition vec_drop {𝔄} (ty: type 𝔄) : val := Definition vec_drop {𝔄} (ty: type 𝔄) : val :=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment