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
Pierre-Marie Pédrot
Iris
Commits
544400fd
Commit
544400fd
authored
Jun 26, 2018
by
Marianna Rapoport
Committed by
Ralf Jung
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simpler proof
parent
5c51c26c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
28 deletions
+16
-28
theories/heap_lang/lib/coin-flip.v
theories/heap_lang/lib/coin-flip.v
+16
-28
No files found.
theories/heap_lang/lib/coin-flip.v
View file @
544400fd
...
@@ -93,14 +93,21 @@ Section prophecy.
...
@@ -93,14 +93,21 @@ Section prophecy.
(* -- predicates -- *)
(* -- predicates -- *)
is_prophecy
:
proph
->
val
->
iProp
Σ
;
is_prophecy
:
proph
->
val
->
iProp
Σ
;
(* -- general properties -- *)
(* -- general properties -- *)
new_prophecy_spec
:
new_prophecy_spec
:
{{{
True
}}}
new_prophecy
#()
{{{
p
,
RET
#
p
;
∃
v
,
is_prophecy
p
#
v
}}}
;
{{{
True
}}}
new_prophecy
#()
{{{
p
,
RET
#
p
;
∃
v
,
is_prophecy
p
v
}}}
;
resolve_prophecy_spec
p
v
w
:
resolve_prophecy_spec
p
v
e
w
:
{{{
is_prophecy
p
v
}}}
resolve_prophecy
#
p
w
{{{
RET
w
;
⌜
v
=
w
⌝
}}}
IntoVal
e
w
->
{{{
is_prophecy
p
v
}}}
resolve_prophecy
#
p
e
{{{
RET
w
;
⌜
v
=
w
⌝
}}}
}.
}.
Context
`
{
pr
:
prophecy
}.
Context
`
{
pr
:
prophecy
}.
Definition
val_to_bool
v
:
bool
:
=
match
v
with
|
LitV
(
LitBool
b
)
=>
b
|
_
=>
true
end
.
Definition
lateChoice_proph
:
val
:
=
Definition
lateChoice_proph
:
val
:
=
λ
:
"x"
,
λ
:
"x"
,
let
:
"p"
:
=
new_prophecy
pr
#()
in
let
:
"p"
:
=
new_prophecy
pr
#()
in
...
@@ -108,12 +115,6 @@ Section prophecy.
...
@@ -108,12 +115,6 @@ Section prophecy.
let
:
"r"
:
=
rand
#()
in
let
:
"r"
:
=
rand
#()
in
resolve_prophecy
pr
"p"
"r"
.
resolve_prophecy
pr
"p"
"r"
.
Definition
val_to_bool
v
:
=
match
v
with
|
LitBool
b
=>
Some
b
|
_
=>
None
end
.
Lemma
lateChoice_proph_spec
(
x
:
loc
)
:
Lemma
lateChoice_proph_spec
(
x
:
loc
)
:
<<<
x
↦
-
>>>
<<<
x
↦
-
>>>
lateChoice_proph
#
x
lateChoice_proph
#
x
...
@@ -128,24 +129,11 @@ Section prophecy.
...
@@ -128,24 +129,11 @@ Section prophecy.
iMod
"AU"
as
"[Hl [_ Hclose]]"
.
iMod
"AU"
as
"[Hl [_ Hclose]]"
.
iDestruct
"Hl"
as
(
v'
)
"Hl"
.
iDestruct
"Hl"
as
(
v'
)
"Hl"
.
wp_store
.
wp_store
.
destruct
(
val_to_bool
v
)
eqn
:
Heq
.
iMod
(
"Hclose"
$!
(
val_to_bool
v
)
with
"[Hl]"
)
as
"HΦ"
;
first
by
eauto
.
-
iMod
(
"Hclose"
$!
b
with
"[Hl]"
)
as
"HΦ"
;
first
by
eauto
.
iModIntro
.
wp_seq
.
wp_apply
rand_spec
;
try
done
.
iIntros
(
b'
)
"_"
.
wp_let
.
iDestruct
(
resolve_prophecy_spec
with
"Hp"
)
as
"Hs"
.
iAssert
(
▷
(
⌜
#
v
=
#
b'
⌝
-
∗
Φ
#
b'
))%
I
with
"[HΦ]"
as
"Hb"
.
{
iNext
.
iIntros
"Heq"
.
destruct
v
;
inversion
Heq
;
subst
.
iDestruct
"Heq"
as
%->.
done
.
}
iSpecialize
(
"Hs"
with
"Hb"
).
done
.
-
iMod
(
"Hclose"
$!
true
with
"[Hl]"
)
as
"HΦ"
;
first
by
eauto
.
iModIntro
.
wp_seq
.
wp_apply
rand_spec
;
try
done
.
iModIntro
.
wp_seq
.
wp_apply
rand_spec
;
try
done
.
iIntros
(
b'
)
"_"
.
wp_let
.
iIntros
(
b'
)
"_"
.
wp_let
.
iDestruct
(
resolve_prophecy_spec
with
"Hp"
)
as
"Hs"
.
iApply
(
resolve_prophecy_spec
with
"Hp"
).
iAssert
(
▷
(
⌜
#
v
=
#
b'
⌝
-
∗
Φ
#
b'
))%
I
with
"[HΦ]"
as
"Hb"
.
{
iNext
.
iIntros
(->).
done
.
iNext
.
iIntros
"Heq"
.
iDestruct
"Heq"
as
%[=
Heq'
].
destruct
v
;
inversion
Heq
;
inversion
Heq'
.
}
iSpecialize
(
"Hs"
with
"Hb"
).
done
.
Qed
.
Qed
.
End
prophecy
.
End
prophecy
.
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