let arity = match tgt with | CoercDb.Fun i -> i | _ -> 0 in
let src, tgt =
let cty = NCicTypeChecker.typeof ~subst:[] ~metasenv:[] [] c in
- match NCicMetaSubst.saturate ~delta:max_int [] [] cty (arity+1)
+ match
+ NCicMetaSubst.saturate ~delta:max_int [] [] [] cty (arity+1)
with
| NCic.Prod (_, src, tgt),_,_ ->
src, NCicSubstitution.subst (NCic.Meta (-1,(0,NCic.Irl 0))) tgt
(DB.empty,DB.empty) (CoercDb.to_list ())
;;
-(* XXX saturate takes no subst!!!! *)
-let look_for_coercion (db_src,db_tgt) metasenv _subst context infty expty =
+let look_for_coercion (db_src,db_tgt) metasenv subst context infty expty =
let set_src = DB.retrieve_unifiables db_src infty in
let set_tgt = DB.retrieve_unifiables db_tgt expty in
let candidates = CoercionSet.inter set_src set_tgt in
(fun (t,arity,arg) ->
let ty = NCicTypeChecker.typeof ~metasenv:[] ~subst:[] [] t in
let ty, metasenv, args =
- NCicMetaSubst.saturate ~delta:max_int metasenv context ty arity
+ NCicMetaSubst.saturate ~delta:max_int metasenv subst context ty arity
in
prerr_endline (
NCicPp.ppterm ~metasenv ~subst:[] ~context:[] ty ^ " --- " ^
- NCicPp.ppterm ~metasenv ~subst:_subst ~context
+ NCicPp.ppterm ~metasenv ~subst ~context
(NCicUntrusted.mk_appl t args) ^ " --- " ^
string_of_int (List.length args) ^ " == " ^ string_of_int arg);
metasenv, NCicUntrusted.mk_appl t args, ty, List.nth args arg)