Skip to content
Snippets Groups Projects
Commit 42b08240 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

More big op properties.

parent b92e8df1
No related branches found
No related tags found
No related merge requests found
...@@ -244,6 +244,12 @@ Section list. ...@@ -244,6 +244,12 @@ Section list.
by rewrite sep_elim_r sep_elim_l. by rewrite sep_elim_r sep_elim_l.
Qed. Qed.
Lemma big_sepL_elem_of (Φ : A uPred M) l x :
x l ([ list] y l, Φ y) Φ x.
Proof.
intros [i ?]%elem_of_list_lookup; eauto using (big_sepL_lookup (λ _, Φ)).
Qed.
Lemma big_sepL_fmap {B} (f : A B) (Φ : nat B uPred M) l : Lemma big_sepL_fmap {B} (f : A B) (Φ : nat B uPred M) l :
([ list] ky f <$> l, Φ k y) ⊣⊢ ([ list] ky l, Φ k (f y)). ([ list] ky f <$> l, Φ k y) ⊣⊢ ([ list] ky l, Φ k (f y)).
Proof. by rewrite /uPred_big_sepL imap_fmap. Qed. Proof. by rewrite /uPred_big_sepL imap_fmap. Qed.
...@@ -302,12 +308,18 @@ Section list. ...@@ -302,12 +308,18 @@ Section list.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -always_wand_impl always_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepL_persistent Φ m : Global Instance big_sepL_nil_persistent Φ :
( k x, PersistentP (Φ k x)) PersistentP ([ list] kx m, Φ k x). PersistentP ([ list] kx [], Φ k x).
Proof. rewrite /uPred_big_sepL. apply _. Qed.
Global Instance big_sepL_persistent Φ l :
( k x, PersistentP (Φ k x)) PersistentP ([ list] kx l, Φ k x).
Proof. rewrite /uPred_big_sepL. apply _. Qed. Proof. rewrite /uPred_big_sepL. apply _. Qed.
Global Instance big_sepL_timeless Φ m : Global Instance big_sepL_nil_timeless Φ :
( k x, TimelessP (Φ k x)) TimelessP ([ list] kx m, Φ k x). TimelessP ([ list] kx [], Φ k x).
Proof. rewrite /uPred_big_sepL. apply _. Qed.
Global Instance big_sepL_timeless Φ l :
( k x, TimelessP (Φ k x)) TimelessP ([ list] kx l, Φ k x).
Proof. rewrite /uPred_big_sepL. apply _. Qed. Proof. rewrite /uPred_big_sepL. apply _. Qed.
End list. End list.
...@@ -462,10 +474,16 @@ Section gmap. ...@@ -462,10 +474,16 @@ Section gmap.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -always_wand_impl always_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepM_empty_persistent Φ :
PersistentP ([ map] kx , Φ k x).
Proof. rewrite /uPred_big_sepM map_to_list_empty. apply _. Qed.
Global Instance big_sepM_persistent Φ m : Global Instance big_sepM_persistent Φ m :
( k x, PersistentP (Φ k x)) PersistentP ([ map] kx m, Φ k x). ( k x, PersistentP (Φ k x)) PersistentP ([ map] kx m, Φ k x).
Proof. intros. apply big_sep_persistent, fmap_persistent=>-[??] /=; auto. Qed. Proof. intros. apply big_sep_persistent, fmap_persistent=>-[??] /=; auto. Qed.
Global Instance big_sepM_nil_timeless Φ :
TimelessP ([ map] kx , Φ k x).
Proof. rewrite /uPred_big_sepM map_to_list_empty. apply _. Qed.
Global Instance big_sepM_timeless Φ m : Global Instance big_sepM_timeless Φ m :
( k x, TimelessP (Φ k x)) TimelessP ([ map] kx m, Φ k x). ( k x, TimelessP (Φ k x)) TimelessP ([ map] kx m, Φ k x).
Proof. intro. apply big_sep_timeless, fmap_timeless=> -[??] /=; auto. Qed. Proof. intro. apply big_sep_timeless, fmap_timeless=> -[??] /=; auto. Qed.
...@@ -590,10 +608,14 @@ Section gset. ...@@ -590,10 +608,14 @@ Section gset.
by rewrite -always_wand_impl always_elim wand_elim_l. by rewrite -always_wand_impl always_elim wand_elim_l.
Qed. Qed.
Global Instance big_sepS_empty_persistent Φ : PersistentP ([ set] x , Φ x).
Proof. rewrite /uPred_big_sepS elements_empty. apply _. Qed.
Global Instance big_sepS_persistent Φ X : Global Instance big_sepS_persistent Φ X :
( x, PersistentP (Φ x)) PersistentP ([ set] x X, Φ x). ( x, PersistentP (Φ x)) PersistentP ([ set] x X, Φ x).
Proof. rewrite /uPred_big_sepS. apply _. Qed. Proof. rewrite /uPred_big_sepS. apply _. Qed.
Global Instance big_sepS_nil_timeless Φ : TimelessP ([ set] x , Φ x).
Proof. rewrite /uPred_big_sepS elements_empty. apply _. Qed.
Global Instance big_sepS_timeless Φ X : Global Instance big_sepS_timeless Φ X :
( x, TimelessP (Φ x)) TimelessP ([ set] x X, Φ x). ( x, TimelessP (Φ x)) TimelessP ([ set] x X, Φ x).
Proof. rewrite /uPred_big_sepS. apply _. Qed. Proof. rewrite /uPred_big_sepS. apply _. Qed.
......
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