Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tutorial-popl18
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
tutorial-popl18
Commits
2d178e1e
Commit
2d178e1e
authored
May 24, 2019
by
Hai Dang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump Iris (changes in auth)
parent
5b5acee6
Pipeline
#17336
passed with stage
in 7 minutes and 26 seconds
Changes
5
Pipelines
19
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
15 deletions
+25
-15
ex_04_parallel_add.v
exercises/ex_04_parallel_add.v
+7
-4
ex_05_parallel_add_mul.v
exercises/ex_05_parallel_add_mul.v
+5
-3
opam
opam
+1
-1
ex_04_parallel_add.v
solutions/ex_04_parallel_add.v
+7
-4
ex_05_parallel_add_mul.v
solutions/ex_05_parallel_add_mul.v
+5
-3
No files found.
exercises/ex_04_parallel_add.v
View file @
2d178e1e
...
...
@@ -3,7 +3,7 @@ In this exercise we use the spin-lock from the previous exercise to implement
the running example during the lecture of the tutorial: proving that when two
threads increase a reference that's initially zero by two, the result is four.
*)
From
iris
.
algebra
Require
Import
auth
frac_auth
.
From
iris
.
algebra
Require
Import
auth
frac_auth
excl
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
lib
.
par
proofmode
notation
.
From
exercises
Require
Import
ex_03_spinlock
.
...
...
@@ -75,7 +75,9 @@ Section proof2.
Lemma
ghost_var_alloc
n
:
(|==>
∃
γ
,
own
γ
(
●
(
Excl'
n
))
∗
own
γ
(
◯
(
Excl'
n
)))%
I
.
Proof
.
iMod
(
own_alloc
(
●
(
Excl'
n
)
⋅
◯
(
Excl'
n
)))
as
(
γ
)
"[??]"
;
by
eauto
with
iFrame
.
iMod
(
own_alloc
(
●
(
Excl'
n
)
⋅
◯
(
Excl'
n
)))
as
(
γ
)
"[??]"
.
-
by
apply
auth_both_valid
.
-
by
eauto
with
iFrame
.
Qed
.
Lemma
ghost_var_agree
γ
n
m
:
...
...
@@ -83,7 +85,7 @@ Section proof2.
Proof
.
iIntros
"Hγ● Hγ◯"
.
by
iDestruct
(
own_valid_2
with
"Hγ● Hγ◯"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
both_valid
.
Qed
.
Lemma
ghost_var_update
γ
n'
n
m
:
...
...
@@ -137,7 +139,8 @@ Section proof3.
Proof
.
iIntros
(
Φ
)
"_ Post"
.
unfold
parallel_add
.
wp_alloc
r
as
"Hr"
.
wp_let
.
iMod
(
own_alloc
(
●
!
0
%
nat
⋅
◯
!
0
%
nat
))
as
(
γ
)
"[Hγ● [Hγ1◯ Hγ2◯]]"
;
[
done
|].
iMod
(
own_alloc
(
●
!
0
%
nat
⋅
◯
!
0
%
nat
))
as
(
γ
)
"[Hγ● [Hγ1◯ Hγ2◯]]"
.
{
by
apply
auth_both_valid
.
}
wp_apply
(
newlock_spec
(
parallel_add_inv_3
r
γ
)
with
"[Hr Hγ●]"
).
{
(* exercise *)
admit
.
}
...
...
exercises/ex_05_parallel_add_mul.v
View file @
2d178e1e
...
...
@@ -8,7 +8,7 @@ first, the outcome is either 2 or 4.
Contrary to the earlier exercises, this exercise is nearly entirely open.
*)
From
iris
.
algebra
Require
Import
auth
frac_auth
.
From
iris
.
algebra
Require
Import
auth
frac_auth
excl
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
proofmode
notation
lib
.
par
.
From
exercises
Require
Import
ex_03_spinlock
.
...
...
@@ -33,7 +33,9 @@ Section proof.
Lemma
ghost_var_alloc
b
:
(|==>
∃
γ
,
own
γ
(
●
(
Excl'
b
))
∗
own
γ
(
◯
(
Excl'
b
)))%
I
.
Proof
.
iMod
(
own_alloc
(
●
(
Excl'
b
)
⋅
◯
(
Excl'
b
)))
as
(
γ
)
"[??]"
;
by
eauto
with
iFrame
.
iMod
(
own_alloc
(
●
(
Excl'
b
)
⋅
◯
(
Excl'
b
)))
as
(
γ
)
"[??]"
.
-
by
apply
auth_both_valid
.
-
by
eauto
with
iFrame
.
Qed
.
Lemma
ghost_var_agree
γ
b
c
:
...
...
@@ -41,7 +43,7 @@ Section proof.
Proof
.
iIntros
"Hγ● Hγ◯"
.
by
iDestruct
(
own_valid_2
with
"Hγ● Hγ◯"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
both_valid
.
Qed
.
Lemma
ghost_var_update
γ
b'
b
c
:
...
...
opam
View file @
2d178e1e
...
...
@@ -9,5 +9,5 @@ build: [make "-j%{jobs}%"]
install: [] # This repo does not install
remove: []
depends: [
"coq-iris" { (= "dev.2019-0
3-04.1.a848ac3b
") | (= "dev") }
"coq-iris" { (= "dev.2019-0
5-24.0.c9984c7f
") | (= "dev") }
]
solutions/ex_04_parallel_add.v
View file @
2d178e1e
...
...
@@ -3,7 +3,7 @@ In this exercise we use the spin-lock from the previous exercise to implement
the running example during the lecture of the tutorial: proving that when two
threads increase a reference that's initially zero by two, the result is four.
*)
From
iris
.
algebra
Require
Import
auth
frac_auth
.
From
iris
.
algebra
Require
Import
auth
frac_auth
excl
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
lib
.
par
proofmode
notation
.
From
solutions
Require
Import
ex_03_spinlock
.
...
...
@@ -79,7 +79,9 @@ Section proof2.
Lemma
ghost_var_alloc
n
:
(|==>
∃
γ
,
own
γ
(
●
(
Excl'
n
))
∗
own
γ
(
◯
(
Excl'
n
)))%
I
.
Proof
.
iMod
(
own_alloc
(
●
(
Excl'
n
)
⋅
◯
(
Excl'
n
)))
as
(
γ
)
"[??]"
;
by
eauto
with
iFrame
.
iMod
(
own_alloc
(
●
(
Excl'
n
)
⋅
◯
(
Excl'
n
)))
as
(
γ
)
"[??]"
.
-
by
apply
auth_both_valid
.
-
by
eauto
with
iFrame
.
Qed
.
Lemma
ghost_var_agree
γ
n
m
:
...
...
@@ -87,7 +89,7 @@ Section proof2.
Proof
.
iIntros
"Hγ● Hγ◯"
.
by
iDestruct
(
own_valid_2
with
"Hγ● Hγ◯"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
both_valid
.
Qed
.
Lemma
ghost_var_update
γ
n'
n
m
:
...
...
@@ -150,7 +152,8 @@ Section proof3.
Proof
.
iIntros
(
Φ
)
"_ Post"
.
unfold
parallel_add
.
wp_alloc
r
as
"Hr"
.
wp_let
.
iMod
(
own_alloc
(
●
!
0
%
nat
⋅
◯
!
0
%
nat
))
as
(
γ
)
"[Hγ● [Hγ1◯ Hγ2◯]]"
;
[
done
|].
iMod
(
own_alloc
(
●
!
0
%
nat
⋅
◯
!
0
%
nat
))
as
(
γ
)
"[Hγ● [Hγ1◯ Hγ2◯]]"
.
{
by
apply
auth_both_valid
.
}
wp_apply
(
newlock_spec
(
parallel_add_inv_3
r
γ
)
with
"[Hr Hγ●]"
).
{
(* exercise *)
iExists
0
%
nat
.
iFrame
.
}
iIntros
(
l
)
"#Hl"
.
wp_let
.
...
...
solutions/ex_05_parallel_add_mul.v
View file @
2d178e1e
...
...
@@ -8,7 +8,7 @@ first, the outcome is either 2 or 4.
Contrary to the earlier exercises, this exercise is nearly entirely open.
*)
From
iris
.
algebra
Require
Import
auth
frac_auth
.
From
iris
.
algebra
Require
Import
auth
frac_auth
excl
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
proofmode
notation
lib
.
par
.
From
solutions
Require
Import
ex_03_spinlock
.
...
...
@@ -33,7 +33,9 @@ Section proof.
Lemma
ghost_var_alloc
b
:
(|==>
∃
γ
,
own
γ
(
●
(
Excl'
b
))
∗
own
γ
(
◯
(
Excl'
b
)))%
I
.
Proof
.
iMod
(
own_alloc
(
●
(
Excl'
b
)
⋅
◯
(
Excl'
b
)))
as
(
γ
)
"[??]"
;
by
eauto
with
iFrame
.
iMod
(
own_alloc
(
●
(
Excl'
b
)
⋅
◯
(
Excl'
b
)))
as
(
γ
)
"[??]"
.
-
by
apply
auth_both_valid
.
-
by
eauto
with
iFrame
.
Qed
.
Lemma
ghost_var_agree
γ
b
c
:
...
...
@@ -41,7 +43,7 @@ Section proof.
Proof
.
iIntros
"Hγ● Hγ◯"
.
by
iDestruct
(
own_valid_2
with
"Hγ● Hγ◯"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_]%
auth_
both_valid
.
Qed
.
Lemma
ghost_var_update
γ
b'
b
c
:
...
...
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