(** ** Relational specification of the translation. *)

Definition match_prog (p: Csyntax.program) (tp: Clight.program) :=
    match_program (fun ctx f tf => tr_fundef f tf) eq p tp
 /\ prog_types tp = prog_types p.

(* Specifications: *)
Lemma transf_program_match: forall p tp, transl_program p = OK tp -> match_prog p tp.
Lemma comp_env_preserved: Clight.genv_cenv tge = Csem.genv_cenv ge.
Lemma symbols_preserved: forall (s: ident), Genv.find_symbol tge s = Genv.find_symbol ge s.
Lemma senv_preserved: Senv.equiv ge tge.
Lemma function_ptr_translated: forall b f, Genv.find_funct_ptr ge b = Some f -> exists tf, Genv.find_funct_ptr tge b = Some tf /\ tr_fundef f tf.
Lemma functions_translated: forall v f, Genv.find_funct ge v = Some f -> exists tf, Genv.find_funct tge v = Some tf /\ tr_fundef f tf.
Lemma type_of_fundef_preserved: forall f tf, tr_fundef f tf -> type_of_fundef tf = Csyntax.type_of_fundef f.
Lemma function_return_preserved: forall f tf, tr_function f tf -> fn_return tf = Csyntax.fn_return f.
Lemma eval_Ederef': forall ge e le m a t l ofs, eval_expr ge e le m a (Vptr l ofs) -> eval_lvalue ge e le m (Ederef' a t) l ofs.
Lemma typeof_Ederef': forall a t, typeof (Ederef' a t) = t.
Lemma eval_Eaddrof': forall ge e le m a t l ofs, eval_lvalue ge e le m a l ofs -> eval_expr ge e le m (Eaddrof' a t) (Vptr l ofs).
Lemma typeof_Eaddrof': forall a t, typeof (Eaddrof' a t) = t.
Lemma tr_simple_nil: (forall le dst r sl a tmps, tr_expr le dst r sl a tmps -> dst = For_val \/ dst = For_effects -> simple r = true -> sl = nil) /\(forall le rl sl al tmps, tr_exprlist le rl sl al tmps -> simplelist rl = true -> sl = nil).
Lemma tr_simple_expr_nil: forall le dst r sl a tmps, tr_expr le dst r sl a tmps -> dst = For_val \/ dst = For_effects -> simple r = true -> sl = nil.
Lemma tr_simple_exprlist_nil: forall le rl sl al tmps, tr_exprlist le rl sl al tmps -> simplelist rl = true -> sl = nil.