diff --git a/heap_lang/heap.v b/heap_lang/heap.v index 65de4c44875bb15a58ad31bfb256a225b92706c6..adbcaa6760cf1cb3a74a23e3e8cfe9b6eab36595 100644 --- a/heap_lang/heap.v +++ b/heap_lang/heap.v @@ -144,8 +144,17 @@ Section heap. by apply pure_elim_r. Qed. - Lemma heap_mapsto_op_split l q v : l ↦{q} v ⊣⊢ (l ↦{q/2} v ★ l ↦{q/2} v). - Proof. by rewrite heap_mapsto_op_eq Qp_div_2. Qed. + Lemma heap_mapsto_op_1 l q1 q2 v1 v2 : + l ↦{q1} v1 ★ l ↦{q2} v2 ⊢ v1 = v2 ∧ l ↦{q1+q2} v1. + Proof. by rewrite heap_mapsto_op. Qed. + + Lemma heap_mapsto_op_half l q v1 v2 : + l ↦{q/2} v1 ★ l ↦{q/2} v2 ⊣⊢ v1 = v2 ∧ l ↦{q} v1. + Proof. by rewrite heap_mapsto_op Qp_div_2. Qed. + + Lemma heap_mapsto_op_half_1 l q v1 v2 : + l ↦{q/2} v1 ★ l ↦{q/2} v2 ⊢ v1 = v2 ∧ l ↦{q} v1. + Proof. by rewrite heap_mapsto_op_half. Qed. (** Weakest precondition *) (* FIXME: try to reduce usage of wp_pvs. We're losing view shifts here. *) diff --git a/heap_lang/proofmode.v b/heap_lang/proofmode.v index 68f480a12d057f378f9e49a0453b5bbbcfc9eae6..1fbd3665160f85e9a7ac34a2621a500d6ea693c7 100644 --- a/heap_lang/proofmode.v +++ b/heap_lang/proofmode.v @@ -13,7 +13,7 @@ Implicit Types Δ : envs (iResUR heap_lang (globalF Σ)). Global Instance into_sep_mapsto l q v : IntoSep false (l ↦{q} v) (l ↦{q/2} v) (l ↦{q/2} v). -Proof. by rewrite /IntoSep heap_mapsto_op_split. Qed. +Proof. by rewrite /IntoSep heap_mapsto_op_eq Qp_div_2. Qed. Lemma tac_wp_alloc Δ Δ' E j e v Φ : to_val e = Some v →