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
6606345b
Commit
6606345b
authored
Feb 22, 2019
by
Ralf Jung
Browse files
fix previous commit
parent
650de4e4
Pipeline
#15060
passed with stage
in 11 minutes and 38 seconds
Changes
3
Pipelines
7
Hide whitespace changes
Inline
Side-by-side
opam
View file @
6606345b
...
...
@@ -9,6 +9,6 @@ build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-rf" "%{lib}%/coq/user-contrib/iris_examples"]
depends: [
"coq-iris" { (= "dev.2019-02-22.
0.0c5f29db
") | (= "dev") }
"coq-iris" { (= "dev.2019-02-22.
1.9c04e2b4
") | (= "dev") }
"coq-autosubst" { = "dev.coq86" }
]
theories/hocap/cg_bag.v
View file @
6606345b
...
...
@@ -52,7 +52,7 @@ Section proof.
Fixpoint
bag_of_val
(
ls
:
val
)
:
gmultiset
val
:
=
match
ls
with
|
NONEV
=>
∅
|
SOMEV
(
v1
,
t
)
=>
{[
v1
]}
∪
bag_of_val
t
|
SOMEV
(
v1
,
t
)
=>
{[
v1
]}
⊎
bag_of_val
t
|
_
=>
∅
end
.
Fixpoint
val_of_list
(
ls
:
list
val
)
:
val
:
=
...
...
@@ -62,7 +62,7 @@ Section proof.
end
.
Definition
bag_inv
(
γ
b
:
gname
)
(
b
:
loc
)
:
iProp
Σ
:
=
(
∃
ls
:
list
val
,
b
↦
(
val_of_list
ls
)
∗
own
γ
b
((
1
/
2
)%
Qp
,
to_agree
(
list_to_set
ls
)))%
I
.
(
∃
ls
:
list
val
,
b
↦
(
val_of_list
ls
)
∗
own
γ
b
((
1
/
2
)%
Qp
,
to_agree
(
list_to_set
_disj
ls
)))%
I
.
Definition
is_bag
(
γ
b
:
gname
)
(
x
:
val
)
:
=
(
∃
(
lk
:
val
)
(
b
:
loc
)
(
γ
:
gname
),
...
...
@@ -116,7 +116,7 @@ Section proof.
Local
Opaque
acquire
release
.
(* so that wp_pure doesn't stumble *)
Lemma
pushBag_spec
(
P
Q
:
iProp
Σ
)
γ
(
x
v
:
val
)
:
□
(
∀
(
X
:
gmultiset
val
),
bag_contents
γ
X
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
({[
v
]}
∪
X
)
∗
Q
))
-
∗
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
({[
v
]}
⊎
X
)
∗
Q
))
-
∗
{{{
is_bag
γ
x
∗
P
}}}
pushBag
x
(
of_val
v
)
{{{
RET
#()
;
Q
}}}.
...
...
@@ -141,7 +141,7 @@ Section proof.
Lemma
popBag_spec
(
P
:
iProp
Σ
)
(
Q
:
val
→
iProp
Σ
)
γ
x
:
□
(
∀
(
X
:
gmultiset
val
)
(
y
:
val
),
bag_contents
γ
({[
y
]}
∪
X
)
∗
P
bag_contents
γ
({[
y
]}
⊎
X
)
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
X
∗
Q
(
SOMEV
y
)))
-
∗
□
(
bag_contents
γ
∅
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
∅
∗
Q
NONEV
))
-
∗
{{{
is_bag
γ
x
∗
P
}}}
...
...
theories/hocap/fg_bag.v
View file @
6606345b
...
...
@@ -87,11 +87,11 @@ Section proof.
iDestruct
(
mapsto_agree
l'
q
q'
(
PairV
x
tl
)
(
PairV
y
tl'
)
with
"Hro Hro'"
)
as
%?.
simplify_eq
/=.
iDestruct
(
"IH"
with
"Hls Hls'"
)
as
%->.
done
.
Qed
.
Qed
.
Definition
bag_inv
(
γ
b
:
gname
)
(
b
:
loc
)
:
iProp
Σ
:
=
(
∃
(
hd
:
val
)
(
ls
:
list
val
),
b
↦
hd
∗
is_list
hd
ls
∗
own
γ
b
((
1
/
2
)%
Qp
,
to_agree
(
list_to_set
ls
)))%
I
.
b
↦
hd
∗
is_list
hd
ls
∗
own
γ
b
((
1
/
2
)%
Qp
,
to_agree
(
list_to_set
_disj
ls
)))%
I
.
Definition
is_bag
(
γ
b
:
gname
)
(
x
:
val
)
:
=
(
∃
(
b
:
loc
),
⌜
x
=
#
b
⌝
∗
inv
N
(
bag_inv
γ
b
b
))%
I
.
Definition
bag_contents
(
γ
b
:
gname
)
(
X
:
gmultiset
val
)
:
iProp
Σ
:
=
...
...
@@ -142,7 +142,7 @@ Section proof.
Lemma
pushBag_spec
(
P
Q
:
iProp
Σ
)
γ
(
x
v
:
val
)
:
□
(
∀
(
X
:
gmultiset
val
),
bag_contents
γ
X
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
({[
v
]}
∪
X
)
∗
Q
))
-
∗
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
({[
v
]}
⊎
X
)
∗
Q
))
-
∗
{{{
is_bag
γ
x
∗
P
}}}
pushBag
x
(
of_val
v
)
{{{
RET
#()
;
Q
}}}.
...
...
@@ -179,7 +179,7 @@ Section proof.
Lemma
popBag_spec
(
P
:
iProp
Σ
)
(
Q
:
val
→
iProp
Σ
)
γ
x
:
□
(
∀
(
X
:
gmultiset
val
)
(
y
:
val
),
bag_contents
γ
({[
y
]}
∪
X
)
∗
P
bag_contents
γ
({[
y
]}
⊎
X
)
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
X
∗
Q
(
SOMEV
y
)))
-
∗
□
(
bag_contents
γ
∅
∗
P
={
⊤
∖↑
N
}=
∗
▷
(
bag_contents
γ
∅
∗
Q
NONEV
))
-
∗
{{{
is_bag
γ
x
∗
P
}}}
...
...
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