X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Fcic_proof_checking%2FfreshNamesGenerator.ml;h=73b75ce18e7257e876a0d316d934fd95db15350d;hb=b8f54b66890a55cfc255fa1df3e40fe60b78ee15;hp=1edb35b0420656b16f728623aadfd9f4d7e29098;hpb=759e63623b08a6b7a245e04098a9479978089c65;p=helm.git diff --git a/components/cic_proof_checking/freshNamesGenerator.ml b/components/cic_proof_checking/freshNamesGenerator.ml index 1edb35b04..73b75ce18 100755 --- a/components/cic_proof_checking/freshNamesGenerator.ml +++ b/components/cic_proof_checking/freshNamesGenerator.ml @@ -83,7 +83,8 @@ let mk_fresh_name ~subst metasenv context name ~typ = (try let ty,_ = CicTypeChecker.type_of_aux' ~subst metasenv context typ - CicUniv.empty_ugraph in + CicUniv.oblivion_ugraph + in (match ty with C.Sort C.Prop | C.Sort C.CProp -> "H" @@ -92,7 +93,7 @@ let mk_fresh_name ~subst metasenv context name ~typ = with CicTypeChecker.TypeCheckerFailure _ -> "H" ) | C.Name name -> - Str.global_replace (Str.regexp "[0-9]*$") "" name + Str.global_replace (Str.regexp "[0-9']*$") "" name in let already_used name = List.exists (function Some (n,_) -> n=name | _ -> false) context @@ -192,9 +193,13 @@ let rec mk_fresh_names ~subst metasenv context t = let pl' = List.map (mk_fresh_names ~subst metasenv context) pl in Cic.MutCase (sp, i, outty', t', pl') | Cic.Fix (i, fl) -> - let tys = List.map - (fun (n,_,ty,_) -> - Some (Cic.Name n,(Cic.Decl ty))) fl in + let tys,_ = + List.fold_left + (fun (types,len) (n,_,ty,_) -> + (Some (Cic.Name n,(Cic.Decl (CicSubstitution.lift len ty)))::types, + len+1) + ) ([],0) fl + in let fl' = List.map (fun (n,i,ty,bo) -> let ty' = mk_fresh_names ~subst metasenv context ty in @@ -202,9 +207,13 @@ let rec mk_fresh_names ~subst metasenv context t = (n,i,ty',bo')) fl in Cic.Fix (i, fl') | Cic.CoFix (i, fl) -> - let tys = List.map - (fun (n,_,ty) -> - Some (Cic.Name n,(Cic.Decl ty))) fl in + let tys,_ = + List.fold_left + (fun (types,len) (n,ty,_) -> + (Some (Cic.Name n,(Cic.Decl (CicSubstitution.lift len ty)))::types, + len+1) + ) ([],0) fl + in let fl' = List.map (fun (n,ty,bo) -> let ty' = mk_fresh_names ~subst metasenv context ty in