Skip to content
Snippets Groups Projects
Commit 40b233f2 authored by Aleš Bizjak's avatar Aleš Bizjak Committed by Jacques-Henri Jourdan
Browse files

Added Affine instances for big ops.

parent 0ea64978
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,10 @@ Section sep_list. ...@@ -167,6 +167,10 @@ Section sep_list.
Global Instance big_sepL_persistent_id Ps : Global Instance big_sepL_persistent_id Ps :
TCForall Persistent Ps Persistent ([] Ps). TCForall Persistent Ps Persistent ([] Ps).
Proof. induction 1; simpl; apply _. Qed. Proof. induction 1; simpl; apply _. Qed.
Global Instance big_sepL_affine Φ l :
( k x, Affine (Φ k x)) Affine ([ list] kx l, Φ k x).
Proof. revert Φ. induction l as [|x l IH]=> Φ ? /=; apply _. Qed.
End sep_list. End sep_list.
Section sep_list2. Section sep_list2.
...@@ -429,6 +433,12 @@ Section gmap. ...@@ -429,6 +433,12 @@ Section gmap.
Global Instance big_sepM_persistent Φ m : Global Instance big_sepM_persistent Φ m :
( k x, Persistent (Φ k x)) Persistent ([ map] kx m, Φ k x). ( k x, Persistent (Φ k x)) Persistent ([ map] kx m, Φ k x).
Proof. intros. apply big_sepL_persistent=> _ [??]; apply _. Qed. Proof. intros. apply big_sepL_persistent=> _ [??]; apply _. Qed.
Global Instance big_sepM_affine Φ m :
( k x, Affine (Φ k x)) Affine ([ map] kx m, Φ k x).
Proof.
intros. apply big_sepL_affine=> _ [??]; apply _.
Qed.
End gmap. End gmap.
(** ** Big ops over finite sets *) (** ** Big ops over finite sets *)
...@@ -580,6 +590,10 @@ Section gset. ...@@ -580,6 +590,10 @@ Section gset.
Global Instance big_sepS_persistent Φ X : Global Instance big_sepS_persistent Φ X :
( x, Persistent (Φ x)) Persistent ([ set] x X, Φ x). ( x, Persistent (Φ x)) Persistent ([ set] x X, Φ x).
Proof. rewrite /big_opS. apply _. Qed. Proof. rewrite /big_opS. apply _. Qed.
Global Instance big_sepS_affine Φ X :
( x, Affine (Φ x)) Affine ([ set] x X, Φ x).
Proof. rewrite /big_opS. apply _. Qed.
End gset. End gset.
Lemma big_sepM_dom `{Countable K} {A} (Φ : K PROP) (m : gmap K A) : Lemma big_sepM_dom `{Countable K} {A} (Φ : K PROP) (m : gmap K A) :
...@@ -654,6 +668,10 @@ Section gmultiset. ...@@ -654,6 +668,10 @@ Section gmultiset.
Global Instance big_sepMS_persistent Φ X : Global Instance big_sepMS_persistent Φ X :
( x, Persistent (Φ x)) Persistent ([ mset] x X, Φ x). ( x, Persistent (Φ x)) Persistent ([ mset] x X, Φ x).
Proof. rewrite /big_opMS. apply _. Qed. Proof. rewrite /big_opMS. apply _. Qed.
Global Instance big_sepMS_affine Φ X :
( x, Affine (Φ x)) Affine ([ mset] x X, Φ x).
Proof. rewrite /big_opMS. apply _. Qed.
End gmultiset. End gmultiset.
End bi_big_op. End bi_big_op.
......
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