Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tej Chajed
iris
Commits
2a806d70
Commit
2a806d70
authored
Oct 31, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently state equalities in pure lifting lemmas with "post-state" on the LHS.
parent
ba89c977
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
19 deletions
+19
-19
theories/program_logic/ectx_language.v
theories/program_logic/ectx_language.v
+1
-1
theories/program_logic/ectx_lifting.v
theories/program_logic/ectx_lifting.v
+2
-2
theories/program_logic/language.v
theories/program_logic/language.v
+1
-1
theories/program_logic/lifting.v
theories/program_logic/lifting.v
+2
-2
theories/program_logic/ownp.v
theories/program_logic/ownp.v
+9
-9
theories/program_logic/total_ectx_lifting.v
theories/program_logic/total_ectx_lifting.v
+2
-2
theories/program_logic/total_lifting.v
theories/program_logic/total_lifting.v
+2
-2
No files found.
theories/program_logic/ectx_language.v
View file @
2a806d70
...
...
@@ -217,7 +217,7 @@ Section ectx_language.
Record
pure_head_step
(
e1
e2
:
expr
Λ
)
:
=
{
pure_head_step_safe
σ
1
:
head_reducible_no_obs
e1
σ
1
;
pure_head_step_det
σ
1
κ
e2'
σ
2
efs
:
head_step
e1
σ
1
κ
e2'
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs
=
[]
head_step
e1
σ
1
κ
e2'
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs
=
[]
}.
Lemma
pure_head_step_pure_step
e1
e2
:
pure_head_step
e1
e2
→
pure_step
e1
e2
.
...
...
theories/program_logic/ectx_lifting.v
View file @
2a806d70
...
...
@@ -130,7 +130,7 @@ Lemma wp_lift_pure_det_head_step_no_fork {s E E' Φ} e1 e2 :
to_val
e1
=
None
→
(
∀
σ
1
,
head_reducible
e1
σ
1
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
(|={
E
,
E'
}
▷
=>
WP
e2
@
s
;
E
{{
Φ
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
using
Hinh
.
intros
.
rewrite
-(
wp_lift_pure_det_step_no_fork
e1
e2
)
;
eauto
.
...
...
@@ -141,7 +141,7 @@ Lemma wp_lift_pure_det_head_step_no_fork' {s E Φ} e1 e2 :
to_val
e1
=
None
→
(
∀
σ
1
,
head_reducible
e1
σ
1
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
▷
WP
e2
@
s
;
E
{{
Φ
}}
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
using
Hinh
.
intros
.
rewrite
-[(
WP
e1
@
s
;
_
{{
_
}})%
I
]
wp_lift_pure_det_head_step_no_fork
//.
...
...
theories/program_logic/language.v
View file @
2a806d70
...
...
@@ -177,7 +177,7 @@ Section language.
Record
pure_step
(
e1
e2
:
expr
Λ
)
:
=
{
pure_step_safe
σ
1
:
reducible_no_obs
e1
σ
1
;
pure_step_det
σ
1
κ
e2'
σ
2
efs
:
prim_step
e1
σ
1
κ
e2'
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs
=
[]
prim_step
e1
σ
1
κ
e2'
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs
=
[]
}.
(* TODO: Exclude the case of [n=0], either here, or in [wp_pure] to avoid it
...
...
theories/program_logic/lifting.v
View file @
2a806d70
...
...
@@ -55,7 +55,7 @@ Qed.
Lemma
wp_lift_pure_step_no_fork
`
{
Inhabited
(
state
Λ
)}
s
E
E'
Φ
e1
:
(
∀
σ
1
,
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
κ
σ
1 e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
∧
efs
=
[])
→
(
∀
κ
σ
1 e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
∧
efs
=
[])
→
(|={
E
,
E'
}
▷
=>
∀
κ
e2
efs
σ
,
⌜
prim_step
e1
σ
κ
e2
σ
efs
⌝
→
WP
e2
@
s
;
E
{{
Φ
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
.
...
...
@@ -123,7 +123,7 @@ Qed.
Lemma
wp_lift_pure_det_step_no_fork
`
{
Inhabited
(
state
Λ
)}
{
s
E
E'
Φ
}
e1
e2
:
(
∀
σ
1
,
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
prim_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
(|={
E
,
E'
}
▷
=>
WP
e2
@
s
;
E
{{
Φ
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
.
iIntros
(?
Hpuredet
)
"H"
.
iApply
(
wp_lift_pure_step_no_fork
s
E
E'
)
;
try
done
.
...
...
theories/program_logic/ownp.v
View file @
2a806d70
...
...
@@ -132,7 +132,7 @@ Section lifting.
Lemma
ownP_lift_pure_step
`
{
Inhabited
(
state
Λ
)}
s
E
Φ
e1
:
(
∀
σ
1
,
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
)
→
(
▷
∀
κ
e2
efs
σ
,
⌜
prim_step
e1
σ
κ
e2
σ
efs
⌝
→
WP
e2
@
s
;
E
{{
Φ
}}
∗
[
∗
list
]
ef
∈
efs
,
WP
ef
@
s
;
⊤
{{
_
,
True
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
...
...
@@ -167,21 +167,21 @@ Section lifting.
Lemma
ownP_lift_atomic_det_step
{
s
E
Φ
e1
}
σ
1
v2
σ
2
efs
:
(
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
κ
'
e2'
σ
2
'
efs'
,
prim_step
e1
σ
1
κ
'
e2'
σ
2
'
efs'
→
σ
2
=
σ
2
'
∧
to_val
e2'
=
Some
v2
∧
efs
=
efs
'
)
→
σ
2
'
=
σ
2
∧
to_val
e2'
=
Some
v2
∧
efs
'
=
efs
)
→
▷
(
ownP
σ
1
)
∗
▷
(
ownP
σ
2
-
∗
Φ
v2
∗
[
∗
list
]
ef
∈
efs
,
WP
ef
@
s
;
⊤
{{
_
,
True
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
.
iIntros
(?
Hdet
)
"[Hσ1 Hσ2]"
;
iApply
ownP_lift_atomic_step
;
try
done
.
iFrame
;
iNext
;
iIntros
(
κ
'
e2'
σ
2
'
efs'
?)
"Hσ2'"
.
edestruct
(
Hdet
κ
'
)
as
(-
>
&
Hval
&-
>
)
;
first
done
.
rewrite
Hval
.
edestruct
(
Hdet
κ
'
)
as
(
<
-&
Hval
&
<
-)
;
first
done
.
rewrite
Hval
.
iApply
(
"Hσ2"
with
"Hσ2'"
).
Qed
.
Lemma
ownP_lift_atomic_det_step_no_fork
{
s
E
e1
}
σ
1
v2
σ
2
:
(
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
κ
'
e2'
σ
2
'
efs'
,
prim_step
e1
σ
1
κ
'
e2'
σ
2
'
efs'
→
σ
2
=
σ
2
'
∧
to_val
e2'
=
Some
v2
∧
[]
=
efs'
)
→
σ
2
'
=
σ
2
∧
to_val
e2'
=
Some
v2
∧
efs'
=
[]
)
→
{{{
▷
(
ownP
σ
1
)
}}}
e1
@
s
;
E
{{{
RET
v2
;
ownP
σ
2
}}}.
Proof
.
intros
.
rewrite
-(
ownP_lift_atomic_det_step
σ
1
v2
σ
2
[])
;
[|
done
..].
...
...
@@ -191,7 +191,7 @@ Section lifting.
Lemma
ownP_lift_pure_det_step_no_fork
`
{
Inhabited
(
state
Λ
)}
{
s
E
Φ
}
e1
e2
:
(
∀
σ
1
,
if
s
is
NotStuck
then
reducible
e1
σ
1
else
to_val
e1
=
None
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
prim_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
prim_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
▷
WP
e2
@
s
;
E
{{
Φ
}}
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
.
intros
.
rewrite
-(
wp_lift_pure_det_step_no_fork
e1
e2
)
//
;
eauto
.
...
...
@@ -233,7 +233,7 @@ Section ectx_lifting.
Lemma
ownP_lift_pure_head_step
s
E
Φ
e1
:
(
∀
σ
1
,
head_reducible
e1
σ
1
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
head_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
head_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
)
→
(
▷
∀
κ
e2
efs
σ
,
⌜
head_step
e1
σ
κ
e2
σ
efs
⌝
→
WP
e2
@
s
;
E
{{
Φ
}}
∗
[
∗
list
]
ef
∈
efs
,
WP
ef
@
s
;
⊤
{{
_
,
True
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
...
...
@@ -259,7 +259,7 @@ Section ectx_lifting.
Lemma
ownP_lift_atomic_det_head_step
{
s
E
Φ
e1
}
σ
1
v2
σ
2
efs
:
head_reducible
e1
σ
1
→
(
∀
κ
'
e2'
σ
2
'
efs'
,
head_step
e1
σ
1
κ
'
e2'
σ
2
'
efs'
→
σ
2
=
σ
2
'
∧
to_val
e2'
=
Some
v2
∧
efs
=
efs
'
)
→
σ
2
'
=
σ
2
∧
to_val
e2'
=
Some
v2
∧
efs
'
=
efs
)
→
▷
(
ownP
σ
1
)
∗
▷
(
ownP
σ
2
-
∗
Φ
v2
∗
[
∗
list
]
ef
∈
efs
,
WP
ef
@
s
;
⊤
{{
_
,
True
}})
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
...
...
@@ -272,7 +272,7 @@ Section ectx_lifting.
Lemma
ownP_lift_atomic_det_head_step_no_fork
{
s
E
e1
}
σ
1
κ
v2
σ
2
:
head_reducible
e1
σ
1
→
(
∀
κ
'
e2'
σ
2
'
efs'
,
head_step
e1
σ
1
κ
'
e2'
σ
2
'
efs'
→
κ
=
κ
'
∧
σ
2
=
σ
2
'
∧
to_val
e2'
=
Some
v2
∧
[]
=
efs'
)
→
κ
'
=
κ
∧
σ
2
'
=
σ
2
∧
to_val
e2'
=
Some
v2
∧
efs'
=
[]
)
→
{{{
▷
(
ownP
σ
1
)
}}}
e1
@
s
;
E
{{{
RET
v2
;
ownP
σ
2
}}}.
Proof
.
intros
???
;
apply
ownP_lift_atomic_det_step_no_fork
;
last
naive_solver
.
...
...
@@ -281,7 +281,7 @@ Section ectx_lifting.
Lemma
ownP_lift_pure_det_head_step_no_fork
{
s
E
Φ
}
e1
e2
:
(
∀
σ
1
,
head_reducible
e1
σ
1
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
▷
WP
e2
@
s
;
E
{{
Φ
}}
⊢
WP
e1
@
s
;
E
{{
Φ
}}.
Proof
using
Hinh
.
iIntros
(??)
"H"
;
iApply
wp_lift_pure_det_step_no_fork
;
try
by
eauto
.
...
...
theories/program_logic/total_ectx_lifting.v
View file @
2a806d70
...
...
@@ -33,7 +33,7 @@ Qed.
Lemma
twp_lift_pure_head_step_no_fork
{
s
E
Φ
}
e1
:
(
∀
σ
1
,
head_reducible_no_obs
e1
σ
1
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
head_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
∧
efs
=
[])
→
(
∀
σ
1
κ
e2
σ
2
efs
,
head_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
∧
efs
=
[])
→
(|={
E
}=>
∀
κ
e2
efs
σ
,
⌜
head_step
e1
σ
κ
e2
σ
efs
⌝
→
WP
e2
@
s
;
E
[{
Φ
}]
)
⊢
WP
e1
@
s
;
E
[{
Φ
}].
Proof
using
Hinh
.
...
...
@@ -75,7 +75,7 @@ Lemma twp_lift_pure_det_head_step_no_fork {s E Φ} e1 e2 :
to_val
e1
=
None
→
(
∀
σ
1
,
head_reducible_no_obs
e1
σ
1
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
head_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
WP
e2
@
s
;
E
[{
Φ
}]
⊢
WP
e1
@
s
;
E
[{
Φ
}].
Proof
using
Hinh
.
intros
.
rewrite
-(
twp_lift_pure_det_step_no_fork
e1
e2
)
;
eauto
.
...
...
theories/program_logic/total_lifting.v
View file @
2a806d70
...
...
@@ -28,7 +28,7 @@ Proof. by rewrite twp_unfold /twp_pre=> ->. Qed.
(** Derived lifting lemmas. *)
Lemma
twp_lift_pure_step_no_fork
`
{
Inhabited
(
state
Λ
)}
s
E
Φ
e1
:
(
∀
σ
1
,
reducible_no_obs
e1
σ
1
)
→
(
∀
σ
1
κ
e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
1
=
σ
2
∧
efs
=
[])
→
(
∀
σ
1
κ
e2
σ
2
efs
,
prim_step
e1
σ
1
κ
e2
σ
2
efs
→
κ
=
[]
∧
σ
2
=
σ
1
∧
efs
=
[])
→
(|={
E
}=>
∀
κ
e2
efs
σ
,
⌜
prim_step
e1
σ
κ
e2
σ
efs
⌝
→
WP
e2
@
s
;
E
[{
Φ
}])
⊢
WP
e1
@
s
;
E
[{
Φ
}].
Proof
.
...
...
@@ -68,7 +68,7 @@ Qed.
Lemma
twp_lift_pure_det_step_no_fork
`
{
Inhabited
(
state
Λ
)}
{
s
E
Φ
}
e1
e2
:
(
∀
σ
1
,
reducible_no_obs
e1
σ
1
)
→
(
∀
σ
1
κ
e2'
σ
2
efs'
,
prim_step
e1
σ
1
κ
e2'
σ
2
efs'
→
κ
=
[]
∧
σ
1
=
σ
2
∧
e2
=
e2
'
∧
efs'
=
[])
→
κ
=
[]
∧
σ
2
=
σ
1
∧
e2
'
=
e2
∧
efs'
=
[])
→
(|={
E
}=>
WP
e2
@
s
;
E
[{
Φ
}])
⊢
WP
e1
@
s
;
E
[{
Φ
}].
Proof
.
iIntros
(?
Hpuredet
)
">H"
.
iApply
(
twp_lift_pure_step_no_fork
s
E
)
;
try
done
.
...
...
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