Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaëtan Gilbert
Iris
Commits
23e7d3ce
Commit
23e7d3ce
authored
5 years ago
by
Michael Sammler
Browse files
Options
Downloads
Patches
Plain Diff
Added variant of big_sepL_lookup_acc which allows updating the value
parent
e2f65bbd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/bi/big_op.v
+29
-8
29 additions, 8 deletions
theories/bi/big_op.v
with
29 additions
and
8 deletions
theories/bi/big_op.v
+
29
−
8
View file @
23e7d3ce
...
@@ -125,15 +125,25 @@ Section sep_list.
...
@@ -125,15 +125,25 @@ Section sep_list.
Lemma
big_sepL_emp
l
:
([
∗
list
]
k
↦
y
∈
l
,
emp
)
⊣⊢@
{
PROP
}
emp
.
Lemma
big_sepL_emp
l
:
([
∗
list
]
k
↦
y
∈
l
,
emp
)
⊣⊢@
{
PROP
}
emp
.
Proof
.
by
rewrite
big_opL_unit
.
Qed
.
Proof
.
by
rewrite
big_opL_unit
.
Qed
.
Lemma
big_sepL_
lookup
_acc
Φ
l
i
x
:
Lemma
big_sepL_
insert
_acc
Φ
l
i
x
:
l
!!
i
=
Some
x
→
l
!!
i
=
Some
x
→
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊢
Φ
i
x
∗
(
Φ
i
x
-∗
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
))
.
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊢
Φ
i
x
∗
(
∀
y
,
Φ
i
y
-∗
([
∗
list
]
k
↦
y
∈
<
[
i
:=
y
]
>
l
,
Φ
k
y
))
.
Proof
.
Proof
.
intros
Hli
.
rewrite
-
(
take_drop_middle
l
i
x
)
//
big_sepL_app
/=.
intros
Hli
.
assert
(
i
≤
length
l
)
by
eauto
using
lookup_lt_Some
,
Nat
.
lt_le_incl
.
rewrite
Nat
.
add_0_r
take_length_le
;
eauto
using
lookup_lt_Some
,
Nat
.
lt_le_incl
.
rewrite
-
(
take_drop_middle
l
i
x
)
//
big_sepL_app
/=.
rewrite
assoc
-!
(
comm
_
(
Φ
_
_))
-
assoc
.
by
apply
sep_mono_r
,
wand_intro_l
.
rewrite
Nat
.
add_0_r
take_length_le
//.
rewrite
assoc
-!
(
comm
_
(
Φ
_
_))
-
assoc
.
apply
sep_mono_r
,
forall_intro
=>
y
.
rewrite
insert_app_r_alt
?take_length_le
//.
rewrite
Nat
.
sub_diag
/=.
apply
wand_intro_l
.
rewrite
assoc
!
(
comm
_
(
Φ
_
_))
-
assoc
big_sepL_app
/=.
by
rewrite
Nat
.
add_0_r
take_length_le
.
Qed
.
Qed
.
Lemma
big_sepL_lookup_acc
Φ
l
i
x
:
l
!!
i
=
Some
x
→
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊢
Φ
i
x
∗
(
Φ
i
x
-∗
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
))
.
Proof
.
intros
.
by
rewrite
{
1
}
big_sepL_insert_acc
//
(
forall_elim
x
)
list_insert_id
.
Qed
.
Lemma
big_sepL_lookup
Φ
l
i
x
`{
!
Absorbing
(
Φ
i
x
)}
:
Lemma
big_sepL_lookup
Φ
l
i
x
`{
!
Absorbing
(
Φ
i
x
)}
:
l
!!
i
=
Some
x
→
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊢
Φ
i
x
.
l
!!
i
=
Some
x
→
([
∗
list
]
k
↦
y
∈
l
,
Φ
k
y
)
⊢
Φ
i
x
.
Proof
.
intros
.
rewrite
big_sepL_lookup_acc
//.
by
rewrite
sep_elim_l
.
Qed
.
Proof
.
intros
.
rewrite
big_sepL_lookup_acc
//.
by
rewrite
sep_elim_l
.
Qed
.
...
@@ -412,14 +422,25 @@ Section sep_list2.
...
@@ -412,14 +422,25 @@ Section sep_list2.
(
big_sepL2
(
PROP
:=
PROP
)
(
A
:=
A
)
(
B
:=
B
))
.
(
big_sepL2
(
PROP
:=
PROP
)
(
A
:=
A
)
(
B
:=
B
))
.
Proof
.
intros
f
g
Hf
l1
?
<-
l2
?
<-.
apply
big_sepL2_proper
;
intros
;
apply
Hf
.
Qed
.
Proof
.
intros
f
g
Hf
l1
?
<-
l2
?
<-.
apply
big_sepL2_proper
;
intros
;
apply
Hf
.
Qed
.
Lemma
big_sepL2_insert_acc
Φ
l1
l2
i
x1
x2
:
l1
!!
i
=
Some
x1
→
l2
!!
i
=
Some
x2
→
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
)
⊢
Φ
i
x1
x2
∗
(
∀
y1
y2
,
Φ
i
y1
y2
-∗
([
∗
list
]
k
↦
y1
;
y2
∈
<
[
i
:=
y1
]
>
l1
;
<
[
i
:=
y2
]
>
l2
,
Φ
k
y1
y2
))
.
Proof
.
intros
Hl1
Hl2
.
rewrite
big_sepL2_alt
.
apply
pure_elim_l
=>
Hl
.
rewrite
{
1
}
big_sepL_insert_acc
;
last
by
rewrite
lookup_zip_with
;
simplify_option_eq
.
apply
sep_mono_r
.
apply
forall_intro
=>
y1
.
apply
forall_intro
=>
y2
.
rewrite
big_sepL2_alt
!
insert_length
pure_True
//
left_id
-
insert_zip_with
.
by
rewrite
(
forall_elim
(
y1
,
y2
))
.
Qed
.
Lemma
big_sepL2_lookup_acc
Φ
l1
l2
i
x1
x2
:
Lemma
big_sepL2_lookup_acc
Φ
l1
l2
i
x1
x2
:
l1
!!
i
=
Some
x1
→
l2
!!
i
=
Some
x2
→
l1
!!
i
=
Some
x1
→
l2
!!
i
=
Some
x2
→
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
)
⊢
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
)
⊢
Φ
i
x1
x2
∗
(
Φ
i
x1
x2
-∗
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
))
.
Φ
i
x1
x2
∗
(
Φ
i
x1
x2
-∗
([
∗
list
]
k
↦
y1
;
y2
∈
l1
;
l2
,
Φ
k
y1
y2
))
.
Proof
.
Proof
.
intros
Hl1
Hl2
.
rewrite
big_sepL2_alt
.
apply
pure_elim_l
=>
Hl
.
intros
.
rewrite
{
1
}
big_sepL2_insert_acc
//
(
forall_elim
x1
)
(
forall_elim
x2
)
.
rewrite
{
1
}
big_sepL_lookup_acc
;
last
by
rewrite
lookup_zip_with
;
simplify_option_eq
.
by
rewrite
!
list_insert_id
.
by
rewrite
pure_True
//
left_id
.
Qed
.
Qed
.
Lemma
big_sepL2_lookup
Φ
l1
l2
i
x1
x2
`{
!
Absorbing
(
Φ
i
x1
x2
)}
:
Lemma
big_sepL2_lookup
Φ
l1
l2
i
x1
x2
`{
!
Absorbing
(
Φ
i
x1
x2
)}
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment