(* *********************************************************************)
(*                                                                     *)
(*              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.     *)
(*                                                                     *)
(* *********************************************************************)
(** RTL function inlining: relational specification *)
(** ** Soundness of function environments. *)
(** A compile-time function environment is compatible with a whole program if the following condition holds. *)
Definition fenv_compat (p: program) (fenv: funenv) : Prop :=
forall id f,
fenv!id = Some f -> (prog_defmap p)!id = Some (Gfun (Internal f)).

(* Specifications: *)
Lemma funenv_program_compat:
forall p, fenv_compat p (funenv_program p).
Lemma fenv_compat_linkorder:
forall cunit prog fenv,
linkorder cunit prog -> fenv_compat cunit fenv -> fenv_compat prog fenv.