Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
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
Abhishek Anand
Iris
Commits
020ad55d
Commit
020ad55d
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
atomic shift: quantify over mask to make it easier to apply; prove an ellimination lemma
parent
2850f888
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
theories/bi/lib/atomic.v
+41
-7
41 additions, 7 deletions
theories/bi/lib/atomic.v
theories/program_logic/atomic.v
+4
-2
4 additions, 2 deletions
theories/program_logic/atomic.v
with
45 additions
and
9 deletions
theories/bi/lib/atomic.v
+
41
−
7
View file @
020ad55d
From
iris
.
bi
Require
Export
bi
updates
.
From
iris
.
bi
Require
Export
bi
updates
.
From
stdpp
Require
Import
coPset
.
From
stdpp
Require
Import
coPset
.
From
iris
.
proofmode
Require
Import
classes
class_instance
s
.
From
iris
.
proofmode
Require
Import
tactic
s
.
Set
Default
Proof
Using
"Type"
.
Set
Default
Proof
Using
"Type"
.
Definition
atomic_shift
{
PROP
:
sbi
}
`{
!
FUpd
PROP
}
{
A
B
:
Type
}
Definition
atomic_shift
{
PROP
:
sbi
}
`{
!
FUpd
PROP
}
{
A
B
:
Type
}
(
α
:
A
→
PROP
)
(* atomic pre-condition *)
(
α
:
A
→
PROP
)
(* atomic pre-condition *)
(
β
:
A
→
B
→
PROP
)
(* atomic post-condition *)
(
β
:
A
→
B
→
PROP
)
(* atomic post-condition *)
(
Ei
Eo
:
coPset
)
(* inside/outside masks *)
(
Eo
Em
:
coPset
)
(* outside/module masks *)
(
Q
:
A
→
B
→
PROP
)
(* post-condition *)
(
P
:
PROP
)
(* pre-condition *)
(
Q
:
A
→
B
→
PROP
)
(* post-condition *)
:
PROP
:=
:
PROP
:=
(
∃
(
F
P
:
PROP
),
F
∗
▷
P
∗
□
(
▷
P
=
{
E
o
,
E
i
}
=∗
∃
x
,
α
x
∗
(
□
(
∀
E
,
⌜
Eo
⊆
E
⌝
-∗
▷
P
=
{
E
,
E
∖
Em
}
=∗
∃
x
,
α
x
∗
((
α
x
=
{
E
i
,
E
o
}
=∗
▷
P
)
∧
(
∀
y
,
β
x
y
=
{
E
i
,
E
o
}
=∗
F
-∗
Q
x
y
)))
((
α
x
=
{
E
∖
Em
,
E
}
=∗
▷
P
)
∧
(
∀
y
,
β
x
y
=
{
E
∖
Em
,
E
}
=∗
Q
x
y
)))
)
%
I
.
)
%
I
.
Definition
atomic_update
{
PROP
:
sbi
}
`{
!
FUpd
PROP
}
{
A
B
:
Type
}
(
α
:
A
→
PROP
)
(* atomic pre-condition *)
(
β
:
A
→
B
→
PROP
)
(* atomic post-condition *)
(
Eo
Em
:
coPset
)
(* outside/module masks *)
(
Q
:
A
→
B
→
PROP
)
(* post-condition *)
:
PROP
:=
tc_opaque
(
∃
(
F
P
:
PROP
),
F
∗
▷
P
∗
atomic_shift
α
β
Eo
Em
P
(
λ
x
y
,
F
-∗
Q
x
y
)
)
%
I
.
Section
lemmas
.
Context
{
PROP
:
sbi
}
`{
FUpdFacts
PROP
}
{
A
B
:
Type
}
.
Implicit
Types
(
α
:
A
→
PROP
)
(
β
:
A
→
B
→
PROP
)
(
P
:
PROP
)
(
Q
:
A
→
B
→
PROP
)
.
Lemma
aupd_acc
α
β
Eo
Em
Q
E
:
Eo
⊆
E
→
atomic_update
α
β
Eo
Em
Q
-∗
|
=
{
E
,
E
∖
Em
}=>
∃
x
,
α
x
∗
((
α
x
=
{
E
∖
Em
,
E
}
=∗
atomic_update
α
β
Eo
Em
Q
)
∧
(
∀
y
,
β
x
y
=
{
E
∖
Em
,
E
}
=∗
Q
x
y
))
.
Proof
using
Type
*.
rewrite
{
1
}
/
atomic_update
/=.
iIntros
(
HE
)
"HUpd"
.
iDestruct
"HUpd"
as
(
F
P
)
"(HF & HP & #Hshift)"
.
iMod
(
"Hshift"
with
"[% //] HP"
)
as
(
x
)
"[Hα Hclose]"
.
iModIntro
.
iExists
x
.
iFrame
"Hα"
.
iSplit
.
-
iIntros
"Hα"
.
iDestruct
"Hclose"
as
"[Hclose _]"
.
iMod
(
"Hclose"
with
"Hα"
)
.
iModIntro
.
iExists
F
,
P
.
by
iFrame
.
-
iIntros
(
y
)
"Hβ"
.
iDestruct
"Hclose"
as
"[_ Hclose]"
.
iMod
(
"Hclose"
with
"Hβ"
)
as
"HQ"
.
iModIntro
.
by
iApply
"HQ"
.
Qed
.
End
lemmas
.
This diff is collapsed.
Click to expand it.
theories/program_logic/atomic.v
+
4
−
2
View file @
020ad55d
...
@@ -7,8 +7,10 @@ Definition atomic_wp `{irisG Λ Σ} {A B : Type}
...
@@ -7,8 +7,10 @@ Definition atomic_wp `{irisG Λ Σ} {A B : Type}
(
e
:
expr
Λ
)
(* expression *)
(
e
:
expr
Λ
)
(* expression *)
(
α
:
A
→
iProp
Σ
)
(* atomic pre-condition *)
(
α
:
A
→
iProp
Σ
)
(* atomic pre-condition *)
(
β
:
A
→
B
→
iProp
Σ
)
(* atomic post-condition *)
(
β
:
A
→
B
→
iProp
Σ
)
(* atomic post-condition *)
(
E
i
E
o
:
coPset
)
(*
in
side/
outsid
e masks *)
(
E
o
E
m
:
coPset
)
(*
out
side/
modul
e masks *)
(
f
:
A
→
B
→
val
Λ
)
(* Turn the return data into the return value *)
(
f
:
A
→
B
→
val
Λ
)
(* Turn the return data into the return value *)
:
iProp
Σ
:=
:
iProp
Σ
:=
(
∀
Φ
,
atomic_
shift
α
β
E
i
E
o
(
λ
x
y
,
Φ
(
f
x
y
))
-∗
(
∀
Φ
,
atomic_
update
α
β
E
o
E
m
(
λ
x
y
,
Φ
(
f
x
y
))
-∗
WP
e
{{
Φ
}})
%
I
.
WP
e
{{
Φ
}})
%
I
.
(* Note: To add a private postcondition, use
atomic_shift α β Eo Em (λ x y, POST x y -∗ Φ (f x y)) *)
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