Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Janno
iris-atomic
Commits
ba66f8bd
Commit
ba66f8bd
authored
Jul 10, 2017
by
Janno
Browse files
Introduce Logically-atomic WP with rec. atomic shift.
parent
d8a0d882
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/atomic.v
View file @
ba66f8bd
...
...
@@ -8,16 +8,45 @@ Import uPred.
Section
atomic
.
Context
`
{
irisG
Λ
Σ
}
{
A
:
Type
}
.
Notation
atomic_shift
'_
type
Σ
:=
(
coPset
-
c
>
coPset
-
c
>
(
A
→
iProp
Σ
)
-
c
>
(
A
→
val
Λ
→
iProp
Σ
)
-
c
>
(
val
_
→
iProp
Σ
)
-
c
>
iProp
Σ
).
Definition
atomic_shift
'_
pre
(
F
:
atomic_shift
'_
type
Σ
)
:
atomic_shift
'_
type
Σ
:=
λ
Eo
Ei
α
β
Φ
,
(
|={
Eo
,
Ei
}=>
∃
x
:
A
,
α
x
∗
((
α
x
={
Ei
,
Eo
}=
∗
▷
F
Eo
Ei
α
β
Φ
)
∧
∀
y
,
β
x
y
={
Ei
,
Eo
}=
∗
Φ
y
))
%
I
.
Instance
atomic_shift
'_
pre_contractive
:
Contractive
(
@
atomic_shift
'_
pre
).
Proof
.
repeat
intros
?
.
rewrite
/
atomic_shift
'_
pre
.
repeat
apply
(
_
:
Proper
(
dist
n
==>
dist
n
)
_
).
apply:
uPred
.
exist_ne
=>
?
.
repeat
apply
(
_
:
Proper
(
dist
n
==>
dist
n
)
_
).
repeat
apply
(
_
:
Proper
(
dist
n
==>
dist
n
==>
dist
n
)
_
)
=>
//.
repeat
apply
(
_
:
Proper
(
_
==>
dist
n
)
_
).
case:
n
H
=>
[
//|? /(_ _ _ _ _ _) //=].
Qed
.
Definition
atomic_shift
:=
fixpoint
(
@
atomic_shift
'_
pre
).
(
*
Definition
atomic_shift
'_
aux
:=
{|
unseal
:=
(
@
atomic_shift
'_
def
);
seal_eq
:=
eq_refl
|}
.
*
)
(
*
Definition
atomic_shift
'
:=
unseal
(
@
atomic_shift
'_
aux
).
*
)
Lemma
atomic_shift_unfold
Eo
Ei
α
β
Φ
:
@
atomic_shift
Eo
Ei
α
β
Φ
≡
(
|={
Eo
,
Ei
}=>
∃
x
:
A
,
α
x
∗
((
α
x
={
Ei
,
Eo
}=
∗
▷
atomic_shift
Eo
Ei
α
β
Φ
)
∧
∀
y
,
β
x
y
={
Ei
,
Eo
}=
∗
Φ
y
))
%
I
.
Proof
.
by
rewrite
{
1
}/
atomic_shift
(
fixpoint_unfold
atomic_shift
'_
pre
_
_
_
_
_
).
Qed
.
(
*
TODO
RJ
:
IMHO
it
would
make
more
sense
to
have
the
outer
mask
first
,
after
all
,
that
'
s
what
the
shifts
"starts"
with
.
*
)
(
*
logically
atomic
triple
:
<
x
,
α
>
e
@
E_i
,
E_o
<
v
,
β
x
v
>
*
)
Definition
atomic_
triple
(
*
logically
atomic
wp
:
<
x
,
α
>
e
@
E_i
,
E_o
<
v
,
β
x
v
>
*
)
Definition
atomic_
wp
(
α
:
A
→
iProp
Σ
)
(
*
atomic
pre
-
condition
*
)
(
β
:
A
→
val
_
→
iProp
Σ
)
(
*
atomic
post
-
condition
*
)
(
Ei
Eo
:
coPset
)
(
*
inside
/
outside
masks
*
)
(
e
:
expr
_
)
:
iProp
Σ
:=
(
∀
P
Q
,
(
P
={
Eo
,
Ei
}=>
∃
x
:
A
,
α
x
∗
((
α
x
={
Ei
,
Eo
}=
∗
P
)
∧
(
∀
v
,
β
x
v
={
Ei
,
Eo
}=
∗
Q
v
))
)
-
∗
{{
P
}}
e
@
⊤
{{
Q
}}
)
%
I
.
(
∀
Φ
,
atomic_shift
Eo
Ei
α
β
Φ
-
∗
WP
e
@
Eo
{{
Φ
}}
)
%
I
.
End
atomic
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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