Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Service Desk
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
Iris
lambda-rust
Commits
73722e0e
Commit
73722e0e
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
wp_eq_loc: don't throw away the mapstos
parent
f4cc2bf4
No related branches found
No related tags found
1 merge request
!7
Adding location equality.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/lang/lifting.v
+25
-19
25 additions, 19 deletions
theories/lang/lifting.v
with
25 additions
and
19 deletions
theories/lang/lifting.v
+
25
−
19
View file @
73722e0e
...
@@ -268,9 +268,9 @@ Lemma wp_eq_int E (n1 n2 : Z) P Φ :
...
@@ -268,9 +268,9 @@ Lemma wp_eq_int E (n1 n2 : Z) P Φ :
(
n1
≠
n2
→
P
-∗
▷
Φ
(
LitV
false
))
→
(
n1
≠
n2
→
P
-∗
▷
Φ
(
LitV
false
))
→
P
-∗
WP
BinOp
EqOp
(
Lit
(
LitInt
n1
))
(
Lit
(
LitInt
n2
))
@
E
{{
Φ
}}
.
P
-∗
WP
BinOp
EqOp
(
Lit
(
LitInt
n1
))
(
Lit
(
LitInt
n2
))
@
E
{{
Φ
}}
.
Proof
.
Proof
.
iIntros
(
H
l
Hg
)
"HP"
.
iIntros
(
H
eq
Hne
)
"HP"
.
destruct
(
bool_decide_reflect
(
n1
=
n2
));
[
rewrite
H
l
//|
rewrite
H
g
//
];
destruct
(
bool_decide_reflect
(
n1
=
n2
));
[
rewrite
H
eq
//|
rewrite
H
ne
//
];
clear
H
l
Hg
;
iApply
wp_bin_op_pure
;
subst
.
clear
H
ne
Heq
;
iApply
wp_bin_op_pure
;
subst
.
-
intros
.
apply
BinOpEqTrue
.
constructor
.
-
intros
.
apply
BinOpEqTrue
.
constructor
.
-
iNext
;
iIntros
(??
Heval
)
.
by
inversion_clear
Heval
;
inv_lit
.
-
iNext
;
iIntros
(??
Heval
)
.
by
inversion_clear
Heval
;
inv_lit
.
-
intros
.
apply
BinOpEqFalse
.
by
constructor
.
-
intros
.
apply
BinOpEqFalse
.
by
constructor
.
...
@@ -280,31 +280,37 @@ Qed.
...
@@ -280,31 +280,37 @@ Qed.
Lemma
wp_eq_loc
E
(
l1
:
loc
)
(
l2
:
loc
)
P
Φ
:
Lemma
wp_eq_loc
E
(
l1
:
loc
)
(
l2
:
loc
)
P
Φ
:
(
l1
=
l2
→
P
-∗
▷
Φ
(
LitV
true
))
→
(
l1
=
l2
→
P
-∗
▷
Φ
(
LitV
true
))
→
(
l1
≠
l2
→
P
-∗
▷
Φ
(
LitV
false
))
→
(
l1
≠
l2
→
P
-∗
▷
Φ
(
LitV
false
))
→
(
∃
q1
vl1
q2
vl2
,
l1
↦
{
q1
}
vl1
∧
l2
↦
{
q2
}
vl2
)
%
I
-∗
(
P
-∗
∃
q
v
,
l1
↦
{
q
}
v
)
→
(
P
-∗
∃
q
v
,
l2
↦
{
q
}
v
)
→
P
-∗
WP
BinOp
EqOp
(
Lit
(
LitLoc
l1
))
(
Lit
(
LitLoc
l2
))
@
E
{{
Φ
}}
.
P
-∗
WP
BinOp
EqOp
(
Lit
(
LitLoc
l1
))
(
Lit
(
LitLoc
l2
))
@
E
{{
Φ
}}
.
Proof
.
Proof
.
iIntros
(
Hl
Hg
)
"Hp HP"
.
iIntros
(
Heq
Hne
Hl1
Hl2
)
"HP"
.
iDestruct
"Hp"
as
(
q1
vl1
q2
vl2
)
"Hp"
.
destruct
(
bool_decide_reflect
(
l1
=
l2
))
.
destruct
(
bool_decide_reflect
(
l1
=
l2
));
[
rewrite
Hl
//|
rewrite
Hg
//
];
-
rewrite
Heq
//
{
Heq
Hne
}
.
iApply
wp_bin_op_pure
;
subst
.
clear
Hl
Hg
.
-
iApply
wp_bin_op_pure
;
subst
.
+
intros
.
apply
BinOpEqTrue
.
constructor
.
+
intros
.
apply
BinOpEqTrue
.
constructor
.
+
iNext
.
iIntros
(??
Heval
)
.
by
inversion_clear
Heval
;
inv_lit
.
+
iNext
.
iIntros
(??
Heval
)
.
by
inversion_clear
Heval
;
inv_lit
.
-
iApply
wp_lift_atomic_head_step_no_fork
;
subst
=>
//.
-
clear
Heq
.
iApply
wp_lift_atomic_head_step_no_fork
;
subst
=>
//.
iIntros
.
iModIntro
.
inv_head_step
.
iIntros
(
σ1
)
"Hσ1"
.
iModIntro
.
inv_head_step
.
iSplitR
.
iSplitR
.
{
iPureIntro
.
eexists
_,
_,
_
.
constructor
.
apply
BinOpEqFalse
.
by
auto
.
}
{
iPureIntro
.
eexists
_,
_,
_
.
constructor
.
apply
BinOpEqFalse
.
by
auto
.
}
(* We need to do a little gymnastics here to apply Hne now and strip away a
▷ but also keep the P. *)
iAssert
(
P
∧
▷
Φ
(
LitV
false
))
%
I
with
"[HP]"
as
"HP"
.
{
iSplit
;
first
done
.
by
iApply
Hne
.
}
iNext
.
iNext
.
iIntros
(
e2
σ2
efs
Hs
)
"!>"
.
iIntros
(
e2
σ2
efs
Hs
)
"!>"
.
inv_head_step
.
iSplitR
=>
//.
inv_head_step
.
iSplitR
=>
//.
inversion
H7
;
inv_lit
=>
//.
match
goal
with
[
H
:
bin_op_eval
_
_
_
_
_
|
-
_
]
=>
inversion
H
end
;
*
iDestruct
"Hp"
as
"[Hp _]"
.
inv_lit
=>
//.
iDestruct
(
heap_read
σ2
with
"~ Hp"
)
as
(
n'
)
"%"
.
*
iExFalso
.
iDestruct
"HP"
as
"[HP _]"
.
by
rewrite
H0
in
H6
.
iDestruct
(
Hl1
with
"HP"
)
as
(??)
"Hl1"
.
*
iDestruct
"Hp"
as
"[_ Hp]"
.
iDestruct
(
heap_read
σ2
with
"Hσ1 Hl1"
)
as
(
n'
)
"%"
.
iDestruct
(
heap_read
σ2
with
"~ Hp"
)
as
(
n'
)
"%"
.
simplify_eq
.
by
rewrite
H0
in
H6
.
*
iExFalso
.
iDestruct
"HP"
as
"[HP _]"
.
*
by
iFrame
.
iDestruct
(
Hl2
with
"HP"
)
as
(??)
"Hl2"
.
iDestruct
(
heap_read
σ2
with
"Hσ1 Hl2"
)
as
(
n'
)
"%"
.
simplify_eq
.
*
iDestruct
"HP"
as
"[_ $]"
.
done
.
Qed
.
Qed
.
Lemma
wp_eq_loc_0_r
E
(
l
:
loc
)
P
Φ
:
Lemma
wp_eq_loc_0_r
E
(
l
:
loc
)
P
Φ
:
...
...
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