1 (* Copyright (C) 2004-2005, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
33 (** {2 Initialization} *)
36 MatitaInit.add_cmdline_spec
37 ["-tptppath",Arg.String
38 (fun s -> Helm_registry.set_string "matita.tptppath" s),
39 "Where to find the Axioms/ and Problems/ directory"];
40 MatitaInit.initialize_all ();
41 MatitaMisc.reset_font_size ()
45 Predefined_virtuals.load_predefined_virtuals ();
46 Predefined_virtuals.load_predefined_classes ()
50 let init_debugging_menu gui =
51 if BuildTimeConf.debug ||
52 Helm_registry.get_bool "matita.debug_menu"
54 gui#main#debugMenu#misc#show ();
55 let addDebugItem label callback =
57 GMenu.menu_item ~packing:gui#main#debugMenu_menu#append ~label () in
58 ignore (item#connect#activate callback)
60 let addDebugCheckbox label ?(init=false) callback =
63 ~packing:gui#main#debugMenu_menu#append ~label () in
65 ignore (item#connect#toggled (callback item))
67 let addDebugSeparator () =
68 ignore (GMenu.separator_item ~packing:gui#main#debugMenu_menu#append ())
70 addDebugItem "dump aliases" (fun _ ->
71 let status = (MatitaScript.current ())#status in
72 GrafiteDisambiguate.dump_aliases prerr_endline "" status);
74 addDebugItem "dump interpretations" (fun _ ->
75 let status = script#lexicon_status in
77 List.filter (function LexiconAst.Interpretation _ -> true | _ -> false)
79 HLog.debug (String.concat "\n"
81 (fun x l -> (LexiconAstPp.pp_command x)::l)
82 (filter status.LexiconEngine.lexicon_content_rev) [])));
85 addDebugCheckbox "high level pretty printer" ~init:true
86 (fun mi () -> ApplyTransformation.use_high_level_pretty_printer := mi#active);
88 addDebugCheckbox "prune errors"
89 (fun mi () -> MatitaGui.all_disambiguation_passes := not (mi#active));
90 (*MATITA 1.0: ??? addDebugItem "prune disambiguation errors"
91 (fun _ -> MatitaGui.all_disambiguation_passes := false);*)
92 addDebugCheckbox "multiple disambiguation passes" ~init:true
93 (fun mi () -> MultiPassDisambiguator.only_one_pass := mi#active);
95 addDebugCheckbox "tactics logging"
96 (fun mi () -> NTacStatus.debug := mi#active);
97 addDebugCheckbox "disambiguation logging"
98 (fun mi () -> MultiPassDisambiguator.debug := mi#active; NCicDisambiguate.debug := mi#active);
99 addDebugCheckbox "disambiguation/refiner/unification/metasubst logging"
100 (fun mi () -> NCicRefiner.debug := mi#active; NCicUnification.debug :=
101 mi#active; MultiPassDisambiguator.debug := mi#active; NCicDisambiguate.debug := mi#active; NCicMetaSubst.debug := mi#active);
102 addDebugCheckbox "reduction logging"
103 (fun mi () -> NCicReduction.debug := mi#active);
104 addDebugSeparator ();
105 addDebugItem "Expand virtuals"
106 (fun _ -> (MatitaScript.current ())#expandAllVirtuals);
113 at_exit (fun () -> print_endline "\nThanks for using Matita!\n");
114 Sys.catch_break true;
115 let args = Helm_registry.get_list Helm_registry.string "matita.args" in
116 let gui = MatitaGui.instance () in
117 init_debugging_menu gui;
118 List.iter gui#loadScript (List.rev args);
119 gui#main#mainWin#show ();
125 (* vim:set foldmethod=marker: *)