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
2136375b
Commit
2136375b
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Some heap stuff.
parent
4fea482a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
heap_lang/heap.v
+12
-13
12 additions, 13 deletions
heap_lang/heap.v
with
12 additions
and
13 deletions
heap_lang/heap.v
+
12
−
13
View file @
2136375b
...
@@ -14,9 +14,6 @@ Proof. split; apply _. Qed.
...
@@ -14,9 +14,6 @@ Proof. split; apply _. Qed.
Definition
to_heap
:
state
→
heapRA
:=
fmap
Excl
.
Definition
to_heap
:
state
→
heapRA
:=
fmap
Excl
.
Definition
from_heap
:
heapRA
→
state
:=
omap
(
maybe
Excl
)
.
Definition
from_heap
:
heapRA
→
state
:=
omap
(
maybe
Excl
)
.
Lemma
from_to_heap
σ
:
from_heap
(
to_heap
σ
)
=
σ
.
Proof
.
apply
map_eq
=>
l
.
rewrite
lookup_omap
lookup_fmap
.
by
case
(
σ
!!
l
)
.
Qed
.
(* TODO: Do we want to expose heap ownership based on the state, or the heapRA?
(* TODO: Do we want to expose heap ownership based on the state, or the heapRA?
The former does not expose the annoying "Excl", so for now I am going for
The former does not expose the annoying "Excl", so for now I am going for
that. We should be able to derive the lemmas we want for this, too. *)
that. We should be able to derive the lemmas we want for this, too. *)
...
@@ -37,16 +34,22 @@ Section heap.
...
@@ -37,16 +34,22 @@ Section heap.
Implicit
Types
h
g
:
heapRA
.
Implicit
Types
h
g
:
heapRA
.
Implicit
Types
γ
:
gname
.
Implicit
Types
γ
:
gname
.
Global
Instance
heap_inv_proper
:
P
ro
per
((
≡
)
==>
(
≡
))
(
heap_inv
HeapI
)
.
Lemma
from_to_heap
σ
:
f
ro
m_heap
(
to_heap
σ
)
=
σ
.
Proof
.
Proof
.
move
=>?
?
EQ
.
rewrite
/
heap_inv
/
from_heap
.
apply
map_eq
=>
l
.
rewrite
lookup_omap
lookup_fmap
.
by
case
(
σ
!!
l
)
.
(* TODO I guess we need some lemma about omap? *)
Qed
.
Admitted
.
(* FIXME... I can't make progress otherwise... *)
Lemma
to_heap_valid
σ
:
✓
to_heap
σ
.
Proof
.
intros
n
l
.
rewrite
lookup_fmap
.
by
case
(
σ
!!
l
)
.
Qed
.
Hint
Resolve
to_heap_valid
.
Global
Instance
heap_inv_proper
:
Proper
((
≡
)
==>
(
≡
))
(
heap_inv
HeapI
)
.
Proof
.
by
intros
h1
h2
;
fold_leibniz
=>
->
.
Qed
.
Lemma
heap_own_op
γ
σ1
σ2
:
Lemma
heap_own_op
γ
σ1
σ2
:
(
heap_own
HeapI
γ
σ1
★
heap_own
HeapI
γ
σ2
)
%
I
(
heap_own
HeapI
γ
σ1
★
heap_own
HeapI
γ
σ2
)
%
I
≡
(
■
(
σ1
⊥
ₘ
σ2
)
∧
heap_own
HeapI
γ
(
σ1
∪
σ2
))
%
I
.
≡
(
■
(
σ1
⊥
ₘ
σ2
)
∧
heap_own
HeapI
γ
(
σ1
∪
σ2
))
%
I
.
Proof
.
(* TODO. *)
Proof
.
(* TODO. *)
Abort
.
Abort
.
Lemma
heap_own_mapsto
γ
σ
l
v
:
Lemma
heap_own_mapsto
γ
σ
l
v
:
...
@@ -60,11 +63,7 @@ Section heap.
...
@@ -60,11 +63,7 @@ Section heap.
Lemma
heap_alloc
N
σ
:
Lemma
heap_alloc
N
σ
:
ownP
σ
⊑
pvs
N
N
(
∃
γ
,
heap_ctx
HeapI
γ
N
∧
heap_own
HeapI
γ
σ
)
.
ownP
σ
⊑
pvs
N
N
(
∃
γ
,
heap_ctx
HeapI
γ
N
∧
heap_own
HeapI
γ
σ
)
.
Proof
.
Proof
.
by
rewrite
-
{
1
}[
σ
]
from_to_heap
-
(
auth_alloc
_
N
)
.
Qed
.
rewrite
-
{
1
}[
σ
]
from_to_heap
.
rewrite
-
(
auth_alloc
_
N
);
first
done
.
move
=>
n
l
.
rewrite
lookup_fmap
.
by
case
_:(
σ
!!
l
)=>[
v
|]
/=.
Qed
.
Lemma
wp_load_heap
N
E
γ
σ
l
v
P
Q
:
Lemma
wp_load_heap
N
E
γ
σ
l
v
P
Q
:
nclose
N
⊆
E
→
nclose
N
⊆
E
→
...
...
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