Commit b672285b authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan

Merge branch 'master' of gitlab.mpi-sws.org:FP/iris-coq

parents 9321e1ad 61adc968
...@@ -136,7 +136,7 @@ Lemma to_agree_car n (x : agree A) : ✓{n} x → to_agree (x n) ≡{n}≡ x. ...@@ -136,7 +136,7 @@ Lemma to_agree_car n (x : agree A) : ✓{n} x → to_agree (x n) ≡{n}≡ x.
Proof. intros [??]; split; naive_solver eauto using agree_valid_le. Qed. Proof. intros [??]; split; naive_solver eauto using agree_valid_le. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma agree_equivI {M} a b : (to_agree a to_agree b) (a b : uPred M). Lemma agree_equivI {M} a b : to_agree a to_agree b (a b : uPred M).
Proof. Proof.
uPred.unseal. do 2 split. by intros [? Hv]; apply (Hv n). apply: to_agree_ne. uPred.unseal. do 2 split. by intros [? Hv]; apply (Hv n). apply: to_agree_ne.
Qed. Qed.
......
...@@ -164,14 +164,14 @@ Canonical Structure authUR := ...@@ -164,14 +164,14 @@ Canonical Structure authUR :=
(** Internalized properties *) (** Internalized properties *)
Lemma auth_equivI {M} (x y : auth A) : Lemma auth_equivI {M} (x y : auth A) :
(x y) (authoritative x authoritative y own x own y : uPred M). x y (authoritative x authoritative y own x own y : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
Lemma auth_validI {M} (x : auth A) : Lemma auth_validI {M} (x : auth A) :
( x) (match authoritative x with x (match authoritative x with
| Excl' a => ( b, a own x b) a | Excl' a => ( b, a own x b) a
| None => own x | None => own x
| ExclBot' => False | ExclBot' => False
end : uPred M). end : uPred M).
Proof. uPred.unseal. by destruct x as [[[]|]]. Qed. Proof. uPred.unseal. by destruct x as [[[]|]]. Qed.
Lemma auth_frag_op a b : (a b) a b. Lemma auth_frag_op a b : (a b) a b.
......
...@@ -241,22 +241,22 @@ Proof. by move=> H n[]? =>[|/H|]. Qed. ...@@ -241,22 +241,22 @@ Proof. by move=> H n[]? =>[|/H|]. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma csum_equivI {M} (x y : csum A B) : Lemma csum_equivI {M} (x y : csum A B) :
(x y) (match x, y with x y (match x, y with
| Cinl a, Cinl a' => a a' | Cinl a, Cinl a' => a a'
| Cinr b, Cinr b' => b b' | Cinr b, Cinr b' => b b'
| CsumBot, CsumBot => True | CsumBot, CsumBot => True
| _, _ => False | _, _ => False
end : uPred M). end : uPred M).
Proof. Proof.
uPred.unseal; do 2 split; first by destruct 1. uPred.unseal; do 2 split; first by destruct 1.
by destruct x, y; try destruct 1; try constructor. by destruct x, y; try destruct 1; try constructor.
Qed. Qed.
Lemma csum_validI {M} (x : csum A B) : Lemma csum_validI {M} (x : csum A B) :
( x) (match x with x (match x with
| Cinl a => a | Cinl a => a
| Cinr b => b | Cinr b => b
| CsumBot => False | CsumBot => False
end : uPred M). end : uPred M).
Proof. uPred.unseal. by destruct x. Qed. Proof. uPred.unseal. by destruct x. Qed.
(** Updates *) (** Updates *)
......
...@@ -102,11 +102,11 @@ Proof. split. apply _. by intros []. Qed. ...@@ -102,11 +102,11 @@ Proof. split. apply _. by intros []. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma excl_equivI {M} (x y : excl A) : Lemma excl_equivI {M} (x y : excl A) :
(x y) (match x, y with x y (match x, y with
| Excl a, Excl b => a b | Excl a, Excl b => a b
| ExclBot, ExclBot => True | ExclBot, ExclBot => True
| _, _ => False | _, _ => False
end : uPred M). end : uPred M).
Proof. Proof.
uPred.unseal. do 2 split. by destruct 1. by destruct x, y; try constructor. uPred.unseal. do 2 split. by destruct 1. by destruct x, y; try constructor.
Qed. Qed.
......
...@@ -145,7 +145,7 @@ Qed. ...@@ -145,7 +145,7 @@ Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma frac_equivI {M} (x y : frac A) : Lemma frac_equivI {M} (x y : frac A) :
(x y) (frac_perm x = frac_perm y frac_car x frac_car y : uPred M). x y (frac_perm x = frac_perm y frac_car x frac_car y : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
Lemma frac_validI {M} (x : frac A) : Lemma frac_validI {M} (x : frac A) :
x ( (frac_perm x 1)%Qc frac_car x : uPred M). x ( (frac_perm x 1)%Qc frac_car x : uPred M).
......
...@@ -171,9 +171,9 @@ Canonical Structure gmapUR := ...@@ -171,9 +171,9 @@ Canonical Structure gmapUR :=
UCMRAT (gmap K A) gmap_cofe_mixin gmap_cmra_mixin gmap_ucmra_mixin. UCMRAT (gmap K A) gmap_cofe_mixin gmap_cmra_mixin gmap_ucmra_mixin.
(** Internalized properties *) (** Internalized properties *)
Lemma gmap_equivI {M} m1 m2 : (m1 m2) ( i, m1 !! i m2 !! i : uPred M). Lemma gmap_equivI {M} m1 m2 : m1 m2 ( i, m1 !! i m2 !! i : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
Lemma gmap_validI {M} m : ( m) ( i, (m !! i) : uPred M). Lemma gmap_validI {M} m : m ( i, (m !! i) : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
End cmra. End cmra.
......
...@@ -139,9 +139,9 @@ Section iprod_cmra. ...@@ -139,9 +139,9 @@ Section iprod_cmra.
UCMRAT (iprod B) iprod_cofe_mixin iprod_cmra_mixin iprod_ucmra_mixin. UCMRAT (iprod B) iprod_cofe_mixin iprod_cmra_mixin iprod_ucmra_mixin.
(** Internalized properties *) (** Internalized properties *)
Lemma iprod_equivI {M} g1 g2 : (g1 g2) ( i, g1 i g2 i : uPred M). Lemma iprod_equivI {M} g1 g2 : g1 g2 ( i, g1 i g2 i : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
Lemma iprod_validI {M} g : ( g) ( i, g i : uPred M). Lemma iprod_validI {M} g : g ( i, g i : uPred M).
Proof. by uPred.unseal. Qed. Proof. by uPred.unseal. Qed.
(** Properties of iprod_insert. *) (** Properties of iprod_insert. *)
......
...@@ -227,9 +227,9 @@ Section cmra. ...@@ -227,9 +227,9 @@ Section cmra.
Qed. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma list_equivI {M} l1 l2 : (l1 l2) ( i, l1 !! i l2 !! i : uPred M). Lemma list_equivI {M} l1 l2 : l1 l2 ( i, l1 !! i l2 !! i : uPred M).
Proof. uPred.unseal; constructor=> n x ?. apply list_dist_lookup. Qed. Proof. uPred.unseal; constructor=> n x ?. apply list_dist_lookup. Qed.
Lemma list_validI {M} l : ( l) ( i, (l !! i) : uPred M). Lemma list_validI {M} l : l ( i, (l !! i) : uPred M).
Proof. uPred.unseal; constructor=> n x ?. apply list_lookup_validN. Qed. Proof. uPred.unseal; constructor=> n x ?. apply list_lookup_validN. Qed.
End cmra. End cmra.
......
...@@ -196,22 +196,22 @@ Proof. rewrite /Persistent /=. inversion_clear 1; by repeat constructor. Qed. ...@@ -196,22 +196,22 @@ Proof. rewrite /Persistent /=. inversion_clear 1; by repeat constructor. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma one_shot_equivI {M} (x y : one_shot A) : Lemma one_shot_equivI {M} (x y : one_shot A) :
(x y) (match x, y with x y (match x, y with
| OneShotPending, OneShotPending => True | OneShotPending, OneShotPending => True
| Shot a, Shot b => a b | Shot a, Shot b => a b
| OneShotBot, OneShotBot => True | OneShotBot, OneShotBot => True
| _, _ => False | _, _ => False
end : uPred M). end : uPred M).
Proof. Proof.
uPred.unseal; do 2 split; first by destruct 1. uPred.unseal; do 2 split; first by destruct 1.
by destruct x, y; try destruct 1; try constructor. by destruct x, y; try destruct 1; try constructor.
Qed. Qed.
Lemma one_shot_validI {M} (x : one_shot A) : Lemma one_shot_validI {M} (x : one_shot A) :
( x) (match x with x (match x with
| Shot a => a | Shot a => a
| OneShotBot => False | OneShotBot => False
| _ => True | _ => True
end : uPred M). end : uPred M).
Proof. uPred.unseal. by destruct x. Qed. Proof. uPred.unseal. by destruct x. Qed.
(** Updates *) (** Updates *)
......
This diff is collapsed.
...@@ -83,9 +83,9 @@ Proof. ...@@ -83,9 +83,9 @@ Proof.
- etrans; eauto. - etrans; eauto.
Qed. Qed.
Lemma big_and_app Ps Qs : [] (Ps ++ Qs) ([] Ps [] Qs). Lemma big_and_app Ps Qs : [] (Ps ++ Qs) [] Ps [] Qs.
Proof. induction Ps as [|?? IH]; by rewrite /= ?left_id -?assoc ?IH. Qed. Proof. induction Ps as [|?? IH]; by rewrite /= ?left_id -?assoc ?IH. Qed.
Lemma big_sep_app Ps Qs : [] (Ps ++ Qs) ([] Ps [] Qs). Lemma big_sep_app Ps Qs : [] (Ps ++ Qs) [] Ps [] Qs.
Proof. by induction Ps as [|?? IH]; rewrite /= ?left_id -?assoc ?IH. Qed. Proof. by induction Ps as [|?? IH]; rewrite /= ?left_id -?assoc ?IH. Qed.
Lemma big_and_contains Ps Qs : Qs `contains` Ps [] Ps [] Qs. Lemma big_and_contains Ps Qs : Qs `contains` Ps [] Ps [] Qs.
...@@ -113,7 +113,7 @@ Section gmap. ...@@ -113,7 +113,7 @@ Section gmap.
Lemma big_sepM_mono Φ Ψ m1 m2 : Lemma big_sepM_mono Φ Ψ m1 m2 :
m2 m1 ( k x, m2 !! k = Some x Φ k x Ψ k x) m2 m1 ( k x, m2 !! k = Some x Φ k x Ψ k x)
([ map] k x m1, Φ k x) ([ map] k x m2, Ψ k x). ([ map] k x m1, Φ k x) [ map] k x m2, Ψ k x.
Proof. Proof.
intros HX HΦ. trans ([ map] kx m2, Φ k x)%I. intros HX HΦ. trans ([ map] kx m2, Φ k x)%I.
- by apply big_sep_contains, fmap_contains, map_to_list_contains. - by apply big_sep_contains, fmap_contains, map_to_list_contains.
...@@ -152,12 +152,12 @@ Section gmap. ...@@ -152,12 +152,12 @@ Section gmap.
Lemma big_sepM_insert Φ m i x : Lemma big_sepM_insert Φ m i x :
m !! i = None m !! i = None
([ map] ky <[i:=x]> m, Φ k y) (Φ i x [ map] ky m, Φ k y). ([ map] ky <[i:=x]> m, Φ k y) Φ i x [ map] ky m, Φ k y.
Proof. intros ?; by rewrite /uPred_big_sepM map_to_list_insert. Qed. Proof. intros ?; by rewrite /uPred_big_sepM map_to_list_insert. Qed.
Lemma big_sepM_delete Φ m i x : Lemma big_sepM_delete Φ m i x :
m !! i = Some x m !! i = Some x
([ map] ky m, Φ k y) (Φ i x [ map] ky delete i m, Φ k y). ([ map] ky m, Φ k y) Φ i x [ map] ky delete i m, Φ k y.
Proof. Proof.
intros. rewrite -big_sepM_insert ?lookup_delete //. intros. rewrite -big_sepM_insert ?lookup_delete //.
by rewrite insert_delete insert_id. by rewrite insert_delete insert_id.
...@@ -204,7 +204,7 @@ Section gmap. ...@@ -204,7 +204,7 @@ Section gmap.
Lemma big_sepM_sepM Φ Ψ m : Lemma big_sepM_sepM Φ Ψ m :
([ map] kx m, Φ k x Ψ k x) ([ map] kx m, Φ k x Ψ k x)
(([ map] kx m, Φ k x) ([ map] kx m, Ψ k x)). ([ map] kx m, Φ k x) ([ map] kx m, Ψ k x).
Proof. Proof.
rewrite /uPred_big_sepM. rewrite /uPred_big_sepM.
induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?right_id //. induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?right_id //.
...@@ -212,7 +212,7 @@ Section gmap. ...@@ -212,7 +212,7 @@ Section gmap.
Qed. Qed.
Lemma big_sepM_later Φ m : Lemma big_sepM_later Φ m :
( [ map] kx m, Φ k x) ([ map] kx m, Φ k x). ([ map] kx m, Φ k x) ([ map] kx m, Φ k x).
Proof. Proof.
rewrite /uPred_big_sepM. rewrite /uPred_big_sepM.
induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?later_True //. induction (map_to_list m) as [|[i x] l IH]; csimpl; rewrite ?later_True //.
...@@ -228,7 +228,7 @@ Section gmap. ...@@ -228,7 +228,7 @@ Section gmap.
Qed. Qed.
Lemma big_sepM_always_if p Φ m : Lemma big_sepM_always_if p Φ m :
(?p [ map] kx m, Φ k x) ([ map] kx m, ?p Φ k x). ?p ([ map] kx m, Φ k x) ([ map] kx m, ?p Φ k x).
Proof. destruct p; simpl; auto using big_sepM_always. Qed. Proof. destruct p; simpl; auto using big_sepM_always. Qed.
Lemma big_sepM_forall Φ m : Lemma big_sepM_forall Φ m :
...@@ -249,7 +249,7 @@ Section gmap. ...@@ -249,7 +249,7 @@ Section gmap.
Qed. Qed.
Lemma big_sepM_impl Φ Ψ m : Lemma big_sepM_impl Φ Ψ m :
( ( k x, m !! k = Some x Φ k x Ψ k x) [ map] kx m, Φ k x) ( k x, m !! k = Some x Φ k x Ψ k x) ([ map] kx m, Φ k x)
[ map] kx m, Ψ k x. [ map] kx m, Ψ k x.
Proof. Proof.
rewrite always_and_sep_l. do 2 setoid_rewrite always_forall. rewrite always_and_sep_l. do 2 setoid_rewrite always_forall.
...@@ -267,7 +267,7 @@ Section gset. ...@@ -267,7 +267,7 @@ Section gset.
Lemma big_sepS_mono Φ Ψ X Y : Lemma big_sepS_mono Φ Ψ X Y :
Y X ( x, x Y Φ x Ψ x) Y X ( x, x Y Φ x Ψ x)
([ set] x X, Φ x) ([ set] x Y, Ψ x). ([ set] x X, Φ x) [ set] x Y, Ψ x.
Proof. Proof.
intros HX HΦ. trans ([ set] x Y, Φ x)%I. intros HX HΦ. trans ([ set] x Y, Φ x)%I.
- by apply big_sep_contains, fmap_contains, elements_contains. - by apply big_sep_contains, fmap_contains, elements_contains.
...@@ -315,7 +315,7 @@ Section gset. ...@@ -315,7 +315,7 @@ Section gset.
Proof. apply (big_sepS_fn_insert (λ y, id)). Qed. Proof. apply (big_sepS_fn_insert (λ y, id)). Qed.
Lemma big_sepS_delete Φ X x : Lemma big_sepS_delete Φ X x :
x X ([ set] y X, Φ y) (Φ x [ set] y X {[ x ]}, Φ y). x X ([ set] y X, Φ y) Φ x [ set] y X {[ x ]}, Φ y.
Proof. Proof.
intros. rewrite -big_sepS_insert; last set_solver. intros. rewrite -big_sepS_insert; last set_solver.
by rewrite -union_difference_L; last set_solver. by rewrite -union_difference_L; last set_solver.
...@@ -328,21 +328,21 @@ Section gset. ...@@ -328,21 +328,21 @@ Section gset.
Proof. intros. by rewrite /uPred_big_sepS elements_singleton /= right_id. Qed. Proof. intros. by rewrite /uPred_big_sepS elements_singleton /= right_id. Qed.
Lemma big_sepS_sepS Φ Ψ X : Lemma big_sepS_sepS Φ Ψ X :
([ set] y X, Φ y Ψ y) (([ set] y X, Φ y) [ set] y X, Ψ y). ([ set] y X, Φ y Ψ y) ([ set] y X, Φ y) ([ set] y X, Ψ y).
Proof. Proof.
rewrite /uPred_big_sepS. rewrite /uPred_big_sepS.
induction (elements X) as [|x l IH]; csimpl; first by rewrite ?right_id. induction (elements X) as [|x l IH]; csimpl; first by rewrite ?right_id.
by rewrite IH -!assoc (assoc _ (Ψ _)) [(Ψ _ _)%I]comm -!assoc. by rewrite IH -!assoc (assoc _ (Ψ _)) [(Ψ _ _)%I]comm -!assoc.
Qed. Qed.
Lemma big_sepS_later Φ X : ( [ set] y X, Φ y) ([ set] y X, Φ y). Lemma big_sepS_later Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y).
Proof. Proof.
rewrite /uPred_big_sepS. rewrite /uPred_big_sepS.
induction (elements X) as [|x l IH]; csimpl; first by rewrite ?later_True. induction (elements X) as [|x l IH]; csimpl; first by rewrite ?later_True.
by rewrite later_sep IH. by rewrite later_sep IH.
Qed. Qed.
Lemma big_sepS_always Φ X : ( [ set] y X, Φ y) ([ set] y X, Φ y). Lemma big_sepS_always Φ X : ([ set] y X, Φ y) ([ set] y X, Φ y).
Proof. Proof.
rewrite /uPred_big_sepS. rewrite /uPred_big_sepS.
induction (elements X) as [|x l IH]; csimpl; first by rewrite ?always_const. induction (elements X) as [|x l IH]; csimpl; first by rewrite ?always_const.
...@@ -350,7 +350,7 @@ Section gset. ...@@ -350,7 +350,7 @@ Section gset.
Qed. Qed.
Lemma big_sepS_always_if q Φ X : Lemma big_sepS_always_if q Φ X :
(?q [ set] y X, Φ y) ([ set] y X, ?q Φ y). ?q ([ set] y X, Φ y) ([ set] y X, ?q Φ y).
Proof. destruct q; simpl; auto using big_sepS_always. Qed. Proof. destruct q; simpl; auto using big_sepS_always. Qed.
Lemma big_sepS_forall Φ X : Lemma big_sepS_forall Φ X :
...@@ -369,7 +369,7 @@ Section gset. ...@@ -369,7 +369,7 @@ Section gset.
Qed. Qed.
Lemma big_sepS_impl Φ Ψ X : Lemma big_sepS_impl Φ Ψ X :
( ( x, (x X) Φ x Ψ x) [ set] x X, Φ x) [ set] x X, Ψ x. ( x, (x X) Φ x Ψ x) ([ set] x X, Φ x) [ set] x X, Ψ x.
Proof. Proof.
rewrite always_and_sep_l always_forall. rewrite always_and_sep_l always_forall.
setoid_rewrite always_impl; setoid_rewrite always_const. setoid_rewrite always_impl; setoid_rewrite always_const.
......
...@@ -86,7 +86,7 @@ Module uPred_reflection. Section uPred_reflection. ...@@ -86,7 +86,7 @@ Module uPred_reflection. Section uPred_reflection.
Qed. Qed.
Lemma cancel_entails Σ e1 e2 e1' e2' ns : Lemma cancel_entails Σ e1 e2 e1' e2' ns :
cancel ns e1 = Some e1' cancel ns e2 = Some e2' cancel ns e1 = Some e1' cancel ns e2 = Some e2'
eval Σ e1' eval Σ e2' eval Σ e1 eval Σ e2. (eval Σ e1' eval Σ e2') eval Σ e1 eval Σ e2.
Proof. Proof.
intros ??. rewrite !eval_flatten. intros ??. rewrite !eval_flatten.
rewrite (flatten_cancel e1 e1' ns) // (flatten_cancel e2 e2' ns) //; csimpl. rewrite (flatten_cancel e1 e1' ns) // (flatten_cancel e2 e2' ns) //; csimpl.
......
...@@ -77,8 +77,8 @@ Proof. solve_proper. Qed. ...@@ -77,8 +77,8 @@ Proof. solve_proper. Qed.
(** Helper lemmas *) (** Helper lemmas *)
Lemma ress_split i i1 i2 Q R1 R2 P I : Lemma ress_split i i1 i2 Q R1 R2 P I :
i I i1 I i2 I i1 i2 i I i1 I i2 I i1 i2
(saved_prop_own i Q saved_prop_own i1 R1 saved_prop_own i2 R2 saved_prop_own i Q saved_prop_own i1 R1 saved_prop_own i2 R2
(Q - R1 R2) ress P I) (Q - R1 R2) ress P I
ress P ({[i1;i2]} I {[i]}). ress P ({[i1;i2]} I {[i]}).
Proof. Proof.
iIntros {????} "(#HQ&#H1&#H2&HQR&H)"; iDestruct "H" as {Ψ} "[HPΨ HΨ]". iIntros {????} "(#HQ&#H1&#H2&HQR&H)"; iDestruct "H" as {Ψ} "[HPΨ HΨ]".
...@@ -97,7 +97,7 @@ Qed. ...@@ -97,7 +97,7 @@ Qed.
(** Actual proofs *) (** Actual proofs *)
Lemma newbarrier_spec (P : iProp) (Φ : val iProp) : Lemma newbarrier_spec (P : iProp) (Φ : val iProp) :
heapN N heapN N
(heap_ctx heapN l, recv l P send l P - Φ #l) heap_ctx heapN ( l, recv l P send l P - Φ #l)
WP newbarrier #() {{ Φ }}. WP newbarrier #() {{ Φ }}.
Proof. Proof.
iIntros {HN} "[#? HΦ]". iIntros {HN} "[#? HΦ]".
...@@ -124,7 +124,7 @@ Proof. ...@@ -124,7 +124,7 @@ Proof.
Qed. Qed.
Lemma signal_spec l P (Φ : val iProp) : Lemma signal_spec l P (Φ : val iProp) :
(send l P P Φ #()) WP signal #l {{ Φ }}. send l P P Φ #() WP signal #l {{ Φ }}.
Proof. Proof.
rewrite /signal /send /barrier_ctx. rewrite /signal /send /barrier_ctx.
iIntros "(Hs&HP&HΦ)"; iDestruct "Hs" as {γ} "[#(%&Hh&Hsts) Hγ]". wp_let. iIntros "(Hs&HP&HΦ)"; iDestruct "Hs" as {γ} "[#(%&Hh&Hsts) Hγ]". wp_let.
...@@ -139,7 +139,7 @@ Proof. ...@@ -139,7 +139,7 @@ Proof.
Qed. Qed.
Lemma wait_spec l P (Φ : val iProp) : Lemma wait_spec l P (Φ : val iProp) :
(recv l P (P - Φ #())) WP wait #l {{ Φ }}. recv l P (P - Φ #()) WP wait #l {{ Φ }}.
Proof. Proof.
rename P into R; rewrite /recv /barrier_ctx. rename P into R; rewrite /recv /barrier_ctx.
iIntros "[Hr HΦ]"; iDestruct "Hr" as {γ P Q i} "(#(%&Hh&Hsts)&Hγ&#HQ&HQR)". iIntros "[Hr HΦ]"; iDestruct "Hr" as {γ P Q i} "(#(%&Hh&Hsts)&Hγ&#HQ&HQR)".
...@@ -200,7 +200,7 @@ Proof. ...@@ -200,7 +200,7 @@ Proof.
by iIntros "> ?". by iIntros "> ?".
Qed. Qed.
Lemma recv_weaken l P1 P2 : (P1 - P2) (recv l P1 - recv l P2). Lemma recv_weaken l P1 P2 : (P1 - P2) recv l P1 - recv l P2.
Proof. Proof.
rewrite /recv. rewrite /recv.
iIntros "HP HP1"; iDestruct "HP1" as {γ P Q i} "(#Hctx&Hγ&Hi&HP1)". iIntros "HP HP1"; iDestruct "HP1" as {γ P Q i} "(#Hctx&Hγ&Hi&HP1)".
...@@ -208,7 +208,7 @@ Proof. ...@@ -208,7 +208,7 @@ Proof.
iIntros "> HQ". by iApply "HP"; iApply "HP1". iIntros "> HQ". by iApply "HP"; iApply "HP1".
Qed. Qed.
Lemma recv_mono l P1 P2 : P1 P2 recv l P1 recv l P2. Lemma recv_mono l P1 P2 : (P1 P2) recv l P1 recv l P2.
Proof. Proof.
intros HP%entails_wand. apply wand_entails. rewrite HP. apply recv_weaken. intros HP%entails_wand. apply wand_entails. rewrite HP. apply recv_weaken.
Qed. Qed.
......
...@@ -17,7 +17,7 @@ Lemma barrier_spec (heapN N : namespace) : ...@@ -17,7 +17,7 @@ Lemma barrier_spec (heapN N : namespace) :
( l P, {{ send l P P }} signal #l {{ _, True }}) ( l P, {{ send l P P }} signal #l {{ _, True }})
( l P, {{ recv l P }} wait #l {{ _, P }}) ( l P, {{ recv l P }} wait #l {{ _, P }})
( l P Q, recv l (P Q) ={N}=> recv l P recv l Q) ( l P Q, recv l (P Q) ={N}=> recv l P recv l Q)
( l P Q, (P - Q) (recv l P - recv l Q)). ( l P Q, (P - Q) recv l P - recv l Q).
Proof. Proof.
intros HN. intros HN.