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