Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Actris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
tlsomers
Actris
Commits
c8a2d68b
Commit
c8a2d68b
authored
5 years ago
by
Jonas Kastberg Hinrichsen
Browse files
Options
Downloads
Patches
Plain Diff
Updated branch specs
parent
0dae5fe6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/encodings/branching.v
+18
-16
18 additions, 16 deletions
theories/encodings/branching.v
theories/examples/branching_proofs.v
+5
-3
5 additions, 3 deletions
theories/examples/branching_proofs.v
with
23 additions
and
19 deletions
theories/encodings/branching.v
+
18
−
16
View file @
c8a2d68b
...
...
@@ -51,12 +51,6 @@ Section branching_specs.
λ
:
"c"
"s"
"b"
,
send
"c"
"s"
"b"
.
Definition
branch
:
val
:=
λ
:
"c"
"s"
"b1"
"b2"
,
if
:
recv
"c"
"s"
then
"b1"
else
"b2"
.
Lemma
select_st_spec
st1
st2
γ
c
s
(
b
:
side
)
:
{{{
⟦
c
@
s
:
st1
<+>
st2
⟧
{
N
,
γ
}
}}}
select
c
#
s
#
b
...
...
@@ -70,20 +64,28 @@ Section branching_specs.
iApply
"HΦ"
.
by
destruct
b
.
Qed
.
Definition
branch
:
val
:=
λ
:
"c"
"s"
"b1"
"b2"
,
if
:
recv
"c"
"s"
then
"b1"
else
"b2"
.
Lemma
branch_st_spec
st1
st2
γ
c
s
(
b1
b2
:
val
)
Φ
:
⟦
c
@
s
:
st1
<
&
>
st2
⟧
{
N
,
γ
}
-∗
(
⟦
c
@
s
:
st1
⟧
{
N
,
γ
}
-∗
(
Φ
b1
))
-∗
(
⟦
c
@
s
:
st
2
⟧
{
N
,
γ
}
-∗
(
Φ
b2
))
-∗
WP
branch
c
#
s
b1
b2
{{
v
,
Φ
v
}}
.
Lemma
branch_st_spec
st1
st2
γ
c
s
(
b1
b2
:
val
)
:
{{{
⟦
c
@
s
:
st1
<
&
>
st2
⟧
{
N
,
γ
}
}}}
branch
c
#
s
b1
b2
{{{
v
,
RET
v
;
(
⌜
v
=
b1
%
V
⌝
∧
⟦
c
@
s
:
st
1
⟧
{
N
,
γ
}
)
∨
(
⌜
v
=
b2
%
V
⌝
∧
⟦
c
@
s
:
st2
⟧
{
N
,
γ
})}
}}
.
Proof
.
iIntros
"Hst Hb1 Hb2"
.
wp_lam
.
rewrite
/
TSB
.
iIntros
(
Φ'
)
.
iIntros
"Hst HΦ'"
.
wp_pures
.
wp_lam
.
rewrite
/
TSB
.
simpl
.
wp_apply
(
recv_st_spec
N
bool
with
"[$Hst //]"
)
.
iIntros
(
v
)
"[Hstl _]"
.
destruct
v
;
wp_pures
.
-
by
iApply
"H
b1"
.
-
by
iApply
"H
b2"
.
destruct
v
.
-
wp_pures
.
iApply
(
"H
Φ'"
)
.
eauto
with
iFrame
.
-
wp_pures
.
iApply
(
"H
Φ'"
)
.
eauto
with
iFrame
.
Qed
.
End
branching_specs
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
theories/examples/branching_proofs.v
+
5
−
3
View file @
c8a2d68b
...
...
@@ -28,9 +28,11 @@ Section BranchingExampleProofs.
wp_pures
.
wp_apply
(
wp_fork
with
"[Hstr]"
)
.
-
iNext
.
wp_apply
(
branch_st_spec
N
with
"Hstr"
);
iIntros
"Hstr"
.
+
wp_apply
(
send_st_spec
N
Z
with
"[$Hstr //]"
);
simpl
.
wp_apply
(
branch_st_spec
with
"Hstr"
)=>
//
;
iIntros
(
v
)
"[Hstr | Hstr]"
;
iDestruct
"Hstr"
as
(
->
)
"Hstr"
.
+
wp_pures
.
wp_apply
(
send_st_spec
N
Z
with
"[$Hstr //]"
)
.
iIntros
"Hstr"
.
done
.
+
wp_pures
.
done
.
-
destruct
b
.
...
...
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