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
Yixuan Chen
Iris
Commits
ea832a21
Commit
ea832a21
authored
4 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
embed gen_heapPreG into gen_heapG
parent
cbb55ae0
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
iris/base_logic/lib/gen_heap.v
+12
-19
12 additions, 19 deletions
iris/base_logic/lib/gen_heap.v
with
12 additions
and
19 deletions
iris/base_logic/lib/gen_heap.v
+
12
−
19
View file @
ea832a21
...
...
@@ -61,19 +61,7 @@ these can be matched up with the invariant namespaces. *)
as a premise).
*)
(** The CMRAs we need, and the global ghost names we are using.
Typically, the adequacy theorem will use [gen_heap_init] to obtain an instance
of this class; everything else should assume it as a premise. *)
Class
gen_heapG
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`{
Countable
L
}
:=
GenHeapG
{
gen_heap_inG
:>
inG
Σ
(
gmap_viewR
L
(
leibnizO
V
));
gen_meta_inG
:>
inG
Σ
(
gmap_viewR
L
gnameO
);
gen_meta_data_inG
:>
inG
Σ
(
namespace_mapR
(
agreeR
positiveO
));
gen_heap_name
:
gname
;
gen_meta_name
:
gname
}
.
Global
Arguments
gen_heap_name
{
L
V
Σ
_
_}
_
:
assert
.
Global
Arguments
gen_meta_name
{
L
V
Σ
_
_}
_
:
assert
.
(** The CMRAs we need, and the global ghost names we are using. *)
Class
gen_heapPreG
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`{
Countable
L
}
:=
{
gen_heap_preG_inG
:>
inG
Σ
(
gmap_viewR
L
(
leibnizO
V
));
...
...
@@ -81,9 +69,14 @@ Class gen_heapPreG (L V : Type) (Σ : gFunctors) `{Countable L} := {
gen_meta_data_preG_inG
:>
inG
Σ
(
namespace_mapR
(
agreeR
positiveO
));
}
.
Definition
gen_heapG_from_preG
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`{
gen_heapPreG
L
V
Σ
}
(
γh
γm
:
gname
)
:
gen_heapG
L
V
Σ
:=
GenHeapG
L
V
Σ
_
_
_
_
_
γh
γm
.
Class
gen_heapG
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`{
Countable
L
}
:=
GenHeapG
{
gen_heap_inG
:>
gen_heapPreG
L
V
Σ
;
gen_heap_name
:
gname
;
gen_meta_name
:
gname
}
.
Global
Arguments
GenHeapG
L
V
Σ
{_
_
_}
_
_
.
Global
Arguments
gen_heap_name
{
L
V
Σ
_
_}
_
:
assert
.
Global
Arguments
gen_meta_name
{
L
V
Σ
_
_}
_
:
assert
.
Definition
gen_heapΣ
(
L
V
:
Type
)
`{
Countable
L
}
:
gFunctors
:=
#
[
GFunctor
(
gmap_viewR
L
(
leibnizO
V
));
...
...
@@ -314,7 +307,7 @@ End gen_heap.
Lemma
gen_heap_init_names
`{
Countable
L
,
!
gen_heapPreG
L
V
Σ
}
σ
:
⊢
|
==>
∃
γh
γm
:
gname
,
let
hG
:=
g
en
_h
eapG
_from_preG
L
V
Σ
γh
γm
in
let
hG
:=
G
en
H
eapG
L
V
Σ
γh
γm
in
gen_heap_interp
σ
∗
([
∗
map
]
l
↦
v
∈
σ
,
l
↦
v
)
∗
([
∗
map
]
l
↦
_
∈
σ
,
meta_token
l
⊤
)
.
Proof
.
iMod
(
own_alloc
(
gmap_view_auth
1
(
∅
:
gmap
L
(
leibnizO
V
))))
as
(
γh
)
"Hh"
.
...
...
@@ -322,7 +315,7 @@ Proof.
iMod
(
own_alloc
(
gmap_view_auth
1
(
∅
:
gmap
L
gnameO
)))
as
(
γm
)
"Hm"
.
{
exact
:
gmap_view_auth_valid
.
}
iExists
γh
,
γm
.
iAssert
(
gen_heap_interp
(
hG
:=
g
en
_h
eapG
_from_preG
_
_
_
γh
γm
)
∅
)
with
"[Hh Hm]"
as
"Hinterp"
.
iAssert
(
gen_heap_interp
(
hG
:=
G
en
H
eapG
_
_
_
γh
γm
)
∅
)
with
"[Hh Hm]"
as
"Hinterp"
.
{
iExists
∅
;
simpl
.
iFrame
"Hh Hm"
.
by
rewrite
dom_empty_L
.
}
iMod
(
gen_heap_alloc_big
with
"Hinterp"
)
as
"(Hinterp & $ & $)"
.
{
apply
map_disjoint_empty_r
.
}
...
...
@@ -334,6 +327,6 @@ Lemma gen_heap_init `{Countable L, !gen_heapPreG L V Σ} σ :
gen_heap_interp
σ
∗
([
∗
map
]
l
↦
v
∈
σ
,
l
↦
v
)
∗
([
∗
map
]
l
↦
_
∈
σ
,
meta_token
l
⊤
)
.
Proof
.
iMod
(
gen_heap_init_names
σ
)
as
(
γh
γm
)
"Hinit"
.
iExists
(
g
en
_h
eapG
_from_preG
_
_
_
γh
γm
)
.
iExists
(
G
en
H
eapG
_
_
_
γh
γm
)
.
done
.
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