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
T
Tutorial POPL18
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
Tutorial POPL18
Commits
5efd4e91
Verified
Commit
5efd4e91
authored
Feb 11, 2019
by
Rodolphe Lepigre
Browse files
Options
Browse Files
Download
Plain Diff
Merged from master.
parents
22a8451e
9d4bb10d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
31 deletions
+7
-31
exercises/ex_04_parallel_add.v
exercises/ex_04_parallel_add.v
+3
-13
solutions/ex_04_parallel_add.v
solutions/ex_04_parallel_add.v
+3
-13
solutions/ex_05_parallel_add_mul.v
solutions/ex_05_parallel_add_mul.v
+1
-5
No files found.
exercises/ex_04_parallel_add.v
View file @
5efd4e91
...
@@ -39,9 +39,7 @@ Section proof1.
...
@@ -39,9 +39,7 @@ Section proof1.
{
(* exercise *)
{
(* exercise *)
admit
.
}
admit
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, True%I) (λ _, True%I)).*)
wp_apply
(
par_spec
(
λ
_
,
True
%
I
)
(
λ
_
,
True
%
I
)).
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
True
%
I
)
(
λ
_
,
True
%
I
)).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr %]"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr %]"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_apply
(
release_spec
with
"[Hr $Hl]"
)
;
[|
done
].
wp_apply
(
release_spec
with
"[Hr $Hl]"
)
;
[|
done
].
...
@@ -110,11 +108,7 @@ Section proof2.
...
@@ -110,11 +108,7 @@ Section proof2.
{
(* exercise *)
{
(* exercise *)
admit
.
}
admit
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, own γ1 (◯ Excl' 2)) (λ _, own γ2 (◯ Excl' 2))
wp_apply
(
par_spec
(
λ
_
,
own
γ
1
(
◯
Excl'
2
))
(
λ
_
,
own
γ
2
(
◯
Excl'
2
))
with "[Hγ1◯] [Hγ2◯]").*)
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
own
γ
1
(
◯
Excl'
2
))
(
λ
_
,
own
γ
2
(
◯
Excl'
2
))
with
"[Hγ1◯] [Hγ2◯]"
).
with
"[Hγ1◯] [Hγ2◯]"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n1
n2
)
"(Hr & Hγ1● & Hγ2●)"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n1
n2
)
"(Hr & Hγ1● & Hγ2●)"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
...
@@ -148,11 +142,7 @@ Section proof3.
...
@@ -148,11 +142,7 @@ Section proof3.
{
(* exercise *)
{
(* exercise *)
admit
.
}
admit
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, own γ (◯!{1/2} 2%nat)) (λ _, own γ (◯!{1/2} 2%nat))
wp_apply
(
par_spec
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
with "[Hγ1◯] [Hγ2◯]").*)
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
with
"[Hγ1◯] [Hγ2◯]"
).
with
"[Hγ1◯] [Hγ2◯]"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr Hγ●]"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr Hγ●]"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
...
...
solutions/ex_04_parallel_add.v
View file @
5efd4e91
...
@@ -38,9 +38,7 @@ Section proof1.
...
@@ -38,9 +38,7 @@ Section proof1.
wp_apply
(
newlock_spec
(
parallel_add_inv_1
r
)
with
"[Hr]"
).
wp_apply
(
newlock_spec
(
parallel_add_inv_1
r
)
with
"[Hr]"
).
{
(* exercise *)
iExists
0
.
iFrame
.
}
{
(* exercise *)
iExists
0
.
iFrame
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, True%I) (λ _, True%I)).*)
wp_apply
(
par_spec
(
λ
_
,
True
%
I
)
(
λ
_
,
True
%
I
)).
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
True
%
I
)
(
λ
_
,
True
%
I
)).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr %]"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr %]"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_apply
(
release_spec
with
"[Hr $Hl]"
)
;
[|
done
].
wp_apply
(
release_spec
with
"[Hr $Hl]"
)
;
[|
done
].
...
@@ -113,11 +111,7 @@ Section proof2.
...
@@ -113,11 +111,7 @@ Section proof2.
wp_apply
(
newlock_spec
(
parallel_add_inv_2
r
γ
1
γ
2
)
with
"[Hr Hγ1● Hγ2●]"
).
wp_apply
(
newlock_spec
(
parallel_add_inv_2
r
γ
1
γ
2
)
with
"[Hr Hγ1● Hγ2●]"
).
{
(* exercise *)
iExists
0
,
0
.
iFrame
.
}
{
(* exercise *)
iExists
0
,
0
.
iFrame
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, own γ1 (◯ Excl' 2)) (λ _, own γ2 (◯ Excl' 2))
wp_apply
(
par_spec
(
λ
_
,
own
γ
1
(
◯
Excl'
2
))
(
λ
_
,
own
γ
2
(
◯
Excl'
2
))
with "[Hγ1◯] [Hγ2◯]").*)
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
own
γ
1
(
◯
Excl'
2
))
(
λ
_
,
own
γ
2
(
◯
Excl'
2
))
with
"[Hγ1◯] [Hγ2◯]"
).
with
"[Hγ1◯] [Hγ2◯]"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n1
n2
)
"(Hr & Hγ1● & Hγ2●)"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n1
n2
)
"(Hr & Hγ1● & Hγ2●)"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
...
@@ -160,11 +154,7 @@ Section proof3.
...
@@ -160,11 +154,7 @@ Section proof3.
wp_apply
(
newlock_spec
(
parallel_add_inv_3
r
γ
)
with
"[Hr Hγ●]"
).
wp_apply
(
newlock_spec
(
parallel_add_inv_3
r
γ
)
with
"[Hr Hγ●]"
).
{
(* exercise *)
iExists
0
%
nat
.
iFrame
.
}
{
(* exercise *)
iExists
0
%
nat
.
iFrame
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, own γ (◯!{1/2} 2%nat)) (λ _, own γ (◯!{1/2} 2%nat))
wp_apply
(
par_spec
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
with "[Hγ1◯] [Hγ2◯]").*)
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
(
λ
_
,
own
γ
(
◯
!{
1
/
2
}
2
%
nat
))
with
"[Hγ1◯] [Hγ2◯]"
).
with
"[Hγ1◯] [Hγ2◯]"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr Hγ●]"
.
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
n
)
"[Hr Hγ●]"
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
wp_seq
.
wp_load
.
wp_op
.
wp_store
.
...
...
solutions/ex_05_parallel_add_mul.v
View file @
5efd4e91
...
@@ -77,11 +77,7 @@ Section proof.
...
@@ -77,11 +77,7 @@ Section proof.
wp_apply
(
newlock_spec
(
parallel_add_mul_inv
r
γ
1
γ
2
)
with
"[Hr Hγ1● Hγ2●]"
).
wp_apply
(
newlock_spec
(
parallel_add_mul_inv
r
γ
1
γ
2
)
with
"[Hr Hγ1● Hγ2●]"
).
{
iExists
false
,
false
,
0
.
iFrame
.
done
.
}
{
iExists
false
,
false
,
0
.
iFrame
.
done
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
iIntros
(
l
)
"#Hl"
.
wp_let
.
(*wp_apply (wp_par (λ _, own γ1 (◯ Excl' true)) (λ _, own γ2 (◯ Excl' true))
wp_apply
(
par_spec
(
λ
_
,
own
γ
1
(
◯
Excl'
true
))
(
λ
_
,
own
γ
2
(
◯
Excl'
true
))
with "[Hγ1◯] [Hγ2◯]").*)
(* FIXME previous tactic fails (replaced by the following two). *)
wp_bind
(
_
|||
_
)%
E
.
iApply
(
wp_par
(
λ
_
,
own
γ
1
(
◯
Excl'
true
))
(
λ
_
,
own
γ
2
(
◯
Excl'
true
))
with
"[Hγ1◯] [Hγ2◯]"
).
with
"[Hγ1◯] [Hγ2◯]"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
-
wp_apply
(
acquire_spec
with
"Hl"
).
iDestruct
1
as
(
b1
b2
z
)
"(Hγ1● & Hγ2● & Hr & %)"
.
iDestruct
1
as
(
b1
b2
z
)
"(Hγ1● & Hγ2● & Hr & %)"
.
...
...
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