]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/disambiguate.ml
Wrong reported error message fixed.
[helm.git] / helm / ocaml / cic_disambiguation / disambiguate.ml
index c8016c0bae5b15df6441de6a1358572caf1eb295..de3701e23401e8cec86445ce5ecbbb4a041a9337 100644 (file)
@@ -68,13 +68,13 @@ let refine_term metasenv context uri term ugraph =
        CicRefine.type_of_aux' metasenv context term ugraph in
        (Ok (term', metasenv')),ugraph1
     with
-      | CicRefine.Uncertain s ->
-          debug_print (lazy ("UNCERTAIN!!! [" ^ (Lazy.force s) ^ "] " ^ CicPp.ppterm term)) ;
-          Uncertain s,ugraph
+      | CicRefine.Uncertain msg ->
+          debug_print (lazy ("UNCERTAIN!!! [" ^ (Lazy.force msg) ^ "] " ^ CicPp.ppterm term)) ;
+          Uncertain (lazy ("Uncertain trying to refine: " ^ CicPp.ppterm term ^ "\n" ^ Lazy.force msg)),ugraph
       | CicRefine.RefineFailure msg ->
           debug_print (lazy (sprintf "PRUNED!!!\nterm%s\nmessage:%s"
             (CicPp.ppterm term) (Lazy.force msg)));
-          Ko msg,ugraph
+          Ko (lazy ("Error trying to refine: " ^ CicPp.ppterm term ^ "\n" ^ Lazy.force msg)),ugraph
 
 let refine_obj metasenv context uri obj ugraph =
  assert (context = []);
@@ -83,13 +83,13 @@ let refine_obj metasenv context uri obj ugraph =
      let obj', metasenv,ugraph = CicRefine.typecheck metasenv uri obj in
        (Ok (obj', metasenv)),ugraph
    with
-     | CicRefine.Uncertain s ->
-         debug_print (lazy ("UNCERTAIN!!! [" ^ (Lazy.force s) ^ "] " ^ CicPp.ppobj obj)) ;
-         Uncertain s,ugraph
+     | CicRefine.Uncertain msg ->
+         debug_print (lazy ("UNCERTAIN!!! [" ^ (Lazy.force msg) ^ "] " ^ CicPp.ppobj obj)) ;
+         Uncertain (lazy ("Uncertain trying to refine: " ^ CicPp.ppobj obj ^ "\n" ^ Lazy.force msg)),ugraph
      | CicRefine.RefineFailure msg ->
          debug_print (lazy (sprintf "PRUNED!!!\nterm%s\nmessage:%s"
            (CicPp.ppobj obj) (Lazy.force msg))) ;
-         Ko msg,ugraph
+         Ko (lazy ("Error trying to refine: " ^ CicPp.ppobj obj ^ "\n" ^ Lazy.force msg)),ugraph
 
 let resolve (env: codomain_item Environment.t) (item: domain_item) ?(num = "") ?(args = []) () =
   try
@@ -803,7 +803,7 @@ in refine_profiler.HExtlib.profile foo ()
         | Invalid_choice msg -> Ko msg, ugraph
       in
       (* (4) build all possible interpretations *)
-      let (@@) (l1,l2) (l1',l2') = l1@l1, l2@l2' in
+      let (@@) (l1,l2) (l1',l2') = l1@l1', l2@l2' in
       let rec aux aliases diff lookup_in_todo_dom todo_dom base_univ =
         match todo_dom with
         | [] ->