X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita.ml;h=6e9fa5f2395c2b3cec668f3b78bacbc0d7b1ad02;hb=216686b3739474d279c87892892af82c5ea5aec3;hp=58b7de9f34c2a9f02d94b39cc0ac589e5d0ecc8d;hpb=2128fab91157cc06157cede44f8aa95a1acd453d;p=helm.git diff --git a/matita/matita.ml b/matita/matita.ml index 58b7de9f3..6e9fa5f23 100644 --- a/matita/matita.ml +++ b/matita/matita.ml @@ -32,7 +32,14 @@ open GrafiteTypes (** {2 Initialization} *) -let _ = MatitaInit.initialize_all () +let _ = + MatitaInit.add_cmdline_spec + ["-tptppath",Arg.String + (fun s -> Helm_registry.set_string "matita.tptppath" s), + "Where to find the Axioms/ and Problems/ directory"]; + MatitaInit.initialize_all () +;; + (* let _ = Saturation.init () (* ALB to link paramodulation *) *) (** {2 GUI callbacks} *) @@ -149,6 +156,31 @@ let _ = (MatitaScript.current ())#proofMetasenv)); prerr_endline ("stack: " ^ Continuationals.Stack.pp (GrafiteTypes.get_stack (MatitaScript.current ())#grafite_status))); + addDebugItem "Print current proof term" + (fun _ -> + HLog.debug + (CicPp.ppterm + (match + (MatitaScript.current ())#grafite_status.GrafiteTypes.proof_status + with + | GrafiteTypes.No_proof -> (Cic.Implicit None) + | Incomplete_proof i -> let _,_,p,_ = i.GrafiteTypes.proof in p + | Proof p -> let _,_,p,_ = p in p + | Intermediate _ -> assert false))); + addDebugItem "Print current proof (natural language) to stderr" + (fun _ -> + prerr_endline + (ObjPp.obj_to_string 120 + (match + (MatitaScript.current ())#grafite_status.GrafiteTypes.proof_status + with + | GrafiteTypes.No_proof -> assert false + | Incomplete_proof i -> + let _,m,p,ty = i.GrafiteTypes.proof in + Cic.CurrentProof ("current (incomplete) proof",m,p,ty,[],[]) + | Proof (_,m,p,ty) -> + Cic.CurrentProof ("current proof",m,p,ty,[],[]) + | Intermediate _ -> assert false))); (* addDebugItem "ask record choice" (fun _ -> HLog.debug (string_of_int @@ -176,26 +208,19 @@ let _ = (fun _ -> GrafiteDisambiguator.only_one_pass := true); addDebugSeparator (); addDebugItem "enable coercions hiding" - (fun _ -> TermAcicContent.hide_coercions := true); + (fun _ -> Acic2content.hide_coercions := true); addDebugItem "disable coercions hiding" - (fun _ -> TermAcicContent.hide_coercions := false); + (fun _ -> Acic2content.hide_coercions := false); + addDebugItem "show coercions graph" (fun _ -> + let c = MatitaMathView.cicBrowser () in + c#load (`About `Coercions)); addDebugItem "dump coercions Db" (fun _ -> List.iter - (fun (s,t,u) -> + (fun (s,t,ul) -> HLog.debug - (UriManager.name_of_uri u ^ ":" + ((String.concat "," (List.map UriManager.name_of_uri ul)) ^ ":" ^ CoercDb.name_of_carr s ^ " -> " ^ CoercDb.name_of_carr t)) (CoercDb.to_list ())); - addDebugItem "show coercions graph" (fun _ -> - let str = CoercGraph.generate_dot_file () in - let filename, oc = Filename.open_temp_file "xx" ".dot" in - output_string oc str; - close_out oc; - let ps = Filename.temp_file "yy" ".png" in - ignore (Unix.system ("/usr/bin/dot -Tpng -o" ^ ps ^ " " ^ filename)); - ignore (Unix.system ("/usr/bin/display " ^ ps)); - Sys.remove ps; - Sys.remove filename); addDebugSeparator (); let mview () = (MatitaMathView.sequentsViewer_instance ())#cicMathView in (* addDebugItem "save (sequent) MathML to matita.xml" @@ -234,6 +259,18 @@ let _ = end; try GtkThread.main () - with Sys.Break -> () + with Sys.Break -> + Sys.set_signal Sys.sigint + (Sys.Signal_handle + (fun _ -> + prerr_endline "Still cleaning the library: don't be impatient!")); + prerr_endline "Matita is cleaning up. Please wait."; + try + let baseuri = + GrafiteTypes.get_string_option + (MatitaScript.current ())#grafite_status "baseuri" + in + LibraryClean.clean_baseuris [baseuri] + with GrafiteTypes.Option_error _ -> () (* vim:set foldmethod=marker: *)