X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2FnCicMetaSubst.ml;h=6a0406747abba552d2811eb2337b44055b79d83a;hb=ff52cc33b36594d156f8c7d4351ffe0a34730b62;hp=4c44221ad0dc5e1845b039773e647ba7cb92679d;hpb=a47a1ea4cd00abd32d8fc483b5abc7eaed881e3d;p=helm.git diff --git a/helm/software/components/ng_refiner/nCicMetaSubst.ml b/helm/software/components/ng_refiner/nCicMetaSubst.ml index 4c44221ad..6a0406747 100644 --- a/helm/software/components/ng_refiner/nCicMetaSubst.ml +++ b/helm/software/components/ng_refiner/nCicMetaSubst.ml @@ -342,30 +342,28 @@ let delift metasenv subst context n l t = ;; let mk_meta ?name metasenv context ty = - match ty with - | `Typeless -> - let n = newmeta () in - let ty = NCic.Implicit (`Typeof n) in - let menv_entry = (n, (name, context, ty)) in - menv_entry :: metasenv,NCic.Meta (n, (0,NCic.Irl (List.length context))), ty - | `Type - | `Term -> - let context_for_ty = if ty = `Type then [] else context in - let n = newmeta () in - let ty_menv_entry = (n, (name,context_for_ty, NCic.Implicit (`Typeof n))) in - let m = newmeta () in - let ty = NCic.Meta (n, (0,NCic.Irl (List.length context_for_ty))) in - let menv_entry = (m, (name, context, ty)) in - menv_entry :: ty_menv_entry :: metasenv, - NCic.Meta (m, (0,NCic.Irl (List.length context))), ty + let tyof = function Some s -> Some ("typeof_"^s) | None -> None in + let rec mk_meta name n metasenv context = function | `WithType ty -> - let n = newmeta () in let len = List.length context in let menv_entry = (n, (name, context, ty)) in menv_entry :: metasenv, NCic.Meta (n, (0,NCic.Irl len)), ty + | `Sort -> + let ty = NCic.Implicit (`Typeof n) in + mk_meta (tyof name) n metasenv [] (`WithType ty) + | `Type -> + let metasenv, ty, _ = + mk_meta (tyof name) (newmeta ()) metasenv context `Sort in + mk_meta name n metasenv context (`WithType ty) + | `Term -> + let metasenv, ty, _ = + mk_meta (tyof name) (newmeta ()) metasenv context `Type in + mk_meta name n metasenv context (`WithType ty) + in + mk_meta name (newmeta ()) metasenv context ty ;; -let saturate ?(delta=0) metasenv context ty goal_arity = +let saturate ?(delta=0) metasenv subst context ty goal_arity = assert (goal_arity >= 0); let rec aux metasenv = function | NCic.Prod (name,s,t) -> @@ -379,7 +377,7 @@ let saturate ?(delta=0) metasenv context ty goal_arity = else t, metasenv1, arg::args, pno+1 | ty -> - match NCicReduction.whd context ty ~delta with + match NCicReduction.whd ~subst context ty ~delta with | NCic.Prod _ as ty -> aux metasenv ty | ty -> ty, metasenv, [], 0 in