Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rice Wine
Iris
Commits
631c8260
Commit
631c8260
authored
Apr 11, 2016
by
Robbert Krebbers
Browse files
Some properties about bigops on upred.
parent
6092efe9
Changes
1
Hide whitespace changes
Inline
Side-by-side
algebra/upred_big_op.v
View file @
631c8260
From
iris
.
algebra
Require
Export
upred
list
.
From
iris
.
prelude
Require
Import
gmap
fin_collections
.
From
iris
.
prelude
Require
Import
gmap
fin_collections
functions
.
Import
uPred
.
(** * Big ops over lists *)
...
...
@@ -107,6 +107,13 @@ Section gmap.
-
apply
big_sep_mono'
,
Forall2_fmap
,
Forall_Forall2
.
apply
Forall_forall
=>
-[
i
x
]
?
/=.
by
apply
H
Φ
,
elem_of_map_to_list
.
Qed
.
Lemma
big_sepM_proper
Φ
Ψ
m1
m2
:
m1
≡
m2
→
(
∀
x
k
,
m1
!!
k
=
Some
x
→
m2
!!
k
=
Some
x
→
Φ
k
x
⊣
⊢
Ψ
k
x
)
→
Π★
{
map
m1
}
Φ
⊣
⊢
Π★
{
map
m2
}
Ψ
.
Proof
.
intros
[??]
?
;
apply
(
anti_symm
(
⊢
))
;
apply
big_sepM_mono
;
eauto
using
equiv_entails
,
equiv_entails_sym
,
lookup_weaken
.
Qed
.
Global
Instance
big_sepM_ne
m
n
:
Proper
(
pointwise_relation
_
(
pointwise_relation
_
(
dist
n
))
==>
(
dist
n
))
...
...
@@ -115,17 +122,14 @@ Section gmap.
intros
Φ
1
Φ
2
H
Φ
.
apply
big_sep_ne
,
Forall2_fmap
.
apply
Forall_Forall2
,
Forall_true
=>
-[
i
x
]
;
apply
H
Φ
.
Qed
.
Global
Instance
big_sepM_proper
m
:
Global
Instance
big_sepM_proper
'
m
:
Proper
(
pointwise_relation
_
(
pointwise_relation
_
(
⊣
⊢
))
==>
(
⊣
⊢
))
(
uPred_big_sepM
(
M
:
=
M
)
m
).
Proof
.
intros
Φ
1
Φ
2
H
Φ
;
apply
equiv_dist
=>
n
.
apply
big_sepM_ne
=>
k
x
;
apply
equiv_dist
,
H
Φ
.
Qed
.
Proof
.
intros
Φ
1
Φ
2
H
Φ
.
by
apply
big_sepM_proper
;
intros
;
last
apply
H
Φ
.
Qed
.
Global
Instance
big_sepM_mono'
m
:
Proper
(
pointwise_relation
_
(
pointwise_relation
_
(
⊢
))
==>
(
⊢
))
(
uPred_big_sepM
(
M
:
=
M
)
m
).
Proof
.
intros
Φ
1
Φ
2
H
Φ
.
apply
big_sepM_mono
;
intros
;
[
done
|
apply
H
Φ
]
.
Qed
.
Proof
.
intros
Φ
1
Φ
2
H
Φ
.
by
apply
big_sepM_mono
;
intros
;
last
apply
H
Φ
.
Qed
.
Lemma
big_sepM_empty
Φ
:
Π★
{
map
∅
}
Φ
⊣
⊢
True
.
Proof
.
by
rewrite
/
uPred_big_sepM
map_to_list_empty
.
Qed
.
...
...
@@ -167,6 +171,12 @@ Section gset.
-
apply
big_sep_mono'
,
Forall2_fmap
,
Forall_Forall2
.
apply
Forall_forall
=>
x
?
/=.
by
apply
H
Φ
,
elem_of_elements
.
Qed
.
Lemma
big_sepS_proper
Φ
Ψ
X
Y
:
X
≡
Y
→
(
∀
x
,
x
∈
X
→
x
∈
Y
→
Φ
x
⊣
⊢
Ψ
x
)
→
Π★
{
set
X
}
Φ
⊣
⊢
Π★
{
set
Y
}
Ψ
.
Proof
.
intros
[??]
?
;
apply
(
anti_symm
(
⊢
))
;
apply
big_sepS_mono
;
eauto
using
equiv_entails
,
equiv_entails_sym
.
Qed
.
Lemma
big_sepS_ne
X
n
:
Proper
(
pointwise_relation
_
(
dist
n
)
==>
dist
n
)
(
uPred_big_sepS
(
M
:
=
M
)
X
).
...
...
@@ -174,27 +184,39 @@ Section gset.
intros
Φ
1
Φ
2
H
Φ
.
apply
big_sep_ne
,
Forall2_fmap
.
apply
Forall_Forall2
,
Forall_true
=>
x
;
apply
H
Φ
.
Qed
.
Lemma
big_sepS_proper
X
:
Lemma
big_sepS_proper
'
X
:
Proper
(
pointwise_relation
_
(
⊣
⊢
)
==>
(
⊣
⊢
))
(
uPred_big_sepS
(
M
:
=
M
)
X
).
Proof
.
intros
Φ
1
Φ
2
H
Φ
;
apply
equiv_dist
=>
n
.
apply
big_sepS_ne
=>
x
;
apply
equiv_dist
,
H
Φ
.
Qed
.
Proof
.
intros
Φ
1
Φ
2
H
Φ
.
apply
big_sepS_proper
;
naive_solver
.
Qed
.
Lemma
big_sepS_mono'
X
:
Proper
(
pointwise_relation
_
(
⊢
)
==>
(
⊢
))
(
uPred_big_sepS
(
M
:
=
M
)
X
).
Proof
.
intros
Φ
1
Φ
2
H
Φ
.
apply
big_sepS_mono
;
naive_solver
.
Qed
.
Lemma
big_sepS_empty
Φ
:
Π★
{
set
∅
}
Φ
⊣
⊢
True
.
Proof
.
by
rewrite
/
uPred_big_sepS
elements_empty
.
Qed
.
Lemma
big_sepS_insert
Φ
X
x
:
x
∉
X
→
Π★
{
set
{[
x
]}
∪
X
}
Φ
⊣
⊢
(
Φ
x
★
Π★
{
set
X
}
Φ
).
Proof
.
intros
.
by
rewrite
/
uPred_big_sepS
elements_union_singleton
.
Qed
.
Lemma
big_sepS_insert'
(
Ψ
:
A
→
uPred
M
→
uPred
M
)
Φ
X
x
P
:
x
∉
X
→
Π★
{
set
{[
x
]}
∪
X
}
(
λ
y
,
Ψ
y
(<[
x
:
=
P
]>
Φ
y
))
⊣
⊢
(
Ψ
x
P
★
Π★
{
set
X
}
(
λ
y
,
Ψ
y
(
Φ
y
))).
Proof
.
intros
.
rewrite
big_sepS_insert
//
fn_lookup_insert
.
apply
sep_proper
,
big_sepS_proper
;
auto
=>
y
??.
by
rewrite
fn_lookup_insert_ne
;
last
set_solver
.
Qed
.
Lemma
big_sepS_insert''
Φ
X
x
P
:
x
∉
X
→
Π★
{
set
{[
x
]}
∪
X
}
(<[
x
:
=
P
]>
Φ
)
⊣
⊢
(
P
★
Π★
{
set
X
}
Φ
).
Proof
.
apply
(
big_sepS_insert'
(
λ
y
,
id
)).
Qed
.
Lemma
big_sepS_delete
Φ
X
x
:
x
∈
X
→
Π★
{
set
X
}
Φ
⊣
⊢
(
Φ
x
★
Π★
{
set
X
∖
{[
x
]}}
Φ
).
Proof
.
intros
.
rewrite
-
big_sepS_insert
;
last
set_solver
.
by
rewrite
-
union_difference_L
;
last
set_solver
.
Qed
.
Lemma
big_sepS_singleton
Φ
x
:
Π★
{
set
{[
x
]}}
Φ
⊣
⊢
(
Φ
x
).
Proof
.
intros
.
by
rewrite
/
uPred_big_sepS
elements_singleton
/=
right_id
.
Qed
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment