X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2FnCicRefiner.ml;h=72a6409efbbf1b80446df87fce8d649af3a7400a;hb=f4f087993046203a36c310f71fcdf11b46d12cad;hp=191bd708c3e6abbf3b843f89b3723df66a3a54c9;hpb=24cbdd6b6b83b878797f067a4ae358b0fc4c4337;p=helm.git diff --git a/helm/software/components/ng_refiner/nCicRefiner.ml b/helm/software/components/ng_refiner/nCicRefiner.ml index 191bd708c..72a6409ef 100644 --- a/helm/software/components/ng_refiner/nCicRefiner.ml +++ b/helm/software/components/ng_refiner/nCicRefiner.ml @@ -162,8 +162,14 @@ let rec typeof metasenv, subst, t, NCicTypeChecker.typeof ~subst ~metasenv context t | C.Prod (name,(s as orig_s),(t as orig_t)) -> let metasenv, subst, s, s1 = typeof_aux metasenv subst context None s in + let metasenv, subst, s, s1 = + force_to_sort ~look_for_coercion + metasenv subst context s orig_s localise s1 in let context1 = (name,(C.Decl s))::context in let metasenv, subst, t, s2 = typeof_aux metasenv subst context1 None t in + let metasenv, subst, t, s2 = + force_to_sort ~look_for_coercion + metasenv subst context1 t orig_t localise s2 in let metasenv, subst, s, t, ty = sort_of_prod ~look_for_coercion localise metasenv subst context orig_s orig_t (name,s) t (s1,s2) @@ -330,23 +336,18 @@ and force_to_sort | ty -> try_coercions ~localise ~look_for_coercion metasenv subst context t orig_t ty (NCic.Sort (NCic.Type NCicEnvironment.type0)) false - (RefineFailure (lazy (localise orig_t, + (Uncertain (lazy (localise orig_t, "The type of " ^ NCicPp.ppterm ~metasenv ~subst ~context t ^ " is not a sort: " ^ NCicPp.ppterm ~metasenv ~subst ~context ty))) and sort_of_prod ~look_for_coercion localise metasenv subst context orig_s orig_t (name,s) t (t1, t2) = - let metasenv, subst, s, t1 = - force_to_sort - ~look_for_coercion metasenv subst context s orig_s localise t1 in - let metasenv, subst, t, t2 = - force_to_sort ~look_for_coercion metasenv subst ((name,C.Decl s)::context) - t orig_t localise t2 in + (* force to sort is done in the Prod case in typeof *) match t1, t2 with | C.Sort _, C.Sort C.Prop -> metasenv, subst, s, t, t2 | C.Sort (C.Type u1), C.Sort (C.Type u2) -> - metasenv, subst, s, t, C.Sort (C.Type (u1@u2)) + metasenv, subst, s, t, C.Sort (C.Type (NCicEnvironment.max u1 u2)) | C.Sort C.Prop,C.Sort (C.Type _) -> metasenv, subst, s, t, t2 | C.Meta _, C.Sort _ | C.Meta _, C.Meta (_,(_,_))