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
Jonas Kastberg
iris
Commits
42dfffc9
Commit
42dfffc9
authored
Oct 29, 2017
by
Ralf Jung
Browse files
add a strong form of atomicity, for weak forms of weakest-pre
parent
180cd032
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/program_logic/language.v
View file @
42dfffc9
...
...
@@ -52,9 +52,15 @@ Section language.
Definition
irreducible
(
e
:
expr
Λ
)
(
σ
:
state
Λ
)
:
=
∀
e'
σ
'
efs
,
¬
prim_step
e
σ
e'
σ
'
efs
.
(* This (weak) form of atomicity is enough to open invariants when WP is safe,
i.e., programs never can get stuck. *)
Definition
atomic
(
e
:
expr
Λ
)
:
Prop
:
=
∀
σ
e'
σ
'
efs
,
prim_step
e
σ
e'
σ
'
efs
→
irreducible
e'
σ
'
.
(* To open invariants with unsafe WP, we need a stronger form of atomicity. *)
Definition
strongly_atomic
(
e
:
expr
Λ
)
:
Prop
:
=
∀
σ
e'
σ
'
efs
,
prim_step
e
σ
e'
σ
'
efs
→
is_Some
(
to_val
e'
).
Inductive
step
(
ρ
1
ρ
2
:
cfg
Λ
)
:
Prop
:
=
|
step_atomic
e1
σ
1 e2
σ
2
efs
t1
t2
:
ρ
1
=
(
t1
++
e1
::
t2
,
σ
1
)
→
...
...
@@ -74,6 +80,10 @@ Section language.
Global
Instance
of_val_inj
:
Inj
(=)
(=)
(@
of_val
Λ
).
Proof
.
by
intros
v
v'
Hv
;
apply
(
inj
Some
)
;
rewrite
-!
to_of_val
Hv
.
Qed
.
Lemma
strongly_atomic_atomic
e
:
strongly_atomic
e
→
atomic
e
.
Proof
.
unfold
strongly_atomic
,
atomic
.
eauto
using
val_irreducible
.
Qed
.
Lemma
reducible_fill
`
{
LanguageCtx
Λ
K
}
e
σ
:
to_val
e
=
None
→
reducible
(
K
e
)
σ
→
reducible
e
σ
.
Proof
.
...
...
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