]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matita.ml
.ma inclusions corrected/minimized
[helm.git] / helm / matita / matita.ml
index 610f22a4ec7943d6b3b53e7117fb10e9b5b1958b..38c161424850decc0e3fddde508bcb78ade0c0f2 100644 (file)
@@ -29,9 +29,6 @@ open MatitaGtkMisc
 open MatitaTypes
 open MatitaMisc
 
-(* ALB to link paramodulation... *)
-let _ = Paramodulation.Saturation.init ()
-
 (** {2 Initialization} *)
 
 let _ =
@@ -43,7 +40,8 @@ let _ =
   MatitamakeLib.initialize ();
   CicEnvironment.set_trust (* environment trust *)
     (let trust = Helm_registry.get_bool "matita.environment_trust" in
-     fun _ -> trust)
+     fun _ -> trust);
+  Paramodulation.Saturation.init ()
 
 (** {2 GUI callbacks} *)
 
@@ -82,6 +80,7 @@ let script =
 let _ =
   let cic_math_view = MatitaMathView.cicMathView_instance () in
   let sequents_viewer = MatitaMathView.sequentsViewer_instance () in
+  sequents_viewer#load_logo;
   cic_math_view#set_href_callback
     (Some (fun uri -> (MatitaMathView.cicBrowser ())#load
       (`Uri (UriManager.uri_of_string uri))));
@@ -92,17 +91,14 @@ let _ =
     | Incomplete_proof ((proof, goal) as status) ->
         sequents_viewer#load_sequents status;
         sequents_viewer#goto_sequent goal
-    | Proof proof -> 
-        prerr_endline "sequents_viewer#load_logo_with_qed (no proof)"; ()
-    | No_proof -> 
-        prerr_endline "sequents_viewer#load_logo (no proof)"; ()
-    | Intermediate _ -> 
-        assert false (* only the engine may be in this state *)
+    | Proof proof -> sequents_viewer#load_logo_with_qed
+    | No_proof -> sequents_viewer#load_logo
+    | Intermediate _ -> assert false (* only the engine may be in this state *)
   in
   script#addObserver sequents_observer;
   script#addObserver browser_observer
 
-  (** <DEBUGGING> *)
+  (** {{{ Debugging *)
 let _ =
   if BuildTimeConf.debug then begin
     gui#main#debugMenu#misc#show ();
@@ -140,7 +136,7 @@ let _ =
     addDebugItem "dump metasenv"
       (fun _ ->
          if script#onGoingProof () then
-           MatitaLog.debug (CicMetaSubst.ppmetasenv script#proofMetasenv []));
+           MatitaLog.debug (CicMetaSubst.ppmetasenv [] script#proofMetasenv));
     addDebugItem "dump coercions Db" (fun _ ->
       List.iter
         (fun (s,t,u) -> 
@@ -148,13 +144,18 @@ let _ =
             (UriManager.name_of_uri u ^ ":"
              ^ UriManager.name_of_uri s ^ " -> " ^ UriManager.name_of_uri t))
         (CoercDb.to_list ()));
+    addDebugItem "print top-level grammar entries"
+      CicNotationParser.print_l2_pattern;
+    addDebugItem "dump moo to stderr" (fun _ ->
+      let status = (MatitaScript.instance ())#status in
+      List.iter (fun cmd -> prerr_endline
+        (GrafiteAstPp.pp_command cmd)) (List.rev status.moo_content_rev));
     addDebugItem "rotate light bulbs"
       (fun _ ->
          let nb = gui#main#hintNotebook in
-         nb#goto_page ((nb#current_page + 1) mod 3))
+         nb#goto_page ((nb#current_page + 1) mod 3));
   end
-
-  (** </DEBUGGING> *)
+  (** Debugging }}} *)
 
 let _ =
   at_exit (fun () -> print_endline "\nThanks for using Matita!\n");
@@ -162,12 +163,12 @@ let _ =
   if Filename.basename Sys.argv.(0) = "cicbrowser" then begin (* cicbrowser *)
     Helm_registry.set "matita.mode" "cicbrowser";
     let browser = MatitaMathView.cicBrowser () in
-    let entry =
+    let uri =
       try
-        `Uri (UriManager.uri_of_string Sys.argv.(1))
-      with Invalid_argument _ -> `Dir "cic:/"
+        String.concat " " (List.tl (Array.to_list Sys.argv))
+      with Failure _ -> "cic:/"
     in
-    browser#load entry
+    browser#loadInput uri
   end else begin  (* matita *)
     Helm_registry.set "matita.mode" "matita";
     (try
@@ -179,3 +180,4 @@ let _ =
     GtkThread.main ()
   with Sys.Break -> ()
 
+(* vim:set foldmethod=marker: *)