(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*          Xavier Leroy, INRIA Paris-Rocquencourt                     *)
(*                                                                     *)
(*  Copyright Institut National de Recherche en Informatique et en     *)
(*  Automatique.  All rights reserved.  This file is distributed       *)
(*  under the terms of the INRIA Non-Commercial License Agreement.     *)
(*                                                                     *)
(* *********************************************************************)
(** * Correctness of the translation from Clight to C#minor. *)
(** * Relational specification of the transformation *)
Inductive match_fundef (p: Clight.program) : Clight.fundef -> Csharpminor.fundef -> Prop :=
| match_fundef_internal: forall f tf,
transl_function p.(prog_comp_env) f = OK tf ->
match_fundef p (Ctypes.Internal f) (AST.Internal tf)
| match_fundef_external: forall ef args res cc,
ef_sig ef = signature_of_type args res cc ->
match_fundef p (Ctypes.External ef args res cc) (AST.External ef).
Definition match_varinfo (v: type) (tv: unit) := True.
Definition match_prog (p: Clight.program) (tp: Csharpminor.program) : Prop :=
match_program_gen match_fundef match_varinfo p p tp.
(** * Properties of operations over types *)
Remark transl_params_types:
forall params,
map typ_of_type (map snd params) = typlist_of_typelist (type_of_params params).
(** * Properties of the translation functions *)
(** Transformation of expressions and statements. *)
(** Properties of labeled statements *)

Lemma transl_lbl_stmt_2:
forall ce tyret nbrk ncnt sl tsl,
transl_lbl_stmt ce tyret nbrk ncnt sl = OK tsl ->
transl_statement ce tyret nbrk ncnt (seq_of_labeled_statement sl) = OK (seq_of_lbl_stmt tsl).