Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ReLoC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Iris
ReLoC
Commits
58b604b9
Commit
58b604b9
authored
5 years ago
by
Dan Frumin
Browse files
Options
Downloads
Patches
Plain Diff
Add `lrel_list_unfold` and simplify some proofs.
parent
584a9145
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/lib/list.v
+31
-11
31 additions, 11 deletions
theories/lib/list.v
with
31 additions
and
11 deletions
theories/lib/list.v
+
31
−
11
View file @
58b604b9
...
@@ -26,14 +26,37 @@ Definition nth : val := rec: "nth" "l" "n" :=
...
@@ -26,14 +26,37 @@ Definition nth : val := rec: "nth" "l" "n" :=
else
"nth"
(
Snd
"xs"
)
(
"n"
-
#
1
)
else
"nth"
(
Snd
"xs"
)
(
"n"
-
#
1
)
end
.
end
.
Lemma
lrel_list_unfold
`{
relocG
Σ
}
A
v1
v2
:
lrel_list
A
v1
v2
≡
(
▷
((
⌜
v1
=
NILV
⌝
∧
⌜
v2
=
NILV
⌝
)
∨
(
∃
w1
w2
t1
t2
,
⌜
v1
=
CONSV
w1
t1
⌝
∧
⌜
v2
=
CONSV
w2
t2
⌝
∗
A
w1
w2
∗
lrel_list
A
t1
t2
)))
%
I
.
Proof
.
rewrite
/
lrel_list
.
rewrite
{
1
}
lrel_rec_unfold
/=.
unfold
lrel_rec1
,
lrel_car
.
(* TODO: so much unfolding *)
simpl
.
iSplit
.
-
iIntros
"H"
.
iNext
.
iDestruct
"H"
as
(
w1
w2
)
"H"
.
iDestruct
"H"
as
"[(->&->&H)|(->&->&H)]"
.
+
iLeft
.
iDestruct
"H"
as
"[-> ->]"
.
done
.
+
iRight
.
iDestruct
"H"
as
(????
->->
)
"[??]"
.
iExists
_,_,_,_
.
repeat
iSplit
;
eauto
.
-
iIntros
"H"
.
iNext
.
iDestruct
"H"
as
"[[-> ->]|H]"
.
+
iExists
#
(),
#
()
.
iLeft
.
eauto
with
iFrame
.
+
iDestruct
"H"
as
(????
->->
)
"[??]"
.
iExists
(_,_)
%
V
,(_,_)
%
V
.
iRight
.
repeat
iSplit
;
eauto
with
iFrame
.
iExists
_,_,_,_
.
repeat
iSplit
;
eauto
with
iFrame
.
Qed
.
Lemma
lrel_list_nil
`{
relocG
Σ
}
A
:
Lemma
lrel_list_nil
`{
relocG
Σ
}
A
:
lrel_list
A
NILV
NILV
.
lrel_list
A
NILV
NILV
.
Proof
.
Proof
.
unfold
lrel_list
.
rewrite
lrel_list_unfold
.
rewrite
lrel_rec_unfold
/=.
iNext
.
by
iLeft
.
unfold
lrel_rec1
,
lrel_car
.
(* TODO so much unfolding *)
simpl
.
iNext
.
iExists
_,_
.
iLeft
.
repeat
iSplit
;
eauto
.
Qed
.
Qed
.
Lemma
lrel_list_cons
`{
relocG
Σ
}
(
A
:
lrel
Σ
)
v1
v2
ls1
ls2
:
Lemma
lrel_list_cons
`{
relocG
Σ
}
(
A
:
lrel
Σ
)
v1
v2
ls1
ls2
:
...
@@ -42,12 +65,8 @@ Lemma lrel_list_cons `{relocG Σ} (A : lrel Σ) v1 v2 ls1 ls2 :
...
@@ -42,12 +65,8 @@ Lemma lrel_list_cons `{relocG Σ} (A : lrel Σ) v1 v2 ls1 ls2 :
lrel_list
A
(
CONSV
v1
ls1
)
(
CONSV
v2
ls2
)
.
lrel_list
A
(
CONSV
v1
ls1
)
(
CONSV
v2
ls2
)
.
Proof
.
Proof
.
iIntros
"#HA #Hls"
.
iIntros
"#HA #Hls"
.
rewrite
{
2
}
/
lrel_list
lrel_rec_unfold
/=.
rewrite
(
lrel_list_unfold
A
(
CONSV
_
_))
.
rewrite
/
lrel_rec1
{
3
}
/
lrel_car
.
iNext
.
iRight
.
iExists
_,_,_,_
.
eauto
with
iFrame
.
iNext
.
simpl
.
iExists
_,
_
.
iRight
.
repeat
iSplit
;
eauto
.
rewrite
{
1
}
/
lrel_prod
/
lrel_car
/=.
iExists
_,_,_,_
.
repeat
iSplit
;
eauto
.
Qed
.
Qed
.
Lemma
refines_nth_l
`{
relocG
Σ
}
(
A
:
lrel
Σ
)
K
v
w
ls
(
n
:
nat
)
t
:
Lemma
refines_nth_l
`{
relocG
Σ
}
(
A
:
lrel
Σ
)
K
v
w
ls
(
n
:
nat
)
t
:
...
@@ -97,3 +116,4 @@ Qed.
...
@@ -97,3 +116,4 @@ Qed.
Lemma
nth_int_typed
`{
relocG
Σ
}
:
Lemma
nth_int_typed
`{
relocG
Σ
}
:
REL
nth
<<
nth
:
lrel_list
lrel_int
→
lrel_int
→
lrel_int
.
REL
nth
<<
nth
:
lrel_list
lrel_int
→
lrel_int
→
lrel_int
.
Proof
.
admit
.
Admitted
.
Proof
.
admit
.
Admitted
.
(* XXX derive this from the fundamental property *)
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