Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
FP
Stacked Borrows Coq
Commits
b31e481e
Commit
b31e481e
authored
Jul 10, 2019
by
Hai Dang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy right rule
parent
8af99dc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
6 deletions
+50
-6
theories/sim/right_step.v
theories/sim/right_step.v
+50
-6
No files found.
theories/sim/right_step.v
View file @
b31e481e
...
...
@@ -45,17 +45,61 @@ Proof.
Qed
.
Lemma
sim_body_copy_unique_r
fs
ft
(
r
r
'
:
resUR
)
(
h
:
heaplet
)
n
(
l
:
loc
)
t
g
T
(
s
:
scalar
)
es
σ
s
σ
t
Φ
:
fs
ft
(
r
r
'
:
resUR
)
(
h
:
heaplet
)
n
(
l
:
loc
)
t
T
(
s
:
scalar
)
es
σ
s
σ
t
Φ
:
tsize
T
=
1
%
nat
→
tag_on_top
σ
t
.(
sst
)
l
t
g
→
r
≡
r
'
⋅
res_tag
t
g
tkUnique
h
→
tag_on_top
σ
t
.(
sst
)
l
t
→
r
≡
r
'
⋅
res_tag
t
tkUnique
h
→
h
!!
l
=
Some
s
→
(
r
⊨
{
n
,
fs
,
ft
}
(
es
,
σ
s
)
≥
(#[
s
],
σ
t
)
:
Φ
:
Prop
)
→
r
⊨
{
S
n
,
fs
,
ft
}
(
es
,
σ
s
)
≥
(
Copy
(
Place
l
(
Tagged
t
g
)
T
),
σ
t
)
:
Φ
.
r
⊨
{
S
n
,
fs
,
ft
}
(
es
,
σ
s
)
≥
(
Copy
(
Place
l
(
Tagged
t
)
T
),
σ
t
)
:
Φ
.
Proof
.
intros
LenT
TOP
Eqr
Eqs
CONT
.
Admitted
.
intros
LenT
TOP
Eqr
Eqs
CONT
.
pfold
.
intros
NT
r_f
WSAT
.
have
WSAT1
:=
WSAT
.
destruct
WSAT
as
(
WFS
&
WFT
&
VALID
&
PINV
&
CINV
&
SREL
&
LINV
).
(
*
some
lookup
properties
*
)
have
VALIDr
:=
cmra_valid_op_r
_
_
VALID
.
rewrite
->
Eqr
in
VALIDr
.
have
HLtr
:
r
.(
rtm
)
!!
t
≡
Some
(
to_tagKindR
tkUnique
,
to_agree
<
$
>
h
).
{
rewrite
Eqr
.
eapply
tmap_lookup_op_unique_included
;
[
apply
VALIDr
|
apply
cmra_included_r
|
].
rewrite
res_tag_lookup
//. }
have
HLtrf
:
(
r_f
⋅
r
).(
rtm
)
!!
t
≡
Some
(
to_tagKindR
tkUnique
,
to_agree
<
$
>
h
).
{
apply
tmap_lookup_op_r_unique_equiv
;
[
apply
VALID
|
done
].
}
(
*
we
can
make
the
read
in
tgt
because
tag_on_top
*
)
destruct
TOP
as
[
opro
TOP
].
destruct
(
σ
t
.(
sst
)
!!
l
)
as
[
stk
|
]
eqn
:
Eqstk
;
[
|
done
].
simpl
in
TOP
.
specialize
(
PINV
_
_
_
HLtrf
)
as
[
Lt
PINV
].
specialize
(
PINV
l
s
).
rewrite
lookup_fmap
Eqs
in
PINV
.
specialize
(
PINV
ltac
:
(
done
)
_
Eqstk
Unique
opro
)
as
[
Eqss
HD
].
{
destruct
stk
;
[
done
|
].
simpl
in
TOP
.
simplify_eq
.
by
left
.
}
{
done
.
}
destruct
(
tag_unique_head_access
σ
t
.(
scs
)
stk
(
Tagged
t
)
opro
AccessRead
)
as
[
ns
Eqstk
'
];
[
done
|
].
have
Eq
α
:
memory_read
σ
t
.(
sst
)
σ
t
.(
scs
)
l
(
Tagged
t
)
(
tsize
T
)
=
Some
σ
t
.(
sst
).
{
rewrite
LenT
/
memory_read
/=
shift_loc_0_nat
Eqstk
/=
Eqstk
'
/=
insert_id
//. }
have
READ
:
read_mem
l
(
tsize
T
)
σ
t
.(
shp
)
=
Some
[
s
].
{
rewrite
LenT
read_mem_equation_1
/=
Eqss
//. }
have
STEPT
:
(
Copy
(
Place
l
(
Tagged
t
)
T
),
σ
t
)
~{
ft
}~>
((#[
s
])
%
E
,
σ
t
).
{
destruct
σ
t
.
eapply
(
head_step_fill_tstep
_
[]);
eapply
copy_head_step
'
;
eauto
.
}
split
;
[
right
;
by
do
2
eexists
|
done
|
].
constructor
1.
intros
et
'
σ
t
'
STEPT
'
.
destruct
(
tstep_copy_inv
_
(
PlaceR
_
_
_
)
_
_
_
STEPT
'
)
as
(
l1
&
t1
&
T1
&
vs1
&
α
1
&
EqH
&
?
&
Eqvs
&
Eq
α'
&
?
).
symmetry
in
EqH
.
simplify_eq
.
have
Eq
σ
t
:
mkState
σ
t
.(
shp
)
σ
t
.(
sst
)
σ
t
.(
scs
)
σ
t
.(
snp
)
σ
t
.(
snc
)
=
σ
t
by
destruct
σ
t
.
rewrite
Eq
σ
t
.
rewrite
Eq
σ
t
in
STEPT
'
.
clear
Eq
σ
t
.
exists
es
,
σ
s
,
r
,
n
.
split
;
last
split
;
[
|
done
|
].
-
right
.
split
;
[
lia
|
done
].
-
by
left
.
Qed
.
Lemma
vsP_res_mapsto_tag_on_top
(
r
:
resUR
)
l
t
s
σ
s
σ
t
:
(
r
⋅
res_mapsto
l
[
s
]
t
)
={
σ
s
,
σ
t
}=>
(
λ
_
_
σ
t
,
tag_on_top
σ
t
.(
sst
)
l
t
:
Prop
).
...
...
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