Commit 8e8c7228 by Ralf Jung

### change IntoVal so that it is easier to use in specs

parent bf9fd4f5
 ... ... @@ -32,6 +32,7 @@ Changes in Coq: - `cmra_opM_assoc_L` → `cmra_op_opM_assoc_L` - `cmra_opM_assoc'` → `cmra_opM_opM_assoc` * `namespaces` has been moved to std++. * Changed `IntoVal` to be directly usable for rewriting `e` into `of_val v`. ## Iris 3.1.0 (released 2017-12-19) ... ...
 ... ... @@ -82,7 +82,7 @@ Section proof. (λ v (_:()), l ↦ w)%I (λ _ _, #()%V). Proof. iIntros (<-%of_to_val Q Φ) "? AU". wp_let. wp_proj. wp_proj. iIntros (<- Q Φ) "? AU". wp_let. wp_proj. wp_proj. iMod (aupd_acc with "AU") as (v) "[H↦ [_ Hclose]]"; first solve_ndisj. wp_store. iMod ("Hclose" \$! () with "H↦") as "HΦ". by iApply "HΦ". Qed. ... ... @@ -95,7 +95,7 @@ Section proof. (λ v (_:()), if decide (v = w1) then l ↦ w2 else l ↦ v)%I (λ v _, #(if decide (v = w1) then true else false)%V). Proof. iIntros (<-%of_to_val <-%of_to_val Q Φ) "? AU". wp_let. repeat wp_proj. iIntros (<- <- Q Φ) "? AU". wp_let. repeat wp_proj. iMod (aupd_acc with "AU") as (v) "[H↦ [_ Hclose]]"; first solve_ndisj. destruct (decide (v = w1)) as [Hv|Hv]; [wp_cas_suc|wp_cas_fail]; iMod ("Hclose" \$! () with "H↦") as "HΦ"; by iApply "HΦ". ... ...
 ... ... @@ -21,13 +21,13 @@ Context `{!heapG Σ, !spawnG Σ}. brought together. That is strictly stronger than first stripping a later and then merging them, as demonstrated by [tests/joining_existentials.v]. This is why these are not Texan triples. *) Lemma par_spec (Ψ1 Ψ2 : val → iProp Σ) e (f1 f2 : val) (Φ : val → iProp Σ) `{Hef : !IntoVal e (f1,f2)} : Lemma par_spec (Ψ1 Ψ2 : val → iProp Σ) e (f1 f2 : val) (Φ : val → iProp Σ) : IntoVal e (f1,f2) → WP f1 #() {{ Ψ1 }} -∗ WP f2 #() {{ Ψ2 }} -∗ (▷ ∀ v1 v2, Ψ1 v1 ∗ Ψ2 v2 -∗ ▷ Φ (v1,v2)%V) -∗ WP par e {{ Φ }}. Proof. apply of_to_val in Hef as <-. iIntros "Hf1 Hf2 HΦ". iIntros (<-) "Hf1 Hf2 HΦ". rewrite /par /=. wp_let. wp_proj. wp_apply (spawn_spec parN with "Hf1"). iIntros (l) "Hl". wp_let. wp_proj. wp_bind (f2 _). ... ...
 ... ... @@ -44,10 +44,11 @@ Global Instance join_handle_ne n l : Proof. solve_proper. Qed. (** The main proofs. *) Lemma spawn_spec (Ψ : val → iProp Σ) e (f : val) `{Hef : !IntoVal e f} : Lemma spawn_spec (Ψ : val → iProp Σ) e (f : val) : IntoVal e f → {{{ WP f #() {{ Ψ }} }}} spawn e {{{ l, RET #l; join_handle l Ψ }}}. Proof. apply of_to_val in Hef as <-. iIntros (Φ) "Hf HΦ". rewrite /spawn /=. iIntros (<- Φ) "Hf HΦ". rewrite /spawn /=. wp_let. wp_alloc l as "Hl". wp_let. iMod (own_alloc (Excl ())) as (γ) "Hγ"; first done. iMod (inv_alloc N _ (spawn_inv γ l Ψ) with "[Hl]") as "#?". ... ...