Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ike Mulder
examples
Commits
57bc56d4
Commit
57bc56d4
authored
1 year ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
update dependencies
also clean up proof a tiny bit while I am at it
parent
dbda7798
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
coq-iris-examples.opam
+1
-1
1 addition, 1 deletion
coq-iris-examples.opam
theories/logatom/flat_combiner/flat.v
+19
-17
19 additions, 17 deletions
theories/logatom/flat_combiner/flat.v
with
20 additions
and
18 deletions
coq-iris-examples.opam
+
1
−
1
View file @
57bc56d4
...
@@ -8,7 +8,7 @@ dev-repo: "git+https://gitlab.mpi-sws.org/iris/examples.git"
...
@@ -8,7 +8,7 @@ dev-repo: "git+https://gitlab.mpi-sws.org/iris/examples.git"
synopsis: "A collection of case studies for Iris -- not meant to be used as a dependency of anything"
synopsis: "A collection of case studies for Iris -- not meant to be used as a dependency of anything"
depends: [
depends: [
"coq-iris-heap-lang" { (= "dev.2023-08-
04.2.b9e591f8
") | (= "dev") }
"coq-iris-heap-lang" { (= "dev.2023-08-
29.0.cc54c166
") | (= "dev") }
"coq-autosubst" { = "dev" }
"coq-autosubst" { = "dev" }
]
]
...
...
This diff is collapsed.
Click to expand it.
theories/logatom/flat_combiner/flat.v
+
19
−
17
View file @
57bc56d4
...
@@ -10,6 +10,8 @@ From iris.prelude Require Import options.
...
@@ -10,6 +10,8 @@ From iris.prelude Require Import options.
Set
Default
Proof
Using
"Type*"
.
Set
Default
Proof
Using
"Type*"
.
Local
Existing
Instance
spin_lock
.
Definition
doOp
:
val
:=
Definition
doOp
:
val
:=
λ
:
"p"
,
λ
:
"p"
,
match
:
!
"p"
with
match
:
!
"p"
with
...
@@ -19,7 +21,7 @@ Definition doOp : val :=
...
@@ -19,7 +21,7 @@ Definition doOp : val :=
Definition
try_srv
:
val
:=
Definition
try_srv
:
val
:=
λ
:
"lk"
"s"
,
λ
:
"lk"
"s"
,
if
:
try_acquire
"lk"
if
:
spin_lock
.
try_acquire
"lk"
then
let
:
"hd"
:=
!
"s"
in
then
let
:
"hd"
:=
!
"s"
in
treiber
.
iter
"hd"
doOp
;;
treiber
.
iter
"hd"
doOp
;;
release
"lk"
release
"lk"
...
@@ -42,7 +44,7 @@ Definition install : val :=
...
@@ -42,7 +44,7 @@ Definition install : val :=
Definition
mk_flat
:
val
:=
Definition
mk_flat
:
val
:=
λ
:
<>
,
λ
:
<>
,
let
:
"lk"
:=
newlock
#
()
in
let
:
"lk"
:=
spin_lock
.
newlock
#
()
in
let
:
"s"
:=
new_stack
#
()
in
let
:
"s"
:=
new_stack
#
()
in
λ
:
"f"
"x"
,
λ
:
"f"
"x"
,
let
:
"p"
:=
install
"f"
"x"
"s"
in
let
:
"p"
:=
install
"f"
"x"
"s"
in
...
@@ -219,8 +221,8 @@ Section proof.
...
@@ -219,8 +221,8 @@ Section proof.
⊢
WP
try_srv
lk
#
s
{{
Φ
}}
.
⊢
WP
try_srv
lk
#
s
{{
Φ
}}
.
Proof
.
Proof
.
iIntros
"(#? & #? & HΦ)"
.
wp_lam
.
wp_pures
.
iIntros
"(#? & #? & HΦ)"
.
wp_lam
.
wp_pures
.
wp_
bind
(
try_acquire
_)
.
iApply
(
try_acquire_spec
with
"[]"
);
first
done
.
wp_
apply
(
spin_lock
.
try_acquire_spec
with
"[]"
);
first
done
.
iNext
.
iIntros
([]);
last
by
(
iIntros
;
wp_if
)
.
iIntros
([]);
last
by
(
iIntros
;
wp_if
)
.
iIntros
"[Hlocked [Ho2 HR]]"
.
iIntros
"[Hlocked [Ho2 HR]]"
.
wp_if
.
wp_bind
(
!
_)
%
E
.
wp_if
.
wp_bind
(
!
_)
%
E
.
iInv
N
as
"H"
"Hclose"
.
iInv
N
as
"H"
"Hclose"
.
...
@@ -255,7 +257,7 @@ Section proof.
...
@@ -255,7 +257,7 @@ Section proof.
+
iDestruct
"Hp"
as
(
f
x
)
"(>Hp & Hs')"
.
+
iDestruct
"Hp"
as
(
f
x
)
"(>Hp & Hs')"
.
wp_load
.
iMod
(
"Hclose"
with
"[Hp Hs']"
)
.
wp_load
.
iMod
(
"Hclose"
with
"[Hp Hs']"
)
.
{
iNext
.
iFrame
.
iRight
.
iLeft
.
iExists
f
,
x
.
iFrame
.
}
{
iNext
.
iFrame
.
iRight
.
iLeft
.
iExists
f
,
x
.
iFrame
.
}
iModIntro
.
wp_match
.
wp_
bind
(
try_srv
_
_)
.
iA
pply
try_srv_spec
=>
//.
iModIntro
.
wp_match
.
wp_
a
pply
try_srv_spec
=>
//.
iFrame
"#"
.
wp_seq
.
iApply
(
"IH"
with
"Ho3"
);
eauto
.
iFrame
"#"
.
wp_seq
.
iApply
(
"IH"
with
"Ho3"
);
eauto
.
+
iDestruct
"Hp"
as
(
f
x
)
"(Hp & Hx & Ho2 & Ho4)"
.
+
iDestruct
"Hp"
as
(
f
x
)
"(Hp & Hx & Ho2 & Ho4)"
.
wp_load
.
iMod
(
"Hclose"
with
"[-Ho3 HΦ]"
)
as
"_"
.
wp_load
.
iMod
(
"Hclose"
with
"[-Ho3 HΦ]"
)
as
"_"
.
...
@@ -276,23 +278,23 @@ Section proof.
...
@@ -276,23 +278,23 @@ Section proof.
Proof
using
Type
*
N
.
Proof
using
Type
*
N
.
iIntros
(
R
Φ
)
"HR HΦ"
.
iIntros
(
R
Φ
)
"HR HΦ"
.
iMod
(
own_alloc
(
Excl
()))
as
(
γr
)
"Ho2"
;
first
done
.
iMod
(
own_alloc
(
Excl
()))
as
(
γr
)
"Ho2"
;
first
done
.
wp_lam
.
wp_bind
(
newlock
_)
.
wp_lam
.
iA
pply
(
newlock_spec
(
own
γr
(
Excl
())
∗
R
)
%
I
with
"[$Ho2 $HR]"
)=>
//.
wp_a
pply
(
newlock_spec
(
own
γr
(
Excl
())
∗
R
)
%
I
with
"[$Ho2 $HR]"
)=>
//.
iNext
.
iIntros
(
lk
γlk
)
"#Hlk"
.
iIntros
(
lk
γlk
)
"#Hlk"
.
wp_let
.
wp_bind
(
new_stack
_)
.
wp_let
.
iA
pply
(
new_bag_spec
N
(
p_inv'
R
γm
γr
))=>
//.
wp_a
pply
(
new_bag_spec
N
(
p_inv'
R
γm
γr
))=>
//.
iNext
.
iIntros
(
s
)
"#Hss"
.
iIntros
(
s
)
"#Hss"
.
wp_pures
.
iModIntro
.
iApply
"HΦ"
.
wp_pures
.
iModIntro
.
iApply
"HΦ"
.
iModIntro
.
iIntros
(
f
)
.
wp_pures
.
iModIntro
.
iIntros
(
f
)
.
wp_pures
.
iIntros
"!> !>"
(
P
Q
x
)
"#Hf !>"
.
iIntros
"!> !>"
(
P
Q
x
)
"#Hf !>"
.
iIntros
(
Φ'
)
"Hp HΦ'"
.
wp_pures
.
wp_bind
(
install
_
_
_)
.
iIntros
(
Φ'
)
"Hp HΦ'"
.
wp_pures
.
iA
pply
(
install_spec
R
P
Q
f
x
γm
γr
s
with
"[Hp]"
)=>
//.
wp_a
pply
(
install_spec
R
P
Q
f
x
γm
γr
s
with
"[Hp]"
)=>
//.
{
iFrame
.
iFrame
"#"
.
}
{
iFrame
.
iFrame
"#"
.
}
iNext
.
iIntros
(
p
[[[[
γx
γ1
]
γ3
]
γ4
]
γq
])
"[(Ho3 & Hx & HoQ) #?]"
.
iIntros
(
p
[[[[
γx
γ1
]
γ3
]
γ4
]
γq
])
"[(Ho3 & Hx & HoQ) #?]"
.
wp_let
.
wp_bind
(
loop
_
_
_)
.
wp_let
.
iA
pply
(
loop_spec
with
"[-Hx HoQ HΦ']"
)=>
//.
wp_a
pply
(
loop_spec
with
"[-Hx HoQ HΦ']"
)=>
//.
{
iFrame
"#"
.
iFrame
.
}
{
iFrame
"#"
.
iFrame
.
}
iNext
.
iIntros
(
v1
v2
)
"Hs"
.
iIntros
(
v1
v2
)
"Hs"
.
iDestruct
"Hs"
as
(
Q'
)
"(Hx' & HoQ' & HQ')"
.
iDestruct
"Hs"
as
(
Q'
)
"(Hx' & HoQ' & HQ')"
.
destruct
(
decide
(
x
=
v1
))
as
[
->
|
Hneq
]
.
destruct
(
decide
(
x
=
v1
))
as
[
->
|
Hneq
]
.
-
iDestruct
(
saved_pred_agree
_
_
_
_
_
v2
with
"[$HoQ] [HoQ']"
)
as
"Heq"
;
first
by
iFrame
.
-
iDestruct
(
saved_pred_agree
_
_
_
_
_
v2
with
"[$HoQ] [HoQ']"
)
as
"Heq"
;
first
by
iFrame
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment