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
c9ea799b
Commit
c9ea799b
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Minor barrier clean up.
parent
4734d7bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
barrier/barrier.v
+13
-18
13 additions, 18 deletions
barrier/barrier.v
with
13 additions
and
18 deletions
barrier/barrier.v
+
13
−
18
View file @
c9ea799b
...
...
@@ -14,27 +14,26 @@ Definition wait := (rec: "wait" "x" :=if: !"x" = '1 then '() else "wait" "x")%L.
with saved propositions. *)
Module
barrier_proto
.
Inductive
phase
:=
Low
|
High
.
Record
state
T
:=
State
{
state_phase
:
phase
;
state_I
:
gset
gname
}
.
Record
state
:=
State
{
state_phase
:
phase
;
state_I
:
gset
gname
}
.
Inductive
token
:=
Change
(
i
:
gname
)
|
Send
.
Global
Instance
stateT_inhabited
:
Inhabited
stateT
.
Proof
.
split
.
exact
(
State
Low
∅
)
.
Qed
.
Global
Instance
stateT_inhabited
:
Inhabited
state
:=
populate
(
State
Low
∅
)
.
Definition
change_tokens
(
I
:
gset
gname
)
:
set
token
:=
mkSet
(
λ
t
,
match
t
with
Change
i
=>
i
∉
I
|
Send
=>
False
end
)
.
Inductive
trans
:
relation
state
T
:=
|
ChangeI
p
I2
I1
:
trans
(
State
p
I1
)
(
State
p
I2
)
|
ChangePhase
I
:
trans
(
State
Low
I
)
(
State
High
I
)
.
Inductive
prim_step
:
relation
state
:=
|
ChangeI
p
I2
I1
:
prim_step
(
State
p
I1
)
(
State
p
I2
)
|
ChangePhase
I
:
prim_step
(
State
Low
I
)
(
State
High
I
)
.
Definition
tok
(
s
:
state
T
)
:
set
token
:=
Definition
tok
(
s
:
state
)
:
set
token
:=
change_tokens
(
state_I
s
)
∪
match
state_phase
s
with
Low
=>
∅
|
High
=>
{[
Send
]}
end
.
Canonical
Structure
sts
:=
sts
.
STS
trans
tok
.
Canonical
Structure
sts
:=
sts
.
STS
prim_step
tok
.
(* The set of states containing some particular i *)
Definition
i_states
(
i
:
gname
)
:
set
state
T
:=
Definition
i_states
(
i
:
gname
)
:
set
state
:=
mkSet
(
λ
s
,
i
∈
state_I
s
)
.
Lemma
i_states_closed
i
:
...
...
@@ -62,7 +61,7 @@ Module barrier_proto.
Qed
.
(* The set of low states *)
Definition
low_states
:
set
state
T
:=
Definition
low_states
:
set
state
:=
mkSet
(
λ
s
,
if
state_phase
s
is
Low
then
True
else
False
)
.
Lemma
low_states_closed
:
sts
.
closed
low_states
{[
Send
]}
.
...
...
@@ -161,7 +160,7 @@ Section proof.
Local
Notation
state_to_val
s
:=
(
match
s
with
State
Low
_
=>
0
|
State
High
_
=>
1
end
)
.
Definition
barrier_inv
(
l
:
loc
)
(
P
:
iProp
)
(
s
:
state
T
)
:
iProp
:=
Definition
barrier_inv
(
l
:
loc
)
(
P
:
iProp
)
(
s
:
state
)
:
iProp
:=
(
l
↦
'
(
state_to_val
s
)
★
match
s
with
State
Low
I'
=>
waiting
P
I'
|
State
High
I'
=>
ress
I'
end
)
%
I
.
...
...
@@ -181,18 +180,14 @@ Section proof.
(
∃
γ
,
barrier_ctx
γ
l
P
★
sts_ownS
γ
low_states
{[
Send
]})
%
I
.
Global
Instance
send_ne
n
l
:
Proper
(
dist
n
==>
dist
n
)
(
send
l
)
.
Proof
.
(* TODO: This really ought to be doable by an automatic tactic. it is just application of already regostered congruence lemmas. *)
move
=>?
?
EQ
.
rewrite
/
send
.
apply
exist_ne
=>
γ
.
by
rewrite
EQ
.
Qed
.
Proof
.
intros
P1
P2
HP
.
rewrite
/
send
.
by
setoid_rewrite
HP
.
Qed
.
Definition
recv
(
l
:
loc
)
(
R
:
iProp
)
:
iProp
:=
(
∃
γ
P
Q
i
,
barrier_ctx
γ
l
P
★
sts_ownS
γ
(
i_states
i
)
{[
Change
i
]}
★
saved_prop_own
i
Q
★
▷
(
Q
-★
R
))
%
I
.
Global
Instance
recv_ne
n
l
:
Proper
(
dist
n
==>
dist
n
)
(
recv
l
)
.
Proof
.
move
=>?
?
EQ
.
rewrite
/
send
.
do
4
apply
exist_ne
=>?
.
by
rewrite
EQ
.
Qed
.
Proof
.
intros
R1
R2
HR
.
rewrite
/
recv
.
by
setoid_rewrite
HR
.
Qed
.
Lemma
waiting_split
i
i1
i2
Q
R1
R2
P
I
:
i
∈
I
→
i1
∉
I
→
i2
∉
I
→
i1
≠
i2
→
...
...
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