Skip to content

Commit

Permalink
add wp_load_shared for HeapLang
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhance committed Sep 15, 2024
1 parent 54018a7 commit f873eae
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
opam update
opam pin coq 8.19.1 --confirm-level=yes
opam pin coq-iris 4.2.0 --confirm-level=yes
opam pin coq-iris-heap-lang 4.2.0 --confirm-level=yes
- name: Run check
run: |
Expand Down
1 change: 1 addition & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ src/examples/seqs.v
src/examples/main.v
src/examples/fractional.v
src/examples/counting.v
src/examples/heap_lang_wp_load_shared.v

-arg -w -arg -argument-scope-delimiter
-arg -w -arg -notation-overridden
Expand Down
25 changes: 25 additions & 0 deletions src/examples/heap_lang_wp_load_shared.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From iris.prelude Require Import options.
From iris.program_logic Require Export weakestpre.
From iris.heap_lang Require Export lang proofmode notation.

Require Import guarding.guard.
Require Import guarding.tactics.

(* Derivation for Heap-Read-Shared law for HeapLang. *)

Section HeapLangWpLoadShared.

Context `{!heapGS Σ}.

Lemma wp_load_shared s E F l dq v G : (F ⊆ E) →
{{{ G ∗ (G &&{F}&&> l ↦{dq} v) }}} Load (Val $ LitV $ LitLoc l) @ s; E {{{ RET v; G }}}.
Proof.
intros Hfe.
iIntros (Φ) "[G #g] HΦ".
leaf_open "g" with "G" as "[Hpt Hback]". { set_solver. }
wp_load.
iMod ("Hback" with "Hpt") as "G".
iModIntro. iApply "HΦ". iFrame "G".
Qed.

End HeapLangWpLoadShared.

0 comments on commit f873eae

Please sign in to comment.