X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_acic%2FdoubleTypeInference.ml;h=7f93716b26c6685e1b3a2c74e3da64fc1b4d95cc;hb=347a92a83c3fa154c850d94b1a211fbb8334d4f1;hp=6fa7cce5ad03827939c836564b5b037da4646eb6;hpb=2e2648a9ed26d9b813de8e6a10e2776162565f09;p=helm.git diff --git a/helm/software/components/cic_acic/doubleTypeInference.ml b/helm/software/components/cic_acic/doubleTypeInference.ml index 6fa7cce5a..7f93716b2 100644 --- a/helm/software/components/cic_acic/doubleTypeInference.ml +++ b/helm/software/components/cic_acic/doubleTypeInference.ml @@ -339,17 +339,18 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = | C.Lambda (n,s,t) -> (* Let's visit all the subterms that will not be visited later *) let _ = type_of_aux context s None in - let expected_target_type = + let n, expected_target_type = match expectedty with - None -> None + | None -> n, None | Some expectedty' -> - let ty = + let n, ty = match R.whd context expectedty' with - C.Prod (_,_,expected_target_type) -> - beta_reduce expected_target_type + | C.Prod (n',_,expected_target_type) -> + let xtt = beta_reduce expected_target_type in + if n <> C.Anonymous then n, xtt else n', xtt | _ -> assert false in - Some ty + n, Some ty in let type2 = type_of_aux ((Some (n,(C.Decl s)))::context) t expected_target_type @@ -608,15 +609,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 ->