Skip to content
Snippets Groups Projects
Commit 19c45f91 authored by Ralf Jung's avatar Ralf Jung
Browse files

fix heap_lang/adequacy

(forgot to add this to the previous commit...)
parent 6fddc211
No related branches found
No related tags found
No related merge requests found
From iris.program_logic Require Export weakestpre adequacy. From iris.program_logic Require Export weakestpre adequacy.
From iris.heap_lang Require Export heap. From iris.heap_lang Require Export heap.
From iris.algebra Require Import auth. From iris.algebra Require Import auth.
From iris.program_logic Require Import ownership. From iris.program_logic Require Import ownership auth.
From iris.heap_lang Require Import proofmode notation. From iris.heap_lang Require Import proofmode notation.
From iris.proofmode Require Import tactics. From iris.proofmode Require Import tactics.
Class heapPreG Σ := HeapPreG { Class heapPreG Σ := HeapPreG {
heap_preG_iris :> irisPreG heap_lang Σ; heap_preG_iris :> irisPreG heap_lang Σ;
heap_preG_heap :> inG Σ (authR heapUR) heap_preG_heap :> authG Σ heapUR
}. }.
Definition heapΣ : gFunctors := Definition heapΣ : gFunctors :=
#[irisΣ heap_lang; GFunctor (constRF (authR heapUR))]. #[irisΣ heap_lang; authΣ heapUR].
Instance subG_heapPreG {Σ} : subG heapΣ Σ heapPreG Σ. Instance subG_heapPreG {Σ} : subG heapΣ Σ heapPreG Σ.
Proof. intros [? ?%subG_inG]%subG_inv. split; apply _. Qed. Proof. intros [? ?]%subG_inv. split; apply _. Qed.
Definition heap_adequacy Σ `{heapPreG Σ} e σ φ : Definition heap_adequacy Σ `{heapPreG Σ} e σ φ :
( `{heapG Σ}, heap_ctx WP e {{ v, φ v }}) ( `{heapG Σ}, heap_ctx WP e {{ v, φ v }})
adequate e σ φ. adequate e σ φ.
Proof. Proof.
intros Hwp; eapply (wp_adequacy Σ); iIntros (?) "Hσ". intros Hwp; eapply (wp_adequacy Σ); iIntros (?) "Hσ".
iVs (own_alloc ( to_heap σ)) as (γ) "Hh". iVs (auth_alloc to_heap ownP heapN _ σ with "[Hσ]") as (γ) "[Hh _]".
{ apply (auth_auth_valid (to_heap _)), to_heap_valid. } { exact: to_heap_valid. }
{ by iNext. }
set (Hheap := HeapG _ _ _ γ). set (Hheap := HeapG _ _ _ γ).
iVs (inv_alloc heapN _ heap_inv with "[-]"); [iNext; iExists σ; by iFrame|].
iApply (Hwp _). by rewrite /heap_ctx. iApply (Hwp _). by rewrite /heap_ctx.
Qed. Qed.
\ No newline at end of file
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