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
| ((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
(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 []
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