in
let coerced_args,metasenv',subst',t',ugraph2 =
eat_prods metasenv subst context
- (CicSubstitution.subst arg t) ugraph1 tl
+ (CicSubstitution.subst arg t) ugraph1 tl
in
arg::coerced_args,metasenv',subst',t',ugraph2
| _ -> assert false
fo_unif_subst_exp_named_subst test_equality_only subst context metasenv
exp_named_subst1 exp_named_subst2 ugraph
else
- raise (UnificationFailure (lazy "3"))
- (* (sprintf
+ raise (UnificationFailure (lazy
+ (sprintf
"Can't unify %s with %s due to different constants"
(CicMetaSubst.ppterm subst t1)
- (CicMetaSubst.ppterm subst t2))) *)
+ (CicMetaSubst.ppterm subst t2))))
| C.MutInd (uri1,i1,exp_named_subst1),C.MutInd (uri2,i2,exp_named_subst2) ->
if UriManager.eq uri1 uri2 && i1 = i2 then
fo_unif_subst_exp_named_subst
(try
let ty_t1,_ = type_of_aux' metasenv subst context t1 ugraph in
CicPp.ppterm ty_t1
- with _ -> "MALFORMED")
+ with
+ | UnificationFailure s
+ | Uncertain s
+ | AssertFailure s -> sprintf "MALFORMED(t1): \n<BEGIN>%s\n<END>" (Lazy.force s))
(CicMetaSubst.ppterm subst t2)
(try
let ty_t2,_ = type_of_aux' metasenv subst context t2 ugraph in
CicPp.ppterm ty_t2
- with _ -> "MALFORMED")
+ with
+ | UnificationFailure s
+ | Uncertain s
+ | AssertFailure s -> sprintf "MALFORMED(t2): \n<BEGIN>%s\n<END>" (Lazy.force s))
(CicMetaSubst.ppcontext subst context)
(CicMetaSubst.ppmetasenv subst metasenv)
(CicMetaSubst.ppsubst subst) (Lazy.force msg))
let name_of_carr = function
| Uri u -> UriManager.name_of_uri u
| Sort s -> CicPp.ppsort s
- | Term _ -> assert false
+ | Term t -> CicPp.ppterm t
let to_list () =
(fun (s,t) -> CoercDb.eq_carr s src && CoercDb.eq_carr t tgt)
in
match l with
- | [] -> debug_print (lazy ":( coercion non trovata"); NoCoercion
+ | [] ->
+ debug_print
+ (lazy
+ (sprintf ":-( coercion non trovata da %s a %s"
+ (CoercDb.name_of_carr src)
+ (CoercDb.name_of_carr tgt)));
+ NoCoercion
+ | [u] ->
+ debug_print (lazy (
+ sprintf ":-) TROVATA 1 coercion da %s a %s: %s"
+ (CoercDb.name_of_carr src)
+ (CoercDb.name_of_carr tgt)
+ (UriManager.name_of_uri u)));
+ SomeCoercion (CicUtil.term_of_uri u)
| u::_ ->
debug_print (lazy (
- sprintf ":) TROVATE %d coercion(s) da %s a %s, prendo la prima: %s"
+ sprintf ":-/ TROVATE %d coercion(s) da %s a %s, prendo la prima: %s"
(List.length l)
(CoercDb.name_of_carr src)
(CoercDb.name_of_carr tgt)