Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
examples
Commits
a1c9f69a
Commit
a1c9f69a
authored
Apr 10, 2018
by
Dan Frumin
Browse files
Update comments
parent
bc082bf8
Changes
4
Hide whitespace changes
Inline
Side-by-side
theories/hocap/abstract_bag.v
View file @
a1c9f69a
...
...
@@ -15,7 +15,7 @@ Structure bag Σ `{!heapG Σ} := Bag {
pushBag
:
val
;
popBag
:
val
;
(* -- predicates -- *)
(* name is used to associate
locked
with is_
lock
*)
(* name is used to associate
bag_contents
with is_
bag
*)
name
:
Type
;
is_bag
(
N
:
namespace
)
(
γ
:
name
)
(
b
:
val
)
:
iProp
Σ
;
bag_contents
(
γ
:
name
)
(
X
:
gmultiset
val
)
:
iProp
Σ
;
...
...
theories/hocap/exclusive_bag.v
View file @
a1c9f69a
...
...
@@ -16,6 +16,7 @@ Section proof.
Variable
b
:
bag
Σ
.
Variable
N
:
namespace
.
(** An exclusive specification keeps track of the exact contents of the bag *)
Definition
bagE
(
γ
:
name
Σ
b
)
(
x
:
val
)
(
X
:
gmultiset
val
)
:
iProp
Σ
:
=
(
is_bag
b
N
γ
x
∗
bag_contents
b
γ
X
)%
I
.
...
...
theories/hocap/fg_bag.v
View file @
a1c9f69a
...
...
@@ -13,7 +13,7 @@ From iris.heap_lang.lib Require Import lock spin_lock.
From
iris_examples
.
hocap
Require
Import
abstract_bag
.
Set
Default
Proof
Using
"Type"
.
(**
Coars
e-grained bag implementation using
a spin lock
*)
(**
Fin
e-grained bag implementation using
CAS
*)
Definition
newBag
:
val
:
=
λ
:
<>,
ref
NONE
.
Definition
pushBag
:
val
:
=
rec
:
"push"
"b"
"v"
:
=
...
...
theories/hocap/shared_bag.v
View file @
a1c9f69a
...
...
@@ -17,7 +17,9 @@ Section proof.
Variable
N
:
namespace
.
Definition
NB
:
=
N
.@
"bag"
.
Definition
NI
:
=
N
.@
"inv"
.
Variable
P
:
val
→
val
→
iProp
Σ
.
(* Predicate that will be satisfied by all the elements in the bag *)
(** Predicate that will be satisfied by all the elements in the bag.
The first argument is the bag itself. *)
Variable
P
:
val
→
val
→
iProp
Σ
.
Definition
bagS_inv
(
γ
:
name
Σ
b
)
(
y
:
val
)
:
iProp
Σ
:
=
inv
NI
(
∃
X
,
bag_contents
b
γ
X
∗
[
∗
mset
]
x
∈
X
,
P
y
x
)%
I
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment