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
I
Iris
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodolphe Lepigre
Iris
Commits
f8e2c74c
Commit
f8e2c74c
authored
Dec 06, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compatibility with coq 8.6
parent
3a20cb6a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
24 additions
and
13 deletions
+24
-13
heap_lang/lib/assert.v
heap_lang/lib/assert.v
+2
-1
heap_lang/lib/barrier/proof.v
heap_lang/lib/barrier/proof.v
+2
-0
heap_lang/lib/counter.v
heap_lang/lib/counter.v
+2
-1
heap_lang/lib/par.v
heap_lang/lib/par.v
+2
-1
heap_lang/lib/spawn.v
heap_lang/lib/spawn.v
+1
-1
heap_lang/lib/spin_lock.v
heap_lang/lib/spin_lock.v
+3
-1
heap_lang/lib/ticket_lock.v
heap_lang/lib/ticket_lock.v
+1
-2
tests/barrier_client.v
tests/barrier_client.v
+2
-1
tests/counter.v
tests/counter.v
+2
-1
tests/joining_existentials.v
tests/joining_existentials.v
+2
-1
tests/one_shot.v
tests/one_shot.v
+2
-1
tests/tree_sum.v
tests/tree_sum.v
+3
-2
No files found.
heap_lang/lib/assert.v
View file @
f8e2c74c
...
...
@@ -7,7 +7,6 @@ Definition assert : val :=
λ
:
"v"
,
if
:
"v"
#()
then
#()
else
#
0
#
0
.
(* #0 #0 is unsafe *)
(* just below ;; *)
Notation
"'assert:' e"
:
=
(
assert
(
λ
:
<>,
e
))%
E
(
at
level
99
)
:
expr_scope
.
Global
Opaque
assert
.
Lemma
wp_assert
`
{
heapG
Σ
}
E
(
Φ
:
val
→
iProp
Σ
)
e
`
{!
Closed
[]
e
}
:
WP
e
@
E
{{
v
,
⌜
v
=
#
true
⌝
∧
▷
Φ
#()
}}
⊢
WP
assert
:
e
@
E
{{
Φ
}}.
...
...
@@ -15,3 +14,5 @@ Proof.
iIntros
"HΦ"
.
rewrite
/
assert
.
wp_let
.
wp_seq
.
iApply
(
wp_wand
with
"HΦ"
).
iIntros
(
v
)
"[% ?]"
;
subst
.
by
wp_if
.
Qed
.
Global
Opaque
assert
.
heap_lang/lib/barrier/proof.v
View file @
f8e2c74c
...
...
@@ -22,6 +22,8 @@ Section proof.
Context
`
{!
heapG
Σ
,
!
barrierG
Σ
}
(
N
:
namespace
).
Implicit
Types
I
:
gset
gname
.
Local
Transparent
newbarrier
signal
wait
.
Definition
ress
(
P
:
iProp
Σ
)
(
I
:
gset
gname
)
:
iProp
Σ
:
=
(
∃
Ψ
:
gname
→
iProp
Σ
,
▷
(
P
-
∗
[
∗
set
]
i
∈
I
,
Ψ
i
)
∗
[
∗
set
]
i
∈
I
,
saved_prop_own
i
(
Ψ
i
))%
I
.
...
...
heap_lang/lib/counter.v
View file @
f8e2c74c
...
...
@@ -10,7 +10,6 @@ Definition incr : val :=
let
:
"n"
:
=
!
"l"
in
if
:
CAS
"l"
"n"
(#
1
+
"n"
)
then
#()
else
"incr"
"l"
.
Definition
read
:
val
:
=
λ
:
"l"
,
!
"l"
.
Global
Opaque
newcounter
incr
get
.
(** Monotone counter *)
Class
mcounterG
Σ
:
=
MCounterG
{
mcounter_inG
:
>
inG
Σ
(
authR
mnatUR
)
}.
...
...
@@ -167,3 +166,5 @@ Section contrib_spec.
by
iApply
"HΦ"
.
Qed
.
End
contrib_spec
.
Global
Opaque
newcounter
incr
get
.
heap_lang/lib/par.v
View file @
f8e2c74c
...
...
@@ -11,7 +11,6 @@ Definition par : val :=
let
:
"v1"
:
=
join
"handle"
in
(
"v1"
,
"v2"
).
Notation
"e1 ||| e2"
:
=
(
par
(
Pair
(
λ
:
<>,
e1
)
(
λ
:
<>,
e2
)))%
E
:
expr_scope
.
Global
Opaque
par
.
Section
proof
.
Context
`
{!
heapG
Σ
,
!
spawnG
Σ
}.
...
...
@@ -45,3 +44,5 @@ Proof.
iSplitL
"H1"
;
by
wp_let
.
Qed
.
End
proof
.
Global
Opaque
par
.
heap_lang/lib/spawn.v
View file @
f8e2c74c
...
...
@@ -14,7 +14,6 @@ Definition join : val :=
SOME
"x"
=>
"x"
|
NONE
=>
"join"
"c"
end
.
Global
Opaque
spawn
join
.
(** The CMRA & functor we need. *)
(* Not bundling heapG, as it may be shared with other users. *)
...
...
@@ -79,3 +78,4 @@ Qed.
End
proof
.
Typeclasses
Opaque
join_handle
.
Global
Opaque
spawn
join
.
heap_lang/lib/spin_lock.v
View file @
f8e2c74c
...
...
@@ -10,7 +10,6 @@ Definition try_acquire : val := λ: "l", CAS "l" #false #true.
Definition
acquire
:
val
:
=
rec
:
"acquire"
"l"
:
=
if
:
try_acquire
"l"
then
#()
else
"acquire"
"l"
.
Definition
release
:
val
:
=
λ
:
"l"
,
"l"
<-
#
false
.
Global
Opaque
newlock
try_acquire
acquire
release
.
(** The CMRA we need. *)
(* Not bundling heapG, as it may be shared with other users. *)
...
...
@@ -89,6 +88,9 @@ Section proof.
Qed
.
End
proof
.
Typeclasses
Opaque
is_lock
locked
.
Global
Opaque
newlock
try_acquire
acquire
release
.
Definition
spin_lock
`
{!
heapG
Σ
,
!
lockG
Σ
}
:
lock
Σ
:
=
{|
lock
.
locked_exclusive
:
=
locked_exclusive
;
lock
.
newlock_spec
:
=
newlock_spec
;
lock
.
acquire_spec
:
=
acquire_spec
;
lock
.
release_spec
:
=
release_spec
|}.
heap_lang/lib/ticket_lock.v
View file @
f8e2c74c
...
...
@@ -25,8 +25,6 @@ Definition acquire : val :=
Definition
release
:
val
:
=
λ
:
"lk"
,
(
Fst
"lk"
)
<-
!(
Fst
"lk"
)
+
#
1
.
Global
Opaque
newlock
acquire
release
wait_loop
.
(** The CMRAs we need. *)
Class
tlockG
Σ
:
=
tlock_G
:
>
inG
Σ
(
authR
(
prodUR
(
optionUR
(
exclR
natC
))
(
gset_disjUR
nat
))).
...
...
@@ -170,6 +168,7 @@ Section proof.
End
proof
.
Typeclasses
Opaque
is_lock
issued
locked
.
Global
Opaque
newlock
acquire
release
wait_loop
.
Definition
ticket_lock
`
{!
heapG
Σ
,
!
tlockG
Σ
}
:
lock
Σ
:
=
{|
lock
.
locked_exclusive
:
=
locked_exclusive
;
lock
.
newlock_spec
:
=
newlock_spec
;
...
...
tests/barrier_client.v
View file @
f8e2c74c
...
...
@@ -11,7 +11,6 @@ Definition client : expr :=
let
:
"b"
:
=
newbarrier
#()
in
(
"y"
<-
(
λ
:
"z"
,
"z"
+
#
42
)
;;
signal
"b"
)
|||
(
worker
12
"b"
"y"
|||
worker
17
"b"
"y"
).
Global
Opaque
worker
client
.
Section
client
.
Context
`
{!
heapG
Σ
,
!
barrierG
Σ
,
!
spawnG
Σ
}
(
N
:
namespace
).
...
...
@@ -55,6 +54,8 @@ Section client.
Qed
.
End
client
.
Global
Opaque
worker
client
.
Section
ClosedProofs
.
Let
Σ
:
gFunctors
:
=
#[
heap
Σ
;
barrier
Σ
;
spawn
Σ
].
...
...
tests/counter.v
View file @
f8e2c74c
...
...
@@ -16,7 +16,6 @@ Definition incr : val :=
let
:
"n"
:
=
!
"l"
in
if
:
CAS
"l"
"n"
(#
1
+
"n"
)
then
#()
else
"incr"
"l"
.
Definition
read
:
val
:
=
λ
:
"l"
,
!
"l"
.
Global
Opaque
newcounter
incr
read
.
(** The CMRA we need. *)
Inductive
M
:
=
Auth
:
nat
→
M
|
Frag
:
nat
→
M
|
Bot
.
...
...
@@ -137,3 +136,5 @@ Proof.
iModIntro
;
rewrite
/
C
;
eauto
10
with
omega
.
Qed
.
End
proof
.
Global
Opaque
newcounter
incr
read
.
tests/joining_existentials.v
View file @
f8e2c74c
...
...
@@ -21,7 +21,6 @@ Proof. apply subG_inG. Qed.
Definition
client
eM
eW1
eW2
:
expr
:
=
let
:
"b"
:
=
newbarrier
#()
in
(
eM
;;
signal
"b"
)
|||
((
wait
"b"
;;
eW1
)
|||
(
wait
"b"
;;
eW2
)).
Global
Opaque
client
.
Section
proof
.
Context
`
{!
heapG
Σ
,
!
barrierG
Σ
,
!
spawnG
Σ
,
!
oneShotG
Σ
F
}.
...
...
@@ -98,3 +97,5 @@ Proof.
-
iIntros
(
_
v
)
"[_ H]"
.
iDestruct
(
Q_res_join
with
"H"
)
as
"?"
.
auto
.
Qed
.
End
proof
.
Global
Opaque
client
.
tests/one_shot.v
View file @
f8e2c74c
...
...
@@ -18,7 +18,6 @@ Definition one_shot_example : val := λ: <>,
|
SOME
"m"
=>
assert
:
"n"
=
"m"
end
end
)).
Global
Opaque
one_shot_example
.
Definition
one_shotR
:
=
csumR
(
exclR
unitC
)
(
dec_agreeR
Z
).
Definition
Pending
:
one_shotR
:
=
(
Cinl
(
Excl
())
:
one_shotR
).
...
...
@@ -97,3 +96,5 @@ Proof.
iApply
(
wp_wand
with
"Hf2"
).
by
iIntros
(
v
)
"#? !# _"
.
Qed
.
End
proof
.
Global
Opaque
one_shot_example
.
tests/tree_sum.v
View file @
f8e2c74c
...
...
@@ -33,8 +33,6 @@ Definition sum' : val := λ: "t",
sum_loop
"t"
"l"
;;
!
"l"
.
Global
Opaque
sum_loop
sum'
.
Lemma
sum_loop_wp
`
{!
heapG
Σ
}
v
t
l
(
n
:
Z
)
(
Φ
:
val
→
iProp
Σ
)
:
heap_ctx
∗
l
↦
#
n
∗
is_tree
v
t
∗
(
l
↦
#(
sum
t
+
n
)
-
∗
is_tree
v
t
-
∗
Φ
#())
...
...
@@ -66,3 +64,6 @@ Proof.
rewrite
Z
.
add_0_r
.
iIntros
"Hl Ht"
.
wp_seq
.
wp_load
.
by
iApply
"HΦ"
.
Qed
.
Global
Opaque
sum_loop
sum'
.
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