Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
Model registry
Operate
Environments
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
Michael Sammler
iris-coq
Commits
6cd681c3
Commit
6cd681c3
authored
5 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove that we can open invariants around wp_atomic
parent
1f83451a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#20433
failed
5 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/program_logic/atomic.v
+31
-1
31 additions, 1 deletion
theories/program_logic/atomic.v
with
31 additions
and
1 deletion
theories/program_logic/atomic.v
+
31
−
1
View file @
6cd681c3
...
...
@@ -3,6 +3,7 @@ From iris.bi Require Import telescopes.
From
iris
.
bi
.
lib
Require
Export
atomic
.
From
iris
.
proofmode
Require
Import
tactics
classes
.
From
iris
.
program_logic
Require
Export
weakestpre
.
From
iris
.
base_logic
Require
Import
invariants
.
Set
Default
Proof
Using
"Type"
.
(* This hard-codes the inner mask to be empty, because we have yet to find an
...
...
@@ -98,6 +99,7 @@ Section lemmas.
Notation
iProp
:=
(
iProp
Σ
)
.
Implicit
Types
(
α
:
TA
→
iProp
)
(
β
:
TA
→
TB
→
iProp
)
(
f
:
TA
→
TB
→
val
Λ
)
.
(* Atomic triples imply sequential triples if the precondition is laterable. *)
Lemma
atomic_wp_seq
e
Eo
α
β
f
{
HL
:
∀
.
.
x
,
Laterable
(
α
x
)}
:
atomic_wp
e
Eo
α
β
f
-∗
∀
Φ
,
∀
.
.
x
,
α
x
-∗
(
∀
.
.
y
,
β
x
y
-∗
Φ
(
f
x
y
))
-∗
WP
e
{{
Φ
}}
.
...
...
@@ -109,9 +111,20 @@ Section lemmas.
rewrite
->!
tele_app_bind
.
iIntros
"HΦ"
.
iApply
"HΦ"
.
done
.
Qed
.
(* Sequential triples with the empty mask for a physically atomic [e] are atomic. *)
Lemma
atomic_seq_wp_atomic
e
Eo
α
β
f
`{
!
Atomic
WeaklyAtomic
e
}
:
(
∀
Φ
,
∀
.
.
x
,
α
x
-∗
(
∀
.
.
y
,
β
x
y
-∗
Φ
(
f
x
y
))
-∗
WP
e
@
∅
{{
Φ
}})
-∗
atomic_wp
e
Eo
α
β
f
.
Proof
.
iIntros
"Hwp"
(
Φ
)
"AU"
.
iMod
"AU"
as
(
x
)
"[Hα [_ Hclose]]"
.
iApply
(
"Hwp"
with
"Hα"
)
.
iIntros
(
y
)
"Hβ"
.
iMod
(
"Hclose"
with
"Hβ"
)
as
"HΦ"
.
rewrite
->!
tele_app_bind
.
iApply
"HΦ"
.
Qed
.
(* Sequential triples with a persistent precondition and no initial quantifier
are atomic. *)
Lemma
seq_wp_atomic
e
Eo
(
α
:
[
tele
]
→
iProp
)
(
β
:
[
tele
]
→
TB
→
iProp
)
Lemma
persistent_
seq_wp_atomic
e
Eo
(
α
:
[
tele
]
→
iProp
)
(
β
:
[
tele
]
→
TB
→
iProp
)
(
f
:
[
tele
]
→
TB
→
val
Λ
)
{
HP
:
Persistent
(
α
[
tele_arg
])}
:
(
∀
Φ
,
α
[
tele_arg
]
-∗
(
∀
.
.
y
,
β
[
tele_arg
]
y
-∗
Φ
(
f
[
tele_arg
]
y
))
-∗
WP
e
{{
Φ
}})
-∗
atomic_wp
e
Eo
α
β
f
.
...
...
@@ -124,4 +137,21 @@ Section lemmas.
rewrite
->!
tele_app_bind
.
done
.
Qed
.
(* We can open invariants around atomic triples.
(Just for demonstration purposes; we always use [iInv] in proofs.) *)
Lemma
wp_atomic_inv
e
Eo
α
β
f
N
I
:
↑
N
⊆
Eo
→
atomic_wp
e
Eo
(
λ
.
.
x
,
▷
I
∗
α
x
)
(
λ
.
.
x
y
,
▷
I
∗
β
x
y
)
f
-∗
inv
N
I
-∗
atomic_wp
e
(
Eo
∖
↑
N
)
α
β
f
.
Proof
.
intros
?
.
iIntros
"Hwp #Hinv"
(
Φ
)
"AU"
.
iApply
"Hwp"
.
iAuIntro
.
iInv
N
as
"HI"
.
iApply
(
aacc_aupd
with
"AU"
);
first
done
.
iIntros
(
x
)
"Hα"
.
iAaccIntro
with
"[HI Hα]"
;
rewrite
->!
tele_app_bind
;
first
by
iFrame
.
-
(* abort *)
iIntros
"[HI $]"
.
by
eauto
with
iFrame
.
-
(* commit *)
iIntros
(
y
)
.
rewrite
->!
tele_app_bind
.
iIntros
"[HI Hβ]"
.
iRight
.
iExists
y
.
rewrite
->!
tele_app_bind
.
by
eauto
with
iFrame
.
Qed
.
End
lemmas
.
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