X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_unification%2FcicRefine.ml;h=7bd3de5c2a0f09aa92e0094d80f999dac7272276;hb=9945374a5594c068883fa6c775f17b640fcac64d;hp=b3525d3182bcec3737d02c2883cd7402d1acf730;hpb=c5d5bf37b1e4c4b9b499ed2cbfe27cf2ec181944;p=helm.git diff --git a/helm/ocaml/cic_unification/cicRefine.ml b/helm/ocaml/cic_unification/cicRefine.ml index b3525d318..7bd3de5c2 100644 --- a/helm/ocaml/cic_unification/cicRefine.ml +++ b/helm/ocaml/cic_unification/cicRefine.ml @@ -162,8 +162,8 @@ and type_of_aux' metasenv context t = in CicSubstitution.lift_meta l ty, subst', metasenv' (* TASSI: CONSTRAINT *) - | C.Sort (C.Type t) -> - let t' = CicUniv.fresh() in + | C.Sort (C.Type t) -> + let t' = CicUniv.fresh() in if not (CicUniv.add_gt t' t ) then assert false (* t' is fresh! an error in CicUniv *) else @@ -452,6 +452,7 @@ and type_of_aux' metasenv context t = | ((uri,t) as subst)::tl -> let typeofvar = CicSubstitution.subst_vars substs (type_of_variable uri) in +(* CSC: why was this code here? it is wrong (match CicEnvironment.get_cooked_obj ~trust:false uri with Cic.Variable (_,Some bo,_,_) -> raise @@ -463,16 +464,19 @@ and type_of_aux' metasenv context t = (RefineFailure ("Unkown variable definition " ^ UriManager.string_of_uri uri)) ) ; +*) let typeoft,metasubst',metasenv' = type_of_aux metasubst metasenv context t in - try - let metasubst'',metasenv'' = + let metasubst'',metasenv'' = + try fo_unif_subst metasubst' context metasenv' typeoft typeofvar - in - check_exp_named_subst_aux metasubst'' metasenv'' (substs@[subst]) tl - with _ -> - raise (RefineFailure "Wrong Explicit Named Substitution") + with _ -> + raise (RefineFailure + ("Wrong Explicit Named Substitution: " ^ CicMetaSubst.ppterm metasubst' typeoft ^ + " not unifiable with " ^ CicMetaSubst.ppterm metasubst' typeofvar)) + in + check_exp_named_subst_aux metasubst'' metasenv'' (substs@[subst]) tl in check_exp_named_subst_aux metasubst metasenv [] @@ -487,7 +491,7 @@ and type_of_aux' metasenv context t = C.Sort s2,subst,metasenv | (C.Sort (C.Type t1), C.Sort (C.Type t2)) -> (* TASSI: CONSRTAINTS: the same in cictypechecker, doubletypeinference *) - let t' = CicUniv.fresh() in + let t' = CicUniv.fresh() in if not (CicUniv.add_ge t' t1) || not (CicUniv.add_ge t' t2) then assert false ; (* not possible, error in CicUniv *) C.Sort (C.Type t'),subst,metasenv