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
Iris
c
Commits
6c3ed7ff
Commit
6c3ed7ff
authored
Oct 02, 2018
by
Léon Gondelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed vcg_sp_length lemmas
parent
71518adc
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
48 additions
and
27 deletions
+48
27
theories/vcgen/vcgen.v
theories/vcgen/vcgen.v
+48
27
No files found.
theories/vcgen/vcgen.v
View file @
6c3ed7ff
...
...
@@ 380,30 +380,50 @@ Section vcg_spec.
vcg_sp
E
ms
de
n
=
Some
(
ms'
,
mNew
,
dv
)
→
length
ms
=
length
ms'
.
Proof
.
Admitted
.
(* revert ms ms' mNew dv. induction de;
intros ms ms' mNew dv Hsp; simplify_eq/=; eauto.
 by simplify_option_eq.
 destruct (vcg_sp E ms de) as [[[ms1 mNew1] dv1]] eqn:Hout; simplify_eq /=.
destruct (is_dloc _ _) as [i] eqn:Hdl; try apply is_dloc_Some in Hdl as >; simplify_eq/=.
destruct (denv_delete_frac_2 i ms1 mNew1) as [[[[ms2 mNew2] q] dv1]] eqn:Hout1; simplify_eq/=.
transitivity (length ms1).
+ by eapply IHde.
+ by eapply denv_delete_frac_2_length.
 destruct (vcg_sp E ms de1) as [[[ms1 mNew1] dv1]] eqn:Hde1; simplify_eq /=.
destruct (is_dloc _ _) as [i] eqn:Hdl; try apply is_dloc_Some in Hdl as >; simplify_eq/=.
destruct (vcg_sp E ms1 de2) as [[[ms2 mNew2] dv2]] eqn:Hde2; simplify_eq /=.
destruct (denv_delete_full_2 i ms2 (denv_merge mNew1 mNew2)) as [[[ms3 mNew3] dv1]] eqn:Hout1; simplify_eq/=.
transitivity (length ms1).
+ by eapply IHde1.
+ transitivity (length ms2). by eapply IHde2.
by eapply denv_delete_full_2_length.
 destruct (vcg_sp E ms de1) as [[[ms1 mNew1] dv1]] eqn:Hde1; simplify_eq/=.
revert
ms
ms'
mNew
dv
de
.
induction
n
.
(*Base case*)

intros
ms
ms'
mNew
dv
de
Hsp
.
destruct
de
;
by
simplify_option_eq
.
(*Induction case*)

intros
ms
ms'
mNew
dv
de
Hsp
;
destruct
(
vcg_sp
E
ms
de
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hout
.
destruct
de
;
simplify_eq
/=
;
try
by
simplify_option_eq
.
+
(*bind case*)
destruct
(
vcg_sp
E
ms
de1
n
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
vcg_sp
E
(
mNew1
::
ms1
)
(
dce_subst
E
s
dv1
de2
)
n
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
destruct
ms2
;
simplify_eq
/=.
transitivity
(
length
ms1
).
*
by
eapply
IHn
.
*
apply
IHn
in
Hde2
;
by
simplify_eq
/=.
+
destruct
(
vcg_sp
E
ms
de
n
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
is_dloc
_
_
)
as
[
i
]
eqn
:
Hdl
;
try
apply
is_dloc_Some
in
Hdl
as
>
;
simplify_eq
/=.
destruct
(
denv_delete_frac_2
i
ms1
mNew1
)
as
[[[[
ms2
mNew2
]
q
]
dv1
]]
eqn
:
Hout1
;
simplify_eq
/=.
transitivity
(
length
ms1
).
*
by
eapply
IHn
.
*
by
eapply
denv_delete_frac_2_length
.
+
destruct
(
vcg_sp
E
ms
de1
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
is_dloc
_
_
)
as
[
i
]
eqn
:
Hdl
;
try
apply
is_dloc_Some
in
Hdl
as
>
;
simplify_eq
/=.
destruct
(
vcg_sp
E
ms1
de2
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
destruct
(
denv_delete_full_2
i
ms2
(
denv_merge
mNew1
mNew2
))
as
[[[
ms3
mNew3
]
dv1
]]
eqn
:
Hout1
;
simplify_eq
/=.
transitivity
(
length
ms1
).
*
by
eapply
IHn
.
*
transitivity
(
length
ms2
).
by
eapply
IHn
.
by
eapply
denv_delete_full_2_length
.
+
destruct
(
vcg_sp
E
ms
de1
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
vcg_sp
E
ms1
de2
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
destruct
(
dcbin_op_eval
E
c
dv1
dv2
)
eqn
:
Hboe
;
simplify_eq
/=.
transitivity
(
length
ms1
)
;
eauto
.

destruct (vcg_sp E ms de1) as [[[ms1 mNew1] dv1]] eqn:Hde1; simplify_eq/=.
+
destruct
(
vcg_sp
E
ms
de1
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
is_dloc
_
_
)
as
[
i
]
eqn
:
Hdl
;
try
apply
is_dloc_Some
in
Hdl
as
>
;
simplify_eq
/=.
destruct
(
vcg_sp
E
ms1
de2
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
...
...
@@ 412,21 +432,22 @@ Section vcg_spec.
destruct
(
dcbin_op_eval
E
c
dv1
dv2
)
eqn
:
Hboe
;
simplify_eq
/=.
transitivity
(
length
ms1
)
;
eauto
.
transitivity
(
length
ms2
)
;
eauto
using
denv_delete_full_2_length
.

destruct (vcg_sp E ms de) as [[[ms1 mNew1] dv1]] eqn:Hde; simplify_eq/=.
+
destruct
(
vcg_sp
E
ms
de
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde
;
simplify_eq
/=.
destruct
(
dun_op_eval
E
u
dv1
)
;
simplify_eq
/=.
by eapply IH
de
.

destruct (vcg_sp E ms de1) as [[[ms1 mNew1] dv1]] eqn:Hde1; simplify_eq/=.
by
eapply
IH
n
.
+
destruct
(
vcg_sp
E
ms
de1
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
vcg_sp
E
(
denv_unlock
mNew1
::
ms1
)
de2
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
destruct
ms2
;
simplify_eq
/=.
transitivity
(
length
ms1
).
+
by eapply IH
de1
.
+
apply IH
de2
in Hde2; by simplify_eq/=.

destruct (vcg_sp E ms de1)
*
by
eapply
IH
n
.
*
apply
IH
n
in
Hde2
;
by
simplify_eq
/=.
+
destruct
(
vcg_sp
E
ms
de1
)
as
[[[
ms1
mNew1
]
dv1
]]
eqn
:
Hde1
;
simplify_eq
/=.
destruct
(
vcg_sp
E
ms1
de2
)
as
[[[
ms2
mNew2
]
dv2
]]
eqn
:
Hde2
;
simplify_eq
/=.
transitivity
(
length
ms1
)
;
eauto
.
Qed. *)
+
done
.
Qed
.
Lemma
vcg_eval_dexpr_correct
E
de
dv
:
vcg_eval_dexpr
de
=
Some
dv
→
...
...
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