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
Snippets
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
Janno
iris-coq
Commits
90734cf0
Commit
90734cf0
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
newchan -> newbarrier
parent
17736977
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
barrier/barrier.v
+3
-3
3 additions, 3 deletions
barrier/barrier.v
barrier/client.v
+2
-2
2 additions, 2 deletions
barrier/client.v
barrier/proof.v
+3
-3
3 additions, 3 deletions
barrier/proof.v
barrier/specification.v
+2
-2
2 additions, 2 deletions
barrier/specification.v
with
10 additions
and
10 deletions
barrier/barrier.v
+
3
−
3
View file @
90734cf0
From
heap_lang
Require
Export
substitution
notation
.
From
heap_lang
Require
Export
substitution
notation
.
Definition
new
chan
:
val
:=
λ
:
""
,
ref
'
0
.
Definition
new
barrier
:
val
:=
λ
:
""
,
ref
'
0
.
Definition
signal
:
val
:=
λ
:
"x"
,
"x"
<-
'
1
.
Definition
signal
:
val
:=
λ
:
"x"
,
"x"
<-
'
1
.
Definition
wait
:
val
:=
Definition
wait
:
val
:=
rec
:
"wait"
"x"
:=
if
:
!
"x"
=
'
1
then
'
()
else
"wait"
"x"
.
rec
:
"wait"
"x"
:=
if
:
!
"x"
=
'
1
then
'
()
else
"wait"
"x"
.
Instance
new
chan
_closed
:
Closed
new
chan
.
Proof
.
solve_closed
.
Qed
.
Instance
new
barrier
_closed
:
Closed
new
barrier
.
Proof
.
solve_closed
.
Qed
.
Instance
signal_closed
:
Closed
signal
.
Proof
.
solve_closed
.
Qed
.
Instance
signal_closed
:
Closed
signal
.
Proof
.
solve_closed
.
Qed
.
Instance
wait_closed
:
Closed
wait
.
Proof
.
solve_closed
.
Qed
.
Instance
wait_closed
:
Closed
wait
.
Proof
.
solve_closed
.
Qed
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
barrier/client.v
+
2
−
2
View file @
90734cf0
...
@@ -2,7 +2,7 @@ From barrier Require Import proof.
...
@@ -2,7 +2,7 @@ From barrier Require Import proof.
From
program_logic
Require
Import
auth
sts
saved_prop
hoare
ownership
.
From
program_logic
Require
Import
auth
sts
saved_prop
hoare
ownership
.
Import
uPred
.
Import
uPred
.
Definition
client
:=
(
let
:
"b"
:=
new
chan
'
()
in
wait
"b"
)
%
L
.
Definition
client
:=
(
let
:
"b"
:=
new
barrier
'
()
in
wait
"b"
)
%
L
.
Section
client
.
Section
client
.
Context
{
Σ
:
iFunctorG
}
`{
!
heapG
Σ
,
!
barrierG
Σ
}
(
heapN
N
:
namespace
)
.
Context
{
Σ
:
iFunctorG
}
`{
!
heapG
Σ
,
!
barrierG
Σ
}
(
heapN
N
:
namespace
)
.
...
@@ -12,7 +12,7 @@ Section client.
...
@@ -12,7 +12,7 @@ Section client.
heapN
⊥
N
→
heap_ctx
heapN
⊑
||
client
{{
λ
_,
True
}}
.
heapN
⊥
N
→
heap_ctx
heapN
⊑
||
client
{{
λ
_,
True
}}
.
Proof
.
Proof
.
intros
?
.
rewrite
/
client
.
intros
?
.
rewrite
/
client
.
ewp
eapply
(
new
chan
_spec
heapN
N
True
%
I
);
last
done
.
ewp
eapply
(
new
barrier
_spec
heapN
N
True
%
I
);
last
done
.
apply
sep_intro_True_r
;
first
done
.
apply
sep_intro_True_r
;
first
done
.
apply
forall_intro
=>
l
.
apply
wand_intro_l
.
rewrite
right_id
.
apply
forall_intro
=>
l
.
apply
wand_intro_l
.
rewrite
right_id
.
wp_let
.
etrans
;
last
eapply
wait_spec
.
wp_let
.
etrans
;
last
eapply
wait_spec
.
...
...
This diff is collapsed.
Click to expand it.
barrier/proof.v
+
3
−
3
View file @
90734cf0
...
@@ -118,12 +118,12 @@ Proof.
...
@@ -118,12 +118,12 @@ Proof.
Qed
.
Qed
.
(** Actual proofs *)
(** Actual proofs *)
Lemma
new
chan
_spec
(
P
:
iProp
)
(
Φ
:
val
→
iProp
)
:
Lemma
new
barrier
_spec
(
P
:
iProp
)
(
Φ
:
val
→
iProp
)
:
heapN
⊥
N
→
heapN
⊥
N
→
(
heap_ctx
heapN
★
∀
l
,
recv
l
P
★
send
l
P
-★
Φ
(
LocV
l
))
(
heap_ctx
heapN
★
∀
l
,
recv
l
P
★
send
l
P
-★
Φ
(
LocV
l
))
⊑
||
new
chan
'
()
{{
Φ
}}
.
⊑
||
new
barrier
'
()
{{
Φ
}}
.
Proof
.
Proof
.
intros
HN
.
rewrite
/
new
chan
.
wp_seq
.
intros
HN
.
rewrite
/
new
barrier
.
wp_seq
.
rewrite
-
wp_pvs
.
wp
eapply
wp_alloc
;
eauto
with
I
ndisj
.
rewrite
-
wp_pvs
.
wp
eapply
wp_alloc
;
eauto
with
I
ndisj
.
apply
forall_intro
=>
l
.
rewrite
(
forall_elim
l
)
.
apply
wand_intro_l
.
apply
forall_intro
=>
l
.
rewrite
(
forall_elim
l
)
.
apply
wand_intro_l
.
rewrite
!
assoc
.
apply
pvs_wand_r
.
rewrite
!
assoc
.
apply
pvs_wand_r
.
...
...
This diff is collapsed.
Click to expand it.
barrier/specification.v
+
2
−
2
View file @
90734cf0
...
@@ -12,7 +12,7 @@ Local Notation iProp := (iPropG heap_lang Σ).
...
@@ -12,7 +12,7 @@ Local Notation iProp := (iPropG heap_lang Σ).
Lemma
barrier_spec
(
heapN
N
:
namespace
)
:
Lemma
barrier_spec
(
heapN
N
:
namespace
)
:
heapN
⊥
N
→
heapN
⊥
N
→
∃
recv
send
:
loc
→
iProp
-
n
>
iProp
,
∃
recv
send
:
loc
→
iProp
-
n
>
iProp
,
(
∀
P
,
heap_ctx
heapN
⊑
{{
True
}}
new
chan
'
()
{{
λ
v
,
∃
l
,
v
=
LocV
l
★
recv
l
P
★
send
l
P
}})
∧
(
∀
P
,
heap_ctx
heapN
⊑
{{
True
}}
new
barrier
'
()
{{
λ
v
,
∃
l
,
v
=
LocV
l
★
recv
l
P
★
send
l
P
}})
∧
(
∀
l
P
,
{{
send
l
P
★
P
}}
signal
(
LocV
l
)
{{
λ
_,
True
}})
∧
(
∀
l
P
,
{{
send
l
P
★
P
}}
signal
(
LocV
l
)
{{
λ
_,
True
}})
∧
(
∀
l
P
,
{{
recv
l
P
}}
wait
(
LocV
l
)
{{
λ
_,
P
}})
∧
(
∀
l
P
,
{{
recv
l
P
}}
wait
(
LocV
l
)
{{
λ
_,
P
}})
∧
(
∀
l
P
Q
,
{{
recv
l
(
P
★
Q
)
}}
Skip
{{
λ
_,
recv
l
P
★
recv
l
Q
}})
∧
(
∀
l
P
Q
,
{{
recv
l
(
P
★
Q
)
}}
Skip
{{
λ
_,
recv
l
P
★
recv
l
Q
}})
∧
...
@@ -22,7 +22,7 @@ Proof.
...
@@ -22,7 +22,7 @@ Proof.
exists
(
λ
l
,
CofeMor
(
recv
heapN
N
l
)),
(
λ
l
,
CofeMor
(
send
heapN
N
l
))
.
exists
(
λ
l
,
CofeMor
(
recv
heapN
N
l
)),
(
λ
l
,
CofeMor
(
send
heapN
N
l
))
.
split_and
?;
simpl
.
split_and
?;
simpl
.
-
intros
P
.
apply
:
always_intro
.
apply
impl_intro_r
.
-
intros
P
.
apply
:
always_intro
.
apply
impl_intro_r
.
rewrite
-
(
new
chan
_spec
heapN
N
P
)
//
always_and_sep_r
.
rewrite
-
(
new
barrier
_spec
heapN
N
P
)
//
always_and_sep_r
.
apply
sep_mono_r
,
forall_intro
=>
l
;
apply
wand_intro_l
.
apply
sep_mono_r
,
forall_intro
=>
l
;
apply
wand_intro_l
.
by
rewrite
right_id
-
(
exist_intro
l
)
const_equiv
//
left_id
.
by
rewrite
right_id
-
(
exist_intro
l
)
const_equiv
//
left_id
.
-
intros
l
P
.
apply
ht_alt
.
by
rewrite
-
signal_spec
right_id
.
-
intros
l
P
.
apply
ht_alt
.
by
rewrite
-
signal_spec
right_id
.
...
...
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