Commit e354bede by Ralf Jung

### New notation for Texan triple postconditions: Use 'RET' as keyword to indicate the return value

`This should make theme asier to parse, "{{{ v, v; l |-> v }}}" looks rather funny.`
parent 8d2d3ac3
 ... ... @@ -122,7 +122,7 @@ Section heap. (** Weakest precondition *) Lemma wp_alloc E e v : to_val e = Some v → nclose heapN ⊆ E → {{{ heap_ctx }}} Alloc e @ E {{{ l; LitV (LitLoc l), l ↦ v }}}. {{{ heap_ctx }}} Alloc e @ E {{{ l, RET LitV (LitLoc l); l ↦ v }}}. Proof. iIntros (<-%of_to_val ? Φ) "#Hinv HΦ". rewrite /heap_ctx. iMod (auth_empty heap_name) as "Ha". ... ... @@ -137,7 +137,7 @@ Section heap. Lemma wp_load E l q v : nclose heapN ⊆ E → {{{ heap_ctx ★ ▷ l ↦{q} v }}} Load (Lit (LitLoc l)) @ E {{{; v, l ↦{q} v }}}. {{{ RET v; l ↦{q} v }}}. Proof. iIntros (? Φ) "[#Hinv >Hl] HΦ". rewrite /heap_ctx heap_mapsto_eq /heap_mapsto_def. ... ... @@ -150,7 +150,7 @@ Section heap. Lemma wp_store E l v' e v : to_val e = Some v → nclose heapN ⊆ E → {{{ heap_ctx ★ ▷ l ↦ v' }}} Store (Lit (LitLoc l)) e @ E {{{; LitV LitUnit, l ↦ v }}}. {{{ RET LitV LitUnit; l ↦ v }}}. Proof. iIntros (<-%of_to_val ? Φ) "[#Hinv >Hl] HΦ". rewrite /heap_ctx heap_mapsto_eq /heap_mapsto_def. ... ... @@ -166,7 +166,7 @@ Section heap. Lemma wp_cas_fail E l q v' e1 v1 e2 v2 : to_val e1 = Some v1 → to_val e2 = Some v2 → v' ≠ v1 → nclose heapN ⊆ E → {{{ heap_ctx ★ ▷ l ↦{q} v' }}} CAS (Lit (LitLoc l)) e1 e2 @ E {{{; LitV (LitBool false), l ↦{q} v' }}}. {{{ RET LitV (LitBool false); l ↦{q} v' }}}. Proof. iIntros (<-%of_to_val <-%of_to_val ?? Φ) "[#Hinv >Hl] HΦ". rewrite /heap_ctx heap_mapsto_eq /heap_mapsto_def. ... ... @@ -179,7 +179,7 @@ Section heap. Lemma wp_cas_suc E l e1 v1 e2 v2 : to_val e1 = Some v1 → to_val e2 = Some v2 → nclose heapN ⊆ E → {{{ heap_ctx ★ ▷ l ↦ v1 }}} CAS (Lit (LitLoc l)) e1 e2 @ E {{{; LitV (LitBool true), l ↦ v2 }}}. {{{ RET LitV (LitBool true); l ↦ v2 }}}. Proof. iIntros (<-%of_to_val <-%of_to_val ? Φ) "[#Hinv >Hl] HΦ". rewrite /heap_ctx heap_mapsto_eq /heap_mapsto_def. ... ...
 ... ... @@ -92,7 +92,7 @@ Qed. (** Actual proofs *) Lemma newbarrier_spec (P : iProp Σ) : heapN ⊥ N → {{{ heap_ctx }}} newbarrier #() {{{ l; #l, recv l P ★ send l P }}}. {{{ heap_ctx }}} newbarrier #() {{{ l, RET #l; recv l P ★ send l P }}}. Proof. iIntros (HN Φ) "#? HΦ". rewrite -wp_fupd /newbarrier /=. wp_seq. wp_alloc l as "Hl". ... ... @@ -117,7 +117,7 @@ Proof. Qed. Lemma signal_spec l P : {{{ send l P ★ P }}} signal #l {{{; #(), True }}}. {{{ send l P ★ P }}} signal #l {{{ RET #(); True }}}. Proof. rewrite /signal /send /barrier_ctx /=. iIntros (Φ) "(Hs&HP) HΦ"; iDestruct "Hs" as (γ) "[#(%&Hh&Hsts) Hγ]". wp_let. ... ... @@ -133,7 +133,7 @@ Proof. Qed. Lemma wait_spec l P: {{{ recv l P }}} wait #l {{{ ; #(), P }}}. {{{ recv l P }}} wait #l {{{ RET #(); P }}}. Proof. rename P into R; rewrite /recv /barrier_ctx. iIntros (Φ) "Hr HΦ"; iDestruct "Hr" as (γ P Q i) "(#(%&Hh&Hsts)&Hγ&#HQ&HQR)". ... ...