| Some t -> Some (CicMetaSubst.lift subst 1 t)
) args in
let argty' = CicMetaSubst.lift subst (List.length args) argty in
- let context'' = Some (Cic.Anonymous, Cic.Decl argty') :: context' in
+ let name =
+ FreshNamesGenerator.mk_fresh_name
+ (CicMetaSubst.apply_subst_metasenv subst metasenv)
+ (CicMetaSubst.apply_subst_context subst context)
+ Cic.Anonymous
+ (CicMetaSubst.apply_subst subst argty) in
+ let context'' = Some (name, Cic.Decl argty') :: context' in
let (metasenv, idx) =
CicMkImplicit.mk_implicit metasenv (context'' @ context) in
let irl =
context)
in
let newmeta = Cic.Meta (idx, irl) in
- let prod =
- Cic.Prod
- (FreshNamesGenerator.mk_fresh_name
- (CicMetaSubst.apply_subst_metasenv subst metasenv)
- (CicMetaSubst.apply_subst_context subst context)
- Cic.Anonymous
- (CicMetaSubst.apply_subst subst argty),
- argty, newmeta) in
+ let prod = Cic.Prod (name, argty, newmeta) in
let (_, subst, metasenv) = type_of_aux subst metasenv context prod in
let (subst, metasenv) =
CicUnification.fo_unif_subst subst context metasenv resty prod