X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_unification%2FcicMetaSubst.ml;h=1dcbed6d297e4db01a5039e9eda32879c97d4ecd;hb=33e397c66c8ab7ff1adbffa6e3b2d152dbecad26;hp=5870089beda2d9f208f318cbd22789d87a60c73f;hpb=55b82bd235d82ff7f0a40d980effe1efde1f5073;p=helm.git diff --git a/helm/software/components/cic_unification/cicMetaSubst.ml b/helm/software/components/cic_unification/cicMetaSubst.ml index 5870089be..1dcbed6d2 100644 --- a/helm/software/components/cic_unification/cicMetaSubst.ml +++ b/helm/software/components/cic_unification/cicMetaSubst.ml @@ -1,4 +1,5 @@ (* Copyright (C) 2003, HELM Team. + * * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science @@ -230,7 +231,7 @@ let apply_subst_gen ~appl_fun subst term = in C.CoFix (i, fl') in - LibrarySync.merge_coercions (um_aux term) + um_aux term ;; let apply_subst = @@ -252,6 +253,11 @@ let apply_subst = apply_subst_gen ~appl_fun s t ;; +let profiler = HExtlib.profile "U/CicMetaSubst.apply_subst" +let apply_subst s t = + profiler.HExtlib.profile (apply_subst s) t + + let rec apply_subst_context subst context = (* incr apply_subst_context_counter; @@ -619,15 +625,17 @@ let delift n subst context metasenv l t = function C.Rel m -> if m <=k then - C.Rel m (*CSC: che succede se c'e' un Def? Dovrebbe averlo gia' *) - (*CSC: deliftato la regola per il LetIn *) - (*CSC: FALSO! La regola per il LetIn non lo fa *) + C.Rel m else (try match List.nth context (m-k-1) with Some (_,C.Def (t,_)) -> (*CSC: Hmmm. This bit of reduction is not in the spirit of *) (*CSC: first order unification. Does it help or does it harm? *) + (*CSC: ANSWER: it hurts performances since it is possible to *) + (*CSC: have an exponential explosion of the size of the proof.*) + (*CSC: However, without this bit of reduction some "apply" in *) + (*CSC: the library fail (e.g. nat/nth_prime.ma). *) deliftaux k (S.lift m t) | Some (_,C.Decl t) -> C.Rel ((position (m-k) l) + k)