X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fcic_unification%2FcicRefine.ml;h=5c031f4733b6806f2da7c1b9ef683d8d589112ec;hb=91a095f0686ee569ba035e4e30c7d071588cb8e7;hp=42069ff5cb92ef6d6c7266d15c0725acc737937c;hpb=358cefe50cccd4cb7d8e2a9cecb7efcb5780b8a3;p=helm.git diff --git a/helm/ocaml/cic_unification/cicRefine.ml b/helm/ocaml/cic_unification/cicRefine.ml index 42069ff5c..5c031f473 100644 --- a/helm/ocaml/cic_unification/cicRefine.ml +++ b/helm/ocaml/cic_unification/cicRefine.ml @@ -287,7 +287,7 @@ and type_of_aux' metasenv context t ugraph = * Moreover the inferred type is closer to the expected one. *) C.LetIn (n,s',t'),CicSubstitution.subst s' inferredty, - subst',metasenv',ugraph2 + subst'',metasenv'',ugraph2 | C.Appl (he::((_::_) as tl)) -> let he',hetype,subst',metasenv',ugraph1 = type_of_aux subst metasenv context he ugraph @@ -995,7 +995,15 @@ let typecheck metasenv uri obj = assert (metasenv' = metasenv); (* Here we do not check the metasenv for correctness *) let bo',boty,metasenv,ugraph = type_of_aux' metasenv [] bo ugraph in - let ty',_,metasenv,ugraph = type_of_aux' metasenv [] ty ugraph in + let ty',sort,metasenv,ugraph = type_of_aux' metasenv [] ty ugraph in + begin + match sort with + Cic.Sort _ + (* instead of raising Uncertain, let's hope that the meta will become + a sort *) + | Cic.Meta _ -> () + | _ -> raise (RefineFailure "The term provided is not a type") + end; let subst,metasenv,ugraph = fo_unif_subst [] [] metasenv boty ty' ugraph in let bo' = CicMetaSubst.apply_subst subst bo' in let ty' = CicMetaSubst.apply_subst subst ty' in @@ -1037,7 +1045,7 @@ let typecheck metasenv uri obj = let t = CicSubstitution.subst t' t in i - 1,t ) tys (typesno - 1,t)) in - let ty' = undebrujin ty in + let ty' = undebrujin ty' in metasenv,ugraph,(name,ty')::res ) cl (metasenv,ugraph,[]) in