status, src, tgt, cpos, arity
;;
+let basic_eval_and_inject_ncoercion infos status =
+ let status = basic_eval_ncoercion infos status in
+ let dump = inject_ncoercion infos::status#dump in
+ status#set_dump dump
+;;
+
let eval_ncoercion status name t ty (id,src) tgt =
let metasenv,subst,status,ty =
let t = NCicUntrusted.apply_subst subst [] t in
let status, src, tgt, cpos, arity =
- src_tgt_cpos_arity_of_ty_id_src_tgt status ty id src tgt
+ src_tgt_cpos_arity_of_ty_id_src_tgt status ty id src tgt in
+ let status =
+ basic_eval_and_inject_ncoercion (name,t,src,tgt,cpos,arity) status
in
-
- let status = basic_eval_ncoercion (name,t,src,tgt,cpos,arity) status in
- let dump = inject_ncoercion (name,t,src,tgt,cpos,arity)::status#dump in
- let status = status#set_dump dump in
status,`New []
;;
let status =
List.fold_left
(fun status (name,cpos,arity) ->
- (*CSC: COME DICHIARO LA COERCION??? *)
- status
+ let metasenv,subst,status,t =
+ GrafiteDisambiguate.disambiguate_nterm None status [] [] []
+ ("",0,CicNotationPt.Ident (name,None)) in
+ assert (metasenv = [] && subst = []);
+ let ty = NCicTypeChecker.typeof ~subst ~metasenv [] t in
+ let src,tgt = src_tgt_of_ty_cpos_arity ty cpos arity in
+prerr_endline ("COERCION " ^ name ^ " cpos = " ^ string_of_int cpos ^ " arity = " ^ string_of_int arity);
+ basic_eval_and_inject_ncoercion (name,t,src,tgt,cpos,arity)
+ status
) status coercions
in
status,uris