let rc =
List.map
(function
- | (prec,true,(NCic.Appl [_; t1; t2],metasenv,l))-> prec,metasenv, (t1,t2),l
- | (prec,false,(NCic.Appl [_; t1; t2],metasenv,l))-> prec,metasenv, (t2,t1),l
+ | (prec,true,(NCic.Appl [_; t1; t2],metasenv,l))-> prec,metasenv,(t1,t2),l
+ | (prec,false,(NCic.Appl [_; t1; t2],metasenv,l))-> prec,metasenv,(t2,t1),l
| _ -> assert false)
rc
in
in
let rc = List.map (fun (_,x,y,z) -> x,y,z) rc in
(*
+ prerr_endline "Hints:";
List.iter
(fun (metasenv, (t1, t2), premises) ->
prerr_endline
- (String.concat "\n"
- (List.map (fun (a,b) ->
- NCicPp.ppterm ~metasenv ~subst ~context a ^
- " =?= "^NCicPp.ppterm ~metasenv ~subst ~context b)
+ ("\t" ^ String.concat "; "
+ (List.map (fun (a,b) ->
+ NCicPp.ppterm ~margin:max_int ~metasenv ~subst ~context a ^
+ " =?= "^
+ NCicPp.ppterm ~margin:max_int ~metasenv ~subst ~context b)
premises) ^
- "\n--------------------------------------------------"^
- "\n"^NCicPp.ppterm ~metasenv ~subst ~context t1 ^
- " = "^NCicPp.ppterm ~metasenv ~subst ~context t2 ^ "\n\n"))
+ " ==> "^
+ NCicPp.ppterm ~margin:max_int ~metasenv ~subst ~context t1 ^
+ " = "^NCicPp.ppterm ~margin:max_int ~metasenv ~subst ~context t2))
rc;
*)
rc
in
let try_hints metasenv subst t1 t2 (* exc*) =
(*
- prerr_endline ("\n\n\n looking for hints for : " ^
- NCicPp.ppterm ~metasenv ~subst ~context t1 ^ " ==?== " ^
- NCicPp.ppterm ~metasenv ~subst ~context t2);
+ prerr_endline ("\nProblema:\n" ^
+ NCicPp.ppterm ~metasenv ~subst ~context t1 ^ " =?= " ^
+ NCicPp.ppterm ~metasenv ~subst ~context t2);
*)
let candidates =
NCicUnifHint.look_for_hint hdb metasenv subst context t1 t2
| [] -> None (* raise exc *)
| (metasenv,(c1,c2),premises)::tl ->
(*
- prerr_endline ("\n attempt: " ^
- NCicPp.ppterm ~metasenv ~subst ~context t1 ^ " ==?== " ^
- NCicPp.ppterm ~metasenv ~subst ~context c1 ^ " AND " ^
- NCicPp.ppterm ~metasenv ~subst ~context c2 ^ " ==?== " ^
- NCicPp.ppterm ~metasenv ~subst ~context t2);
+ prerr_endline ("\nProvo il candidato:\n" ^
+ String.concat "\n"
+ (List.map
+ (fun (a,b) ->
+ NCicPp.ppterm ~metasenv ~subst ~context a ^ " =?= " ^
+ NCicPp.ppterm ~metasenv ~subst ~context b) premises) ^
+ "\n-------------------------------------------\n"^
+ NCicPp.ppterm ~metasenv ~subst ~context c1 ^ " = " ^
+ NCicPp.ppterm ~metasenv ~subst ~context c2);
*)
try
let metasenv,subst =
Some (metasenv, subst)
with
UnificationFailure _ | Uncertain _ ->
- prerr_endline (" <candidate fails");
cand_iter tl
in
cand_iter candidates