-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 _ = MetadataDb.clean ~dbd ~owner:(Helm_registry.get "matita.owner")
-let gui = MatitaGui.instance ()
-let disambiguator =
- new MatitaDisambiguator.disambiguator ~parserr ~dbd
- ~chooseUris:(interactive_user_uri_choice ~gui)
- ~chooseInterp:(interactive_interp_choice ~gui)
- ()
-
-let currentProof = new MatitaProof.currentProof
-
-let sequent_viewer = MatitaMathView.sequent_viewer ~show:true ()
-let sequents_viewer =
- let set_goal goal =
- if not (currentProof#onGoing ()) then assert false;
- currentProof#proof#set_goal goal
- in
- MatitaMathView.sequents_viewer ~notebook:gui#main#sequentsNotebook
- ~sequent_viewer ~set_goal ()
-let _ = (* attach observers to proof status *)
- let browser_observer _ _ = MatitaMathView.refresh_all_browsers () 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
- currentProof#addObserver sequents_observer;
- currentProof#addObserver browser_observer;
- currentProof#connect `Quit (fun () ->
- (* quit program, asking for confirmation if needed *)
- if not (currentProof#onGoing ()) ||
- (ask_confirmation ~gui
- ~msg:("Proof in progress, are you sure you want to quit?") ())
- then
- GMain.Main.quit ();
- false);
- currentProof#connect `Abort (fun () -> sequents_viewer#reset; false)