X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_acic%2FdoubleTypeInference.ml;h=1671b98d25321ca6492f8565715ba99d5ddfedba;hb=9f064ffe2834ae91f306b44f79bfbfb68a4631c5;hp=d54d0fbe4dbf56b431d4d2c6daf3eb1919f54562;hpb=afcc11c0cf6751122dc3907f130b819851099a49;p=helm.git diff --git a/helm/software/components/cic_acic/doubleTypeInference.ml b/helm/software/components/cic_acic/doubleTypeInference.ml index d54d0fbe4..1671b98d2 100644 --- a/helm/software/components/cic_acic/doubleTypeInference.ml +++ b/helm/software/components/cic_acic/doubleTypeInference.ml @@ -37,7 +37,7 @@ exception RelToHiddenHypothesis;; let xxx_type_of_aux' m c t = try - Some (fst (CicTypeChecker.type_of_aux' m c t CicUniv.empty_ugraph)) + Some (fst (CicTypeChecker.type_of_aux' m c t CicUniv.oblivion_ugraph)) with | CicTypeChecker.TypeCheckerFailure _ -> None (* because eta_expansion *) ;; @@ -180,7 +180,7 @@ let type_of_constant uri = let module R = CicReduction in let module U = UriManager in let cobj = - match CicEnvironment.is_type_checked CicUniv.empty_ugraph uri with + match CicEnvironment.is_type_checked CicUniv.oblivion_ugraph uri with CicEnvironment.CheckedObj (cobj,_) -> cobj | CicEnvironment.UncheckedObj (uobj,_) -> raise (NotWellTyped "Reference to an unchecked constant") @@ -195,7 +195,7 @@ let type_of_variable uri = let module C = Cic in let module R = CicReduction in let module U = UriManager in - match CicEnvironment.is_type_checked CicUniv.empty_ugraph uri with + match CicEnvironment.is_type_checked CicUniv.oblivion_ugraph uri with CicEnvironment.CheckedObj ((C.Variable (_,_,ty,_,_)),_) -> ty | CicEnvironment.UncheckedObj (C.Variable _,_) -> raise (NotWellTyped "Reference to an unchecked variable") @@ -207,7 +207,7 @@ let type_of_mutual_inductive_defs uri i = let module R = CicReduction in let module U = UriManager in let cobj = - match CicEnvironment.is_type_checked CicUniv.empty_ugraph uri with + match CicEnvironment.is_type_checked CicUniv.oblivion_ugraph uri with CicEnvironment.CheckedObj (cobj,_) -> cobj | CicEnvironment.UncheckedObj (uobj,_) -> raise (NotWellTyped "Reference to an unchecked inductive type") @@ -224,7 +224,7 @@ let type_of_mutual_inductive_constr uri i j = let module R = CicReduction in let module U = UriManager in let cobj = - match CicEnvironment.is_type_checked CicUniv.empty_ugraph uri with + match CicEnvironment.is_type_checked CicUniv.oblivion_ugraph uri with CicEnvironment.CheckedObj (cobj,_) -> cobj | CicEnvironment.UncheckedObj (uobj,_) -> raise (NotWellTyped "Reference to an unchecked constructor") @@ -464,7 +464,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = let (cl,parsno) = let obj,_ = try - CicEnvironment.get_cooked_obj CicUniv.empty_ugraph uri + CicEnvironment.get_cooked_obj CicUniv.oblivion_ugraph uri with Not_found -> assert false in match obj with @@ -573,7 +573,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = let uris_and_types = let obj,_ = try - CicEnvironment.get_cooked_obj CicUniv.empty_ugraph uri + CicEnvironment.get_cooked_obj CicUniv.oblivion_ugraph uri with Not_found -> assert false in let params = CicUtil.params_of_obj obj in @@ -581,7 +581,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = (function uri -> let obj,_ = try - CicEnvironment.get_cooked_obj CicUniv.empty_ugraph uri + CicEnvironment.get_cooked_obj CicUniv.oblivion_ugraph uri with Not_found -> assert false in match obj with @@ -608,15 +608,10 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = let t1' = CicReduction.whd context t1 in let t2' = CicReduction.whd ((Some (name,C.Decl s))::context) t2 in match (t1', t2') with - (C.Sort _, C.Sort s2) - when (s2 = C.Prop or s2 = C.Set or s2 = C.CProp) -> - (* different from Coq manual!!! *) - C.Sort s2 - | (C.Sort (C.Type t1), C.Sort (C.Type t2)) -> - C.Sort (C.Type (CicUniv.fresh())) - | (C.Sort _,C.Sort (C.Type t1)) -> - (* TASSI: CONSRTAINTS: the same in cictypechecker,cicrefine *) - C.Sort (C.Type t1) (* c'e' bisogno di un fresh? *) + | (C.Sort _, C.Sort s2) when (s2 = C.Prop || s2 = C.Set) -> C.Sort s2 + | (C.Sort (C.Type t1), C.Sort (C.Type t2)) ->C.Sort(C.Type(CicUniv.fresh())) + | (C.Sort _,C.Sort (C.Type t1)) -> C.Sort (C.Type t1) + | (C.Sort _,C.Sort (C.CProp t1)) -> C.Sort (C.CProp t1) | (C.Meta _, C.Sort _) -> t2' | (C.Meta _, (C.Meta (_,_) as t)) | (C.Sort _, (C.Meta (_,_) as t)) when CicUtil.is_closed t ->