Module Theorems
Require Import CompAnnot.
Import Coqlib Errors Smallstep Behaviors CompAnnot Maps.
Import AST Globalenvs.
Require RTLdefgenproof.
Require CsharpminorAnalysisproof.
Require CSE2proof.
Require Renumber2proof.
Lemma rtl_of_cminor_correct:
forall cse2 num p tp,
rtl_of_cminor cse2 num p =
OK tp ->
forward_simulation (
Cminor.semantics p) (
RTL.semantics tp).
Proof.
Lemma tp_safe:
forall unload stack p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
forall beh,
program_behaves (
RTL.semantics tp)
beh ->
not_wrong beh.
Proof.
Lemma def2_is_defgen_of_tp:
forall unload stack p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
exists tp',
RTLdefgen.transf_program tp =
OK tp' /\
Renumber2.transf_program tp' =
OK def2.
Proof.
Lemma def1_safe:
forall unload stack p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
forall beh,
program_behaves (
RTL.semantics def1)
beh ->
not_wrong beh.
Proof.
Lemma RTLdefgenproof_implies:
forall unload stack p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
(
forall beh,
program_behaves (
RTL.semantics def2)
beh ->
not_wrong beh) ->
(
forall beh,
program_behaves (
RTL.semantics_safe tp)
beh ->
not_wrong beh).
Proof.
Lemma if_validated:
forall unload stack p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
forward_simulation (
RTLperm.semantics def1) (
RTL.semantics def2) ->
MoreSemantics.safe (
RTL.semantics_safe tp).
Proof.
Theorem annotations_correct:
forall unload stack printer fuel p tp def1 def2,
doit'
unload stack p =
OK (
tp,
def1,
def2) ->
equivalence_check printer def2 def1 fuel =
OK tt ->
RTLperm.no_fancy_builtin def1 =
true ->
(
forall name sig args m tr vres m',
Events.external_functions_sem name sig (
Genv.globalenv def1)
args m tr vres m' ->
RTLperm.eq3 (
RTLperm.mem_perm m) (
RTLperm.mem_perm m')) ->
MoreSemantics.safe (
RTL.semantics_safe tp).
Proof.