]> matita.cs.unibo.it Git - helm.git/commitdiff
I added some debugging information
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Tue, 26 Feb 2008 17:23:37 +0000 (17:23 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Tue, 26 Feb 2008 17:23:37 +0000 (17:23 +0000)
helm/software/components/grafite_parser/grafiteDisambiguate.ml

index ca3bc0b90592bb623e5d1199903afadc6c39573e..308144c21a6826e6a5d2952cdb24e977825a5e3e 100644 (file)
@@ -36,16 +36,20 @@ type lazy_tactic =
   (Cic.term, Cic.lazy_term, Cic.lazy_term GrafiteAst.reduction, string) 
     GrafiteAst.tactic
 
-let singleton = function
+let singleton msg = function
   | [x], _ -> x
-  | _ -> assert false
-;;
+  | l, _   ->
+      let debug = 
+         Printf.sprintf "GrafiteDisambiguate.singleton (%s): %u interpretations"
+        msg (List.length l)
+      in
+      HLog.debug debug; assert false
 
   (** @param term not meaningful when context is given *)
 let disambiguate_term text prefix_len lexicon_status_ref context metasenv term =
   let lexicon_status = !lexicon_status_ref in
   let (diff, metasenv, cic, _) =
-    singleton
+    singleton "first"
       (GrafiteDisambiguator.disambiguate_term ~dbd:(LibraryDb.instance ())
         ~aliases:lexicon_status.LexiconEngine.aliases
         ~universe:(Some lexicon_status.LexiconEngine.multi_aliases)
@@ -65,7 +69,7 @@ let disambiguate_lazy_term text prefix_len lexicon_status_ref term =
   (fun context metasenv ugraph ->
     let lexicon_status = !lexicon_status_ref in
     let (diff, metasenv, cic, ugraph) =
-      singleton
+      singleton "second"
         (GrafiteDisambiguator.disambiguate_term ~dbd:(LibraryDb.instance ())
           ~initial_ugraph:ugraph ~aliases:lexicon_status.LexiconEngine.aliases
           ~universe:(Some lexicon_status.LexiconEngine.multi_aliases)
@@ -418,7 +422,7 @@ let disambiguate_obj lexicon_status ?baseuri metasenv (text,prefix_len,obj) =
     | CicNotationPt.Inductive _ -> assert false
     | CicNotationPt.Theorem _ -> None in
   let (diff, metasenv, cic, _) =
-    singleton
+    singleton "third"
       (GrafiteDisambiguator.disambiguate_obj ~dbd:(LibraryDb.instance ())
         ~aliases:lexicon_status.LexiconEngine.aliases
         ~universe:(Some lexicon_status.LexiconEngine.multi_aliases) ~uri