Definition tc_formals (formals: list (ident * type)) : environ -> Prop :=
fun rho => tc_vals (map (@snd _ _) formals) (map (fun xt => (eval_id (fst xt) rho)) formals).
(*This definition, and lemma close_precondition_i below, could be moved to general_seplog*)
Program Definition close_precondition (params vars: list (ident * type)) (P: environ -> pred rmap) (rho: environ) : pred rmap :=
fun phi =>
exists ve', exists te',
(forall i, In i (map (@fst _ _) params) -> Map.get te' i = Map.get (te_of rho) i) /\
(forall i, In i (map (@fst _ _) vars) \/ Map.get ve' i = Map.get (ve_of rho) i) /\
app_pred (P (mkEnviron (ge_of rho) ve' te')) phi.
Next Obligation.
intros.
intro; intros.
destruct H0 as [ve' [te' [? [? ?]]]]; exists ve',te'; split3; auto.
eapply pred_hereditary; eauto.
Qed.

Lemma close_precondition_i:
forall params vars P rho,
P rho |-- close_precondition params vars P rho.