Local Open Scope pred.
Fixpoint match_globvars (gvs: list (ident * globvar type)) (V: varspecs) : bool :=
match V with
| nil => true
| (id,t)::V' => match gvs with
| nil => false
| (j,g)::gvs' => if eqb_ident id j
then andb (eqb_type t (gvar_info g)) (match_globvars gvs' V')
else match_globvars gvs' V
end
end.

Lemma typecheck_temp_environ_i:
forall (V : varspecs) (G : funspecs)
(args : list val) (retty: type)
(params temps vars : list (ident * type))
(te' : temp_env),
tc_vals (map snd params) args ->
list_norepet (map fst params ++ map fst temps) ->
bind_parameter_temps params args (create_undef_temps temps) = Some te' ->
typecheck_temp_environ (make_tenv te')
(temp_types (make_tycontext params temps vars retty V G nil)).