X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_proof_checking%2FfreshNamesGenerator.ml;h=3cfda02dff123a649bf51005ed6a0c01647c275d;hb=fc1e25e37ba7deb07572f0cdb63aef02f0468dcb;hp=5f3bfdbbd01a284190f10d6e618ed002981f8de5;hpb=4e3d7b4b47f66f0745333bfd4efcb27b4528f4c3;p=helm.git diff --git a/helm/software/components/cic_proof_checking/freshNamesGenerator.ml b/helm/software/components/cic_proof_checking/freshNamesGenerator.ml index 5f3bfdbbd..3cfda02df 100755 --- a/helm/software/components/cic_proof_checking/freshNamesGenerator.ml +++ b/helm/software/components/cic_proof_checking/freshNamesGenerator.ml @@ -60,7 +60,9 @@ let rec guess_a_name context ty = | Cic.Implicit _ -> assert false | Cic.Cast (t1,t2) -> guess_a_name context t1 | Cic.Prod (na_,_,t) -> higher_name 1 t - | Cic.Lambda _ -> assert false +(* warning: on appl we should beta reduce before the recursive call + | Cic.Lambda _ -> assert false +*) | Cic.LetIn (_,s,t) -> guess_a_name context (CicSubstitution.subst ~avoid_beta_redexes:true s t) | Cic.Appl [] -> assert false | Cic.Appl (he::_) -> guess_a_name context he @@ -81,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" @@ -90,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