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
Simcha van Collem
Iris
Commits
324db1dc
Commit
324db1dc
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More properties for the list CMRA.
parent
f72340bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algebra/list.v
+20
-2
20 additions, 2 deletions
algebra/list.v
with
20 additions
and
2 deletions
algebra/list.v
+
20
−
2
View file @
324db1dc
...
@@ -132,6 +132,15 @@ Section cmra.
...
@@ -132,6 +132,15 @@ Section cmra.
Instance
list_valid
:
Valid
(
list
A
)
:=
Forall
(
λ
x
,
✓
x
)
.
Instance
list_valid
:
Valid
(
list
A
)
:=
Forall
(
λ
x
,
✓
x
)
.
Instance
list_validN
:
ValidN
(
list
A
)
:=
λ
n
,
Forall
(
λ
x
,
✓
{
n
}
x
)
.
Instance
list_validN
:
ValidN
(
list
A
)
:=
λ
n
,
Forall
(
λ
x
,
✓
{
n
}
x
)
.
Lemma
cons_valid
l
x
:
✓
(
x
::
l
)
↔
✓
x
∧
✓
l
.
Proof
.
apply
Forall_cons
.
Qed
.
Lemma
cons_validN
n
l
x
:
✓
{
n
}
(
x
::
l
)
↔
✓
{
n
}
x
∧
✓
{
n
}
l
.
Proof
.
apply
Forall_cons
.
Qed
.
Lemma
app_valid
l1
l2
:
✓
(
l1
++
l2
)
↔
✓
l1
∧
✓
l2
.
Proof
.
apply
Forall_app
.
Qed
.
Lemma
app_validN
n
l1
l2
:
✓
{
n
}
(
l1
++
l2
)
↔
✓
{
n
}
l1
∧
✓
{
n
}
l2
.
Proof
.
apply
Forall_app
.
Qed
.
Lemma
list_lookup_valid
l
:
✓
l
↔
∀
i
,
✓
(
l
!!
i
)
.
Lemma
list_lookup_valid
l
:
✓
l
↔
∀
i
,
✓
(
l
!!
i
)
.
Proof
.
Proof
.
rewrite
{
1
}
/
valid
/
list_valid
Forall_lookup
;
split
.
rewrite
{
1
}
/
valid
/
list_valid
Forall_lookup
;
split
.
...
@@ -246,16 +255,25 @@ Section properties.
...
@@ -246,16 +255,25 @@ Section properties.
Implicit
Types
x
y
z
:
A
.
Implicit
Types
x
y
z
:
A
.
Local
Arguments
op
_
_
!
_
!
_
/
:
simpl
nomatch
.
Local
Arguments
op
_
_
!
_
!
_
/
:
simpl
nomatch
.
Local
Arguments
cmra_op
_
!
_
!
_
/
:
simpl
nomatch
.
Local
Arguments
cmra_op
_
!
_
!
_
/
:
simpl
nomatch
.
Local
Arguments
ucmra_op
_
!
_
!
_
/
:
simpl
nomatch
.
Lemma
list_lookup_opM
l
mk
i
:
(
l
⋅
?
mk
)
!!
i
=
l
!!
i
⋅
(
mk
≫=
(
!!
i
))
.
Lemma
list_lookup_opM
l
mk
i
:
(
l
⋅
?
mk
)
!!
i
=
l
!!
i
⋅
(
mk
≫=
(
!!
i
))
.
Proof
.
destruct
mk
;
by
rewrite
/=
?list_lookup_op
?right_id_L
.
Qed
.
Proof
.
destruct
mk
;
by
rewrite
/=
?list_lookup_op
?right_id_L
.
Qed
.
Global
Instance
list_op_nil_l
:
LeftId
(
=
)
(
@
nil
A
)
op
.
Proof
.
done
.
Qed
.
Global
Instance
list_op_nil_r
:
RightId
(
=
)
(
@
nil
A
)
op
.
Proof
.
by
intros
[]
.
Qed
.
Lemma
list_op_app
l1
l2
l3
:
Lemma
list_op_app
l1
l2
l3
:
length
l2
≤
length
l1
→
(
l1
++
l3
)
⋅
l2
=
(
l1
⋅
l2
)
++
l3
.
(
l1
++
l3
)
⋅
l2
=
(
l1
⋅
take
(
length
l1
)
l2
)
++
(
l3
⋅
drop
(
length
l1
)
l2
)
.
Proof
.
Proof
.
revert
l2
l3
.
revert
l2
l3
.
induction
l1
as
[|
x1
l1
]=>
-
[|
x2
l2
]
[|
x3
l3
]
?
;
f_equal
/=
;
auto
with
lia
.
induction
l1
as
[|
x1
l1
]=>
-
[|
x2
l2
]
[|
x3
l3
];
f_equal
/=
;
auto
.
Qed
.
Qed
.
Lemma
list_op_app_le
l1
l2
l3
:
length
l2
≤
length
l1
→
(
l1
++
l3
)
⋅
l2
=
(
l1
⋅
l2
)
++
l3
.
Proof
.
intros
?
.
by
rewrite
list_op_app
take_ge
//
drop_ge
//
right_id_L
.
Qed
.
Lemma
list_lookup_validN_Some
n
l
i
x
:
✓
{
n
}
l
→
l
!!
i
≡
{
n
}
≡
Some
x
→
✓
{
n
}
x
.
Lemma
list_lookup_validN_Some
n
l
i
x
:
✓
{
n
}
l
→
l
!!
i
≡
{
n
}
≡
Some
x
→
✓
{
n
}
x
.
Proof
.
move
=>
/
list_lookup_validN
/
(_
i
)=>
Hl
Hi
;
move
:
Hl
.
by
rewrite
Hi
.
Qed
.
Proof
.
move
=>
/
list_lookup_validN
/
(_
i
)=>
Hl
Hi
;
move
:
Hl
.
by
rewrite
Hi
.
Qed
.
...
...
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