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 ()
44 Predefined_virtuals.load_predefined_virtuals ();
45 Predefined_virtuals.load_predefined_classes ()
49 let init_debugging_menu gui =
50 if BuildTimeConf.debug ||
51 Helm_registry.get_bool "matita.debug_menu"
53 gui#main#debugMenu#misc#show ();
54 let addDebugItem label callback =
56 GMenu.menu_item ~packing:gui#main#debugMenu_menu#append ~label () in
57 ignore (item#connect#activate callback)
59 let addDebugCheckbox label ?(init=false) callback =
62 ~packing:gui#main#debugMenu_menu#append ~label () in
64 ignore (item#connect#toggled (callback item))
66 let addDebugSeparator () =
67 ignore (GMenu.separator_item ~packing:gui#main#debugMenu_menu#append ())
69 addDebugItem "dump aliases" (fun _ ->
70 let status = (MatitaScript.current ())#status in
71 GrafiteDisambiguate.dump_aliases prerr_endline "" status);
73 addDebugItem "dump interpretations" (fun _ ->
74 let status = script#lexicon_status in
76 List.filter (function LexiconAst.Interpretation _ -> true | _ -> false)
78 HLog.debug (String.concat "\n"
80 (fun x l -> (LexiconAstPp.pp_command x)::l)
81 (filter status.LexiconEngine.lexicon_content_rev) [])));
84 addDebugCheckbox "high level pretty printer" ~init:true
85 (fun mi () -> ApplyTransformation.use_high_level_pretty_printer := mi#active);
87 addDebugCheckbox "prune errors"
88 (fun mi () -> MatitaGui.all_disambiguation_passes := not (mi#active));
89 (*MATITA 1.0: ??? addDebugItem "prune disambiguation errors"
90 (fun _ -> MatitaGui.all_disambiguation_passes := false);*)
91 addDebugCheckbox "multiple disambiguation passes" ~init:true
92 (fun mi () -> MultiPassDisambiguator.only_one_pass := mi#active);
94 addDebugCheckbox "tactics logging"
95 (fun mi () -> NTacStatus.debug := mi#active);
96 addDebugCheckbox "disambiguation/refiner/unification/metasubst logging"
97 (fun mi () -> NCicRefiner.debug := mi#active; NCicUnification.debug :=
98 mi#active; MultiPassDisambiguator.debug := mi#active; NCicMetaSubst.debug := mi#active);
99 addDebugCheckbox "reduction logging"
100 (fun mi () -> NCicReduction.debug := mi#active);
101 addDebugSeparator ();
102 addDebugItem "Expand virtuals"
103 (fun _ -> (MatitaScript.current ())#expandAllVirtuals);
110 at_exit (fun () -> print_endline "\nThanks for using Matita!\n");
111 Sys.catch_break true;
112 let args = Helm_registry.get_list Helm_registry.string "matita.args" in
113 let gui = MatitaGui.instance () in
114 init_debugging_menu gui;
115 List.iter gui#loadScript (List.rev args);
116 gui#main#mainWin#show ();
122 (* vim:set foldmethod=marker: *)