Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
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
Dan Frumin
iris-coq
Commits
a1e93de9
Commit
a1e93de9
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Use option in spawn.
parent
98d7ce9b
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/lib/spawn.v
+8
-8
8 additions, 8 deletions
heap_lang/lib/spawn.v
with
8 additions
and
8 deletions
heap_lang/lib/spawn.v
+
8
−
8
View file @
a1e93de9
...
@@ -5,13 +5,13 @@ Import uPred.
...
@@ -5,13 +5,13 @@ Import uPred.
Definition
spawn
:
val
:=
Definition
spawn
:
val
:=
λ
:
"f"
,
λ
:
"f"
,
let:
"c"
:=
ref
(
InjL
#
0
)
in
let:
"c"
:=
ref
NONE
in
Fork
(
"c"
<-
InjR
(
"f"
#()))
;;
"c"
.
Fork
(
"c"
<-
SOME
(
"f"
#()))
;;
"c"
.
Definition
join
:
val
:=
Definition
join
:
val
:=
rec:
"join"
"c"
:=
rec:
"join"
"c"
:=
match:
!
"c"
with
match:
!
"c"
with
InjR
"x"
=>
"x"
SOME
"x"
=>
"x"
|
InjL
<>
=>
"join"
"c"
|
NONE
=>
"join"
"c"
end
.
end
.
Global
Opaque
spawn
join
.
Global
Opaque
spawn
join
.
...
@@ -33,8 +33,8 @@ Context (heapN N : namespace).
...
@@ -33,8 +33,8 @@ Context (heapN N : namespace).
Local
Notation
iProp
:=
(
iPropG
heap_lang
Σ
).
Local
Notation
iProp
:=
(
iPropG
heap_lang
Σ
).
Definition
spawn_inv
(
γ
:
gname
)
(
l
:
loc
)
(
Ψ
:
val
→
iProp
)
:
iProp
:=
Definition
spawn_inv
(
γ
:
gname
)
(
l
:
loc
)
(
Ψ
:
val
→
iProp
)
:
iProp
:=
(
∃
lv
,
l
↦
lv
★
(
lv
=
InjLV
#
0
∨
(
∃
lv
,
l
↦
lv
★
(
lv
=
NONEV
∨
∃
v
,
lv
=
InjR
V
v
★
(
Ψ
v
∨
own
γ
(
Excl
()))))
%
I
.
∃
v
,
lv
=
SOME
V
v
★
(
Ψ
v
∨
own
γ
(
Excl
()))))
%
I
.
Definition
join_handle
(
l
:
loc
)
(
Ψ
:
val
→
iProp
)
:
iProp
:=
Definition
join_handle
(
l
:
loc
)
(
Ψ
:
val
→
iProp
)
:
iProp
:=
(
heapN
⊥
N
★
∃
γ
,
heap_ctx
heapN
★
own
γ
(
Excl
())
★
(
heapN
⊥
N
★
∃
γ
,
heap_ctx
heapN
★
own
γ
(
Excl
())
★
...
@@ -60,13 +60,13 @@ Proof.
...
@@ -60,13 +60,13 @@ Proof.
wp_let
.
wp_alloc
l
as
"Hl"
.
wp_let
.
wp_let
.
wp_alloc
l
as
"Hl"
.
wp_let
.
iPvs
(
own_alloc
(
Excl
()))
as
(
γ
)
"Hγ"
;
first
done
.
iPvs
(
own_alloc
(
Excl
()))
as
(
γ
)
"Hγ"
;
first
done
.
iPvs
(
inv_alloc
N
_
(
spawn_inv
γ
l
Ψ
)
with
"[Hl]"
)
as
"#?"
;
first
done
.
iPvs
(
inv_alloc
N
_
(
spawn_inv
γ
l
Ψ
)
with
"[Hl]"
)
as
"#?"
;
first
done
.
{
iNext
.
iExists
(
InjLV
#
0
)
.
iFrame
;
eauto
.
}
{
iNext
.
iExists
NONEV
.
iFrame
;
eauto
.
}
wp_apply
wp_fork
.
iSplitR
"Hf"
.
wp_apply
wp_fork
.
iSplitR
"Hf"
.
-
iPvsIntro
.
wp_seq
.
iPvsIntro
.
iApply
"HΦ"
.
rewrite
/
join_handle
.
eauto
.
-
iPvsIntro
.
wp_seq
.
iPvsIntro
.
iApply
"HΦ"
.
rewrite
/
join_handle
.
eauto
.
-
wp_focus
(
f
_
).
iApply
wp_wand_l
.
iFrame
"Hf"
;
iIntros
(
v
)
"Hv"
.
-
wp_focus
(
f
_
).
iApply
wp_wand_l
.
iFrame
"Hf"
;
iIntros
(
v
)
"Hv"
.
iInv
N
as
(
v
'
)
"[Hl _]"
;
first
wp_done
.
iInv
N
as
(
v
'
)
"[Hl _]"
;
first
wp_done
.
wp_store
.
iPvsIntro
.
iSplit
;
[
iNext
|
done
].
wp_store
.
iPvsIntro
.
iSplit
;
[
iNext
|
done
].
iExists
(
InjR
V
v
).
iFrame
.
eauto
.
iExists
(
SOME
V
v
).
iFrame
.
eauto
.
Qed
.
Qed
.
Lemma
join_spec
(
Ψ
:
val
→
iProp
)
l
(
Φ
:
val
→
iProp
)
:
Lemma
join_spec
(
Ψ
:
val
→
iProp
)
l
(
Φ
:
val
→
iProp
)
:
...
...
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