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

try different notation

parent d3c31b45
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ Section notation_tests. ...@@ -207,7 +207,7 @@ Section notation_tests.
Context `{!heapG Σ, inv_heapG loc val Σ}. Context `{!heapG Σ, inv_heapG loc val Σ}.
(* Make sure these parse and type-check. *) (* Make sure these parse and type-check. *)
Lemma inv_mapsto_own_test (l : loc) : l @ #5 (λ _, True). Abort. Lemma inv_mapsto_own_test (l : loc) : l _(λ _, True) #5. Abort.
Lemma inv_mapsto_test (l : loc) : l ↦□ (λ _, True). Abort. Lemma inv_mapsto_test (l : loc) : l ↦□ (λ _, True). Abort.
End notation_tests. End notation_tests.
......
...@@ -68,11 +68,11 @@ Section definitions. ...@@ -68,11 +68,11 @@ Section definitions.
End definitions. End definitions.
Local Notation "l ↦□ I" := (inv_mapsto l I%stdpp%type) Local Notation "l '↦□' I" := (inv_mapsto l I%stdpp%type)
(at level 20, format "l ↦□ I") : bi_scope. (at level 20, format "l '↦□' I") : bi_scope.
Local Notation "l ↦@ v □ I" := (inv_mapsto_own l v I%stdpp%type) Local Notation "l '↦_' I v" := (inv_mapsto_own l v I%stdpp%type)
(at level 20, format "l ↦@ v □ I") : bi_scope. (at level 20, I at level 9, format "l '↦_' I v") : bi_scope.
(* [inv_heap_inv] has no parameters to infer the types from, so we need to (* [inv_heap_inv] has no parameters to infer the types from, so we need to
make them explicit. *) make them explicit. *)
...@@ -147,7 +147,7 @@ Section inv_heap. ...@@ -147,7 +147,7 @@ Section inv_heap.
Qed. Qed.
Lemma inv_mapsto_own_lookup_Some l v h I : Lemma inv_mapsto_own_lookup_Some l v h I :
l @ v I -∗ own (inv_heap_name gG) ( to_inv_heap h) -∗ l _I v -∗ own (inv_heap_name gG) ( to_inv_heap h) -∗
I', h !! l = Some (v, I') w, I w I' w ⌝. I', h !! l = Some (v, I') w, I w I' w ⌝.
Proof. Proof.
iIntros "Hl_inv H●". iIntros "Hl_inv H●".
...@@ -183,7 +183,7 @@ Section inv_heap. ...@@ -183,7 +183,7 @@ Section inv_heap.
Global Instance inv_mapsto_timeless l I : Timeless (l ↦□ I). Global Instance inv_mapsto_timeless l I : Timeless (l ↦□ I).
Proof. rewrite /inv_mapsto. apply _. Qed. Proof. rewrite /inv_mapsto. apply _. Qed.
Global Instance inv_mapsto_own_timeless l v I : Timeless (l @ v I). Global Instance inv_mapsto_own_timeless l v I : Timeless (l _I v).
Proof. rewrite /inv_mapsto. apply _. Qed. Proof. rewrite /inv_mapsto. apply _. Qed.
(** * Public lemmas *) (** * Public lemmas *)
...@@ -191,7 +191,7 @@ Section inv_heap. ...@@ -191,7 +191,7 @@ Section inv_heap.
Lemma make_inv_mapsto l v I E : Lemma make_inv_mapsto l v I E :
inv_heapN E inv_heapN E
I v I v
inv_heap_inv L V -∗ l v ={E}=∗ l @ v I. inv_heap_inv L V -∗ l v ={E}=∗ l _I v.
Proof. Proof.
iIntros (HN HI) "#Hinv Hl". iIntros (HN HI) "#Hinv Hl".
iMod (inv_acc_timeless _ inv_heapN with "Hinv") as "[HP Hclose]"; first done. iMod (inv_acc_timeless _ inv_heapN with "Hinv") as "[HP Hclose]"; first done.
...@@ -213,7 +213,7 @@ Section inv_heap. ...@@ -213,7 +213,7 @@ Section inv_heap.
+ iModIntro. by rewrite /inv_mapsto_own to_inv_heap_singleton. + iModIntro. by rewrite /inv_mapsto_own to_inv_heap_singleton.
Qed. Qed.
Lemma inv_mapsto_own_inv l v I : l @ v I -∗ l ↦□ I. Lemma inv_mapsto_own_inv l v I : l _I v -∗ l ↦□ I.
Proof. Proof.
apply own_mono, auth_frag_mono. rewrite singleton_included pair_included. apply own_mono, auth_frag_mono. rewrite singleton_included pair_included.
right. split; [apply: ucmra_unit_least|done]. right. split; [apply: ucmra_unit_least|done].
...@@ -224,7 +224,7 @@ Section inv_heap. ...@@ -224,7 +224,7 @@ Section inv_heap.
this before opening an atomic update that provides [inv_mapsto_own]!. *) this before opening an atomic update that provides [inv_mapsto_own]!. *)
Lemma inv_mapsto_own_acc_strong E : Lemma inv_mapsto_own_acc_strong E :
inv_heapN E inv_heapN E
inv_heap_inv L V ={E, E inv_heapN}=∗ l v I, l @ v I -∗ inv_heap_inv L V ={E, E inv_heapN}=∗ l v I, l _I v -∗
(I v l v ( w, I w -∗ l w ==∗ (I v l v ( w, I w -∗ l w ==∗
inv_mapsto_own l w I |={E inv_heapN, E}=> True)). inv_mapsto_own l w I |={E inv_heapN, E}=> True)).
Proof. Proof.
...@@ -252,8 +252,8 @@ Section inv_heap. ...@@ -252,8 +252,8 @@ Section inv_heap.
(** Derive a more standard accessor. *) (** Derive a more standard accessor. *)
Lemma inv_mapsto_own_acc E l v I: Lemma inv_mapsto_own_acc E l v I:
inv_heapN E inv_heapN E
inv_heap_inv L V -∗ l @ v I ={E, E inv_heapN}=∗ inv_heap_inv L V -∗ l _I v ={E, E inv_heapN}=∗
(I v l v ( w, I w -∗ l w ={E inv_heapN, E}=∗ l @ w I)). (I v l v ( w, I w -∗ l w ={E inv_heapN, E}=∗ l _I w)).
Proof. Proof.
iIntros (?) "#Hinv Hl". iIntros (?) "#Hinv Hl".
iMod (inv_mapsto_own_acc_strong with "Hinv") as "Hacc"; first done. iMod (inv_mapsto_own_acc_strong with "Hinv") as "Hacc"; first done.
......
...@@ -33,8 +33,8 @@ Notation "l ↦ -" := (l ↦{1} -)%I (at level 20) : bi_scope. ...@@ -33,8 +33,8 @@ Notation "l ↦ -" := (l ↦{1} -)%I (at level 20) : bi_scope.
Notation "l ↦□ I" := (inv_mapsto (L:=loc) (V:=val) l I%stdpp%type) Notation "l ↦□ I" := (inv_mapsto (L:=loc) (V:=val) l I%stdpp%type)
(at level 20, format "l ↦□ I") : bi_scope. (at level 20, format "l ↦□ I") : bi_scope.
Notation "l ↦@ v □ I" := (inv_mapsto_own (L:=loc) (V:=val) l v I%stdpp%type) Notation "l ↦_ I v" := (inv_mapsto_own (L:=loc) (V:=val) l v I%stdpp%type)
(at level 20, format "l ↦@ v □ I") : bi_scope. (at level 20, I at level 9, format "l ↦_ I v") : bi_scope.
(** The tactic [inv_head_step] performs inversion on hypotheses of the shape (** The tactic [inv_head_step] performs inversion on hypotheses of the shape
[head_step]. The tactic will discharge head-reductions starting from values, and [head_step]. The tactic will discharge head-reductions starting from values, and
......
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