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
William Mansky
Iris
Commits
bb8c2f55
Commit
bb8c2f55
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Use bool instead of int in barrier implementation.
parent
ba7cf95f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
heap_lang/lib/barrier/barrier.v
+3
-3
3 additions, 3 deletions
heap_lang/lib/barrier/barrier.v
heap_lang/lib/barrier/proof.v
+3
-3
3 additions, 3 deletions
heap_lang/lib/barrier/proof.v
with
6 additions
and
6 deletions
heap_lang/lib/barrier/barrier.v
+
3
−
3
View file @
bb8c2f55
From
iris
.
heap_lang
Require
Export
notation
.
Definition
newbarrier
:
val
:=
λ
:
<>
,
ref
#
0
.
Definition
signal
:
val
:=
λ
:
"x"
,
"x"
<-
#
1
.
Definition
newbarrier
:
val
:=
λ
:
<>
,
ref
#
false
.
Definition
signal
:
val
:=
λ
:
"x"
,
"x"
<-
#
true
.
Definition
wait
:
val
:=
rec
:
"wait"
"x"
:=
if
:
!
"x"
=
#
1
then
#
()
else
"wait"
"x"
.
rec
:
"wait"
"x"
:=
if
:
!
"x"
then
#
()
else
"wait"
"x"
.
Global
Opaque
newbarrier
signal
wait
.
This diff is collapsed.
Click to expand it.
heap_lang/lib/barrier/proof.v
+
3
−
3
View file @
bb8c2f55
...
...
@@ -28,7 +28,7 @@ Definition ress (P : iProp Σ) (I : gset gname) : iProp Σ :=
▷
(
P
-★
[
★
set
]
i
∈
I
,
Ψ
i
)
★
[
★
set
]
i
∈
I
,
saved_prop_own
i
(
Ψ
i
))
%
I
.
Coercion
state_to_val
(
s
:
state
)
:
val
:=
match
s
with
State
Low
_
=>
#
0
|
State
High
_
=>
#
1
end
.
match
s
with
State
Low
_
=>
#
false
|
State
High
_
=>
#
true
end
.
Arguments
state_to_val
!
_
/
:
simpl
nomatch
.
Definition
state_to_prop
(
s
:
state
)
(
P
:
iProp
Σ
)
:
iProp
Σ
:=
...
...
@@ -145,7 +145,7 @@ Proof.
{
iSplit
;
first
done
.
iNext
.
rewrite
{
2
}
/
barrier_inv
/=.
by
iFrame
.
}
iAssert
(
sts_ownS
γ
(
i_states
i
)
{[
Change
i
]})
%
I
with
"==>[Hγ]"
as
"Hγ"
.
{
iApply
(
sts_own_weaken
with
"Hγ"
);
eauto
using
i_states_closed
.
}
iVsIntro
.
wp_op
=>
?;
simplify_eq
;
wp_if
.
iVsIntro
.
wp_if
.
iApply
(
"IH"
with
"Hγ [HQR] HΦ"
)
.
auto
.
-
(* a High state: the comparison succeeds, and we perform a transition and
return to the client *)
...
...
@@ -157,7 +157,7 @@ Proof.
{
iSplit
;
[
iPureIntro
;
by
eauto
using
wait_step
|]
.
iNext
.
rewrite
{
2
}
/
barrier_inv
/=
;
iFrame
"Hl"
.
iExists
Ψ
;
iFrame
.
auto
.
}
iPoseProof
(
saved_prop_agree
i
Q
(
Ψ
i
)
with
"[#]"
)
as
"Heq"
;
first
by
auto
.
iVsIntro
.
wp_op
=>
?;
simplify_eq
/=
;
wp_if
.
iVsIntro
.
wp_if
.
iVsIntro
.
iApply
"HΦ"
.
iApply
"HQR"
.
by
iRewrite
"Heq"
.
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