Skip to content
Snippets Groups Projects
Commit b64b3e9b authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

And also a variant when having to mapstos.

parent ca714fcf
No related branches found
No related tags found
No related merge requests found
...@@ -79,12 +79,6 @@ Section heap. ...@@ -79,12 +79,6 @@ Section heap.
Global Instance heap_mapsto_timeless l q v : TimelessP (l {q} v). Global Instance heap_mapsto_timeless l q v : TimelessP (l {q} v).
Proof. rewrite heap_mapsto_eq /heap_mapsto_def. apply _. Qed. Proof. rewrite heap_mapsto_eq /heap_mapsto_def. apply _. Qed.
Lemma heap_mapsto_valid l q v : l {q} v q.
Proof.
rewrite heap_mapsto_eq /heap_mapsto_def auth_own_valid !discrete_valid.
by apply pure_mono=> /singleton_valid [??].
Qed.
Lemma heap_mapsto_op_eq l q1 q2 v : l {q1} v l {q2} v ⊣⊢ l {q1+q2} v. Lemma heap_mapsto_op_eq l q1 q2 v : l {q1} v l {q2} v ⊣⊢ l {q1+q2} v.
Proof. Proof.
by rewrite heap_mapsto_eq -auth_own_op op_singleton pair_op dec_agree_idemp. by rewrite heap_mapsto_eq -auth_own_op op_singleton pair_op dec_agree_idemp.
...@@ -125,6 +119,15 @@ Section heap. ...@@ -125,6 +119,15 @@ Section heap.
Lemma heap_ex_mapsto_op_half l q : l {q/2} - l {q/2} - ⊣⊢ l {q} -. Lemma heap_ex_mapsto_op_half l q : l {q/2} - l {q/2} - ⊣⊢ l {q} -.
Proof. by rewrite heap_ex_mapsto_op Qp_div_2. Qed. Proof. by rewrite heap_ex_mapsto_op Qp_div_2. Qed.
Lemma heap_mapsto_valid l q v : l {q} v q.
Proof.
rewrite heap_mapsto_eq /heap_mapsto_def auth_own_valid !discrete_valid.
by apply pure_mono=> /singleton_valid [??].
Qed.
Lemma heap_mapsto_valid_2 l q1 q2 v1 v2 :
l {q1} v1 l {q2} v2 (q1 + q2)%Qp.
Proof. rewrite heap_mapsto_op heap_mapsto_valid. auto with I. Qed.
(** Weakest precondition *) (** Weakest precondition *)
Lemma wp_alloc E e v : Lemma wp_alloc E e v :
to_val e = Some v nclose heapN E to_val e = Some v nclose heapN E
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment