- Helm_registry.load_from "matita.conf.xml";
- GtkMain.Rc.add_default_file BuildTimeConf.gtkrc;
- GMain.Main.init ()
-let parserr = new MatitaDisambiguator.parserr ()
-let dbd =
- Mysql.quick_connect
- ~host:(Helm_registry.get "db.host")
- ~user:(Helm_registry.get "db.user")
- ~database:(Helm_registry.get "db.database")
- ()
-let gui = MatitaGui.instance ()
-let disambiguator =
- new MatitaDisambiguator.disambiguator ~parserr ~dbd
- ~chooseUris:(interactive_user_uri_choice ~gui)
- ~chooseInterp:(interactive_interp_choice ~gui)
- ()
-let proof_viewer = MatitaMathView.proof_viewer_instance ()
-let sequent_viewer = MatitaMathView.sequent_viewer ~show:true ()
-let sequents_viewer =
- let set_goal goal =
- if not (has_proof ()) then assert false;
- (get_proof ())#set_goal goal
- in
- MatitaMathView.sequents_viewer ~notebook:gui#main#sequentsNotebook
- ~sequent_viewer ~set_goal ()
-
-let new_proof (proof: MatitaTypes.proof) =
- let proof_observer _ (status, ()) =
- let ((uri_opt, _, _, _), _) = status in
- proof_viewer#load_proof status;
- in
- let sequents_observer _ (((_, metasenv, _, _), goal_opt), ()) =
- sequents_viewer#reset;
- (match goal_opt with
- | None -> ()
- | Some goal ->
- sequents_viewer#load_sequents metasenv;
- sequents_viewer#goto_sequent goal)
- in
- ignore (proof#attach_observer ~interested_in:StatefulProofEngine.all_events
- sequents_observer);
- ignore (proof#attach_observer ~interested_in:StatefulProofEngine.all_events
- proof_observer);
- proof#notify;
- set_proof (Some proof)
-
-let quit () = (* quit program, asking for confirmation if needed *)
- if not (has_proof ()) ||
- (ask_confirmation ~gui
- ~msg:("Proof in progress, are you sure you want to quit?") ())
- then
- GMain.Main.quit ()
-
-let abort_proof () =
- if has_proof () then begin
- set_proof None;
- sequents_viewer#reset
- end
-
-let proof_handler =
- { MatitaTypes.get_proof = get_proof;
- MatitaTypes.abort_proof = abort_proof;
- MatitaTypes.set_proof = set_proof;
- MatitaTypes.has_proof = has_proof;
- MatitaTypes.new_proof = new_proof;
- MatitaTypes.quit = quit;
- }
-
-let interpreter =
- let console = gui#console in
- new MatitaInterpreter.interpreter ~disambiguator ~proof_handler ~console ()
+ Helm_registry.load_from BuildTimeConf.matita_conf;
+ CicNotation.load_notation BuildTimeConf.core_notation_script;
+ Http_getter.init ();
+ MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
+ MatitaDb.create_owner_environment ();
+ MatitamakeLib.initialize ();
+ CicEnvironment.set_trust (* environment trust *)
+ (let trust = Helm_registry.get_bool "matita.environment_trust" in
+ fun _ -> trust)