]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_refiner/nCicUnifHint.ml
First pretty printing functions
[helm.git] / helm / software / components / ng_refiner / nCicUnifHint.ml
index ae186cc6317b2901f998ef55c5c77fb4c5b82782..b7d2b67d7642c87e5a30bed87eead2d74a7fd85f 100644 (file)
@@ -149,7 +149,7 @@ let saturate ?(delta=0) metasenv subst context ty goal_arity =
  assert (goal_arity >= 0);
   let rec aux metasenv = function
    | NCic.Prod (name,s,t) as ty ->
-       let metasenv1, arg,_ = 
+       let metasenv1, _, arg,_ = 
           NCicMetaSubst.mk_meta ~name:name metasenv context (`WithType s) in
        let t, metasenv1, args, pno = 
            aux metasenv1 (NCicSubstitution.subst arg t) 
@@ -196,7 +196,8 @@ let look_for_hint hdb metasenv subst context t1 t2 =
          let rec aux () (m,l as acc) = function
            | NCic.Meta _ as t -> acc, t
            | NCic.LetIn (name,ty,bo,t) ->
-               let m,i,_=NCicMetaSubst.mk_meta ~name m context (`WithType ty)in
+               let m,_,i,_=
+                 NCicMetaSubst.mk_meta ~name m context (`WithType ty)in
                let t = NCicSubstitution.subst i t in
                aux () (m, (i,bo)::l) t
            | t -> NCicUntrusted.map_term_fold_a (fun _ () -> ()) () aux acc t
@@ -208,8 +209,8 @@ let look_for_hint hdb metasenv subst context t1 t2 =
   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
@@ -218,17 +219,19 @@ let look_for_hint hdb metasenv subst context t1 t2 =
   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