1 (* Copyright (C) 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/
26 type thingsToInitilaize =
27 ConfigurationFile | Db | Environment | Getter | Notation |
28 Paramodulation | Makelib
30 exception FailedToInitialize of thingsToInitilaize
35 if not (List.exists (fun x -> x = item) l) then
36 raise (FailedToInitialize item))
39 let already_configured s l =
40 List.for_all (fun item -> List.exists (fun x -> x = item) l) s
42 let load_configuration init_status =
43 if not (already_configured [ConfigurationFile] init_status) then
45 Helm_registry.load_from BuildTimeConf.matita_conf;
46 ConfigurationFile::init_status
51 let initialize_db init_status =
52 wants [ConfigurationFile] init_status;
53 if not (already_configured [Db] init_status) then
55 MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
56 MatitaDb.create_owner_environment ();
62 let initialize_paramodulation init_status =
64 if not (already_configured [Paramodulation] init_status) then
66 Paramodulation.Saturation.init ();
67 Paramodulation::init_status
72 let initialize_makelib init_status =
73 wants [ConfigurationFile] init_status;
74 if not (already_configured [Makelib] init_status) then
76 MatitamakeLib.initialize ();
82 let initialize_notation init_status =
83 wants [ConfigurationFile] init_status;
84 if not (already_configured [Notation] init_status) then
86 CicNotation.load_notation BuildTimeConf.core_notation_script;
92 let initialize_environment init_status =
93 wants [ConfigurationFile] init_status;
94 if not (already_configured [Getter;Environment] init_status) then
97 CicEnvironment.set_trust (* environment trust *)
98 (let trust = Helm_registry.get_bool "matita.environment_trust" in
100 Getter::Environment::init_status
107 let initialize_all () =
110 (initialize_environment
112 (initialize_paramodulation
114 (load_configuration !status)))))
116 let load_config_only () =
117 status := load_configuration !status
119 let initialize_notation () =
120 status := initialize_notation (load_configuration !status)