adequacy.v 813 Bytes
Newer Older
1 2 3
From iris.program_logic Require Export weakestpre adequacy.
From iris.algebra Require Import auth.
From iris.proofmode Require Import tactics.
4
From iris_logrel.F_mu_ref_conc Require Export rules.
5 6 7 8 9 10 11 12 13 14 15
Set Default Proof Using "Type".

Class heapPreG Σ := HeapPreG {
  heap_preG_iris :> invPreG Σ;
  heap_preG_heap :> gen_heapPreG loc val Σ
}.

Definition heapΣ : gFunctors := #[invΣ; gen_heapΣ loc val].
Instance subG_heapPreG {Σ} : subG heapΣ Σ  heapPreG Σ.
Proof. solve_inG. Qed.

Dan Frumin's avatar
Dan Frumin committed
16 17 18
Definition heap_adequacy Σ `{heapPreG Σ} s e σ φ :
  ( `{heapG Σ}, WP e @ s;  {{ v, ⌜φ v }}%I) 
  adequate s e σ φ.
19 20
Proof.
  intros Hwp; eapply (wp_adequacy _ _); iIntros (?) "".
Dan Frumin's avatar
Dan Frumin committed
21 22 23
  iMod (gen_heap_init σ) as (?) "Hh".
  iModIntro. iExists gen_heap_ctx. iFrame "Hh".
  iApply (Hwp (HeapG _ _ _)).
24
Qed.