(** Proofs about validation. **)

(* Top-level safety theorem.  If we have verified an entire program then we can call any of the functions in the program in a state satisfing the function's precondition. *)
Lemma validate_correct : forall pu ps n i f fs rho m args vals a,
satisfies_spec pu ps n ->
ps f = Some fs ->
evaluate_exprs rho args vals ->
(fs_pre fs a vals * TT)%pred (n,(rho,m)) ->
LocalsMap.map_share i rho = Share.top ->
safen pu (kseq (call i f args) knil) (n,(rho,m)).