Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rice Wine
Iris
Commits
cc712c90
Commit
cc712c90
authored
Oct 18, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more nits
parent
25ed5c9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
theories/heap_lang/lib/coin_flip.v
theories/heap_lang/lib/coin_flip.v
+2
-2
theories/heap_lang/lifting.v
theories/heap_lang/lifting.v
+1
-1
theories/heap_lang/proph_map.v
theories/heap_lang/proph_map.v
+10
-9
No files found.
theories/heap_lang/lib/coin_flip.v
View file @
cc712c90
...
...
@@ -52,8 +52,8 @@ Section coinflip.
<<<
∃
(
b
:
bool
),
x
↦
#
0
,
RET
#
b
>>>.
Proof
.
iApply
wp_atomic_intro
.
iIntros
(
Φ
)
"AU"
.
wp_lam
.
wp_
bind
(
rand
_
)%
E
.
iA
pply
rand_spec
;
first
done
.
iIntros
(
b
)
"
!>
_"
.
wp_let
.
wp_
a
pply
rand_spec
;
first
done
.
iIntros
(
b
)
"_"
.
wp_let
.
wp_bind
(
_
<-
_
)%
E
.
iMod
"AU"
as
"[Hl [_ Hclose]]"
.
iDestruct
"Hl"
as
(
v
)
"Hl"
.
...
...
theories/heap_lang/lifting.v
View file @
cc712c90
...
...
@@ -29,7 +29,7 @@ Notation "l ↦{ q } -" := (∃ v, l ↦{q} v)%I
(
at
level
20
,
q
at
level
50
,
format
"l ↦{ q } -"
)
:
bi_scope
.
Notation
"l ↦ -"
:
=
(
l
↦
{
1
}
-)%
I
(
at
level
20
)
:
bi_scope
.
Notation
"p ⥱ v"
:
=
(
p_mapsto
p
v
)
(
at
level
20
,
format
"p ⥱ v"
)
:
bi_scope
.
Notation
"p ⥱ v"
:
=
(
p
roph
_mapsto
p
v
)
(
at
level
20
,
format
"p ⥱ v"
)
:
bi_scope
.
Notation
"p ⥱ -"
:
=
(
∃
v
,
p
⥱
v
)%
I
(
at
level
20
)
:
bi_scope
.
(** The tactic [inv_head_step] performs inversion on hypotheses of the shape
...
...
theories/heap_lang/proph_map.v
View file @
cc712c90
...
...
@@ -89,15 +89,16 @@ Section definitions.
dom
(
gset
_
)
R
⊆
ps
⌝
∗
proph_map_auth
R
)%
I
.
Definition
p_mapsto_def
(
p
:
P
)
(
v
:
option
V
)
:
iProp
Σ
:
=
Definition
p
roph
_mapsto_def
(
p
:
P
)
(
v
:
option
V
)
:
iProp
Σ
:
=
own
(
proph_map_name
pG
)
(
◯
{[
p
:
=
Excl
(
v
:
option
$
leibnizC
V
)
]}).
Definition
p_mapsto_aux
:
seal
(@
p_mapsto_def
).
by
eexists
.
Qed
.
Definition
p_mapsto
:
=
p_mapsto_aux
.(
unseal
).
Definition
p_mapsto_eq
:
@
p_mapsto
=
@
p_mapsto_def
:
=
p_mapsto_aux
.(
seal_eq
).
Definition
proph_mapsto_aux
:
seal
(@
proph_mapsto_def
).
by
eexists
.
Qed
.
Definition
proph_mapsto
:
=
proph_mapsto_aux
.(
unseal
).
Definition
proph_mapsto_eq
:
@
proph_mapsto
=
@
proph_mapsto_def
:
=
proph_mapsto_aux
.(
seal_eq
).
End
definitions
.
Local
Notation
"p ⥱ v"
:
=
(
p_mapsto
p
v
)
(
at
level
20
,
format
"p ⥱ v"
)
:
bi_scope
.
Local
Notation
"p ⥱ v"
:
=
(
p
roph
_mapsto
p
v
)
(
at
level
20
,
format
"p ⥱ v"
)
:
bi_scope
.
Local
Notation
"p ⥱ -"
:
=
(
∃
v
,
p
⥱
v
)%
I
(
at
level
20
)
:
bi_scope
.
Section
to_proph_map
.
...
...
@@ -148,13 +149,13 @@ Section proph_map.
(** General properties of mapsto *)
Global
Instance
p_mapsto_timeless
p
v
:
Timeless
(
p
⥱
v
).
Proof
.
rewrite
p
_mapsto_eq
/
p
_mapsto_def
.
apply
_
.
Qed
.
Proof
.
rewrite
p
roph_mapsto_eq
/
proph
_mapsto_def
.
apply
_
.
Qed
.
Lemma
proph_map_alloc
R
p
v
:
p
∉
dom
(
gset
_
)
R
→
proph_map_auth
R
==
∗
proph_map_auth
(<[
p
:
=
v
]>
R
)
∗
p
⥱
v
.
Proof
.
iIntros
(
Hp
)
"HR"
.
rewrite
/
proph_map_ctx
p
_mapsto_eq
/
p
_mapsto_def
.
iIntros
(
Hp
)
"HR"
.
rewrite
/
proph_map_ctx
p
roph_mapsto_eq
/
proph
_mapsto_def
.
iMod
(
own_update
with
"HR"
)
as
"[HR Hl]"
.
{
eapply
auth_update_alloc
,
(
alloc_singleton_local_update
_
_
(
Excl
$
(
v
:
option
(
leibnizC
_
))))=>
//.
...
...
@@ -165,14 +166,14 @@ Section proph_map.
Lemma
proph_map_remove
R
p
v
:
proph_map_auth
R
-
∗
p
⥱
v
==
∗
proph_map_auth
(
delete
p
R
).
Proof
.
iIntros
"HR Hp"
.
rewrite
/
proph_map_ctx
p
_mapsto_eq
/
p
_mapsto_def
.
iIntros
"HR Hp"
.
rewrite
/
proph_map_ctx
p
roph_mapsto_eq
/
proph
_mapsto_def
.
rewrite
/
proph_map_auth
to_proph_map_delete
.
iApply
(
own_update_2
with
"HR Hp"
).
apply
auth_update_dealloc
,
(
delete_singleton_local_update
_
_
_
).
Qed
.
Lemma
proph_map_valid
R
p
v
:
proph_map_auth
R
-
∗
p
⥱
v
-
∗
⌜
R
!!
p
=
Some
v
⌝
.
Proof
.
iIntros
"HR Hp"
.
rewrite
/
proph_map_ctx
p
_mapsto_eq
/
p
_mapsto_def
.
iIntros
"HR Hp"
.
rewrite
/
proph_map_ctx
p
roph_mapsto_eq
/
proph
_mapsto_def
.
iDestruct
(
own_valid_2
with
"HR Hp"
)
as
%[
HH
%
proph_map_singleton_included
_
]%
auth_valid_discrete_2
;
auto
.
Qed
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment