- gui#setQuitCallback currentProof#quit;
- gui#setPhraseCallback console_callback;
- gui#main#debugMenu#misc#hide ();
- ignore (gui#main#newProofMenuItem#connect#activate (fun _ ->
- gui#console#clear ();
- gui#console#show ~msg:"theorem " ()));
- ignore (gui#main#openMenuItem#connect#activate (fun _ ->
- match gui#chooseFile () with
- | None -> ()
- | Some f when is_proof_script f ->
- ignore (gui#console#wrap_exn (fun () -> script#loadFrom f))
- | Some f ->
- gui#console#echo_error (sprintf
- "Don't know what to do with file: %s\nUnrecognized file format."
- f)));
- ignore (gui#main#newCicBrowserMenuItem#connect#activate (fun _ ->
- ignore (MatitaMathView.cicBrowser ())));
- let module A = TacticAst in
- let hole = CicAst.UserInput in
- let tac ast _ =
- let ast = A.Tactic ast in
- ignore (interpreter#evalAst ast);
- ignore (script#advance ast)
- in
- let tac_w_term ast _ =
-(* gui#console#clear (); *)
- gui#console#show ~msg:(TacticAstPp.pp_tactic ast) ();
- gui#main#mainWin#present ()
+ let cic_math_view = MatitaMathView.cicMathView_instance () in
+ let sequents_viewer = MatitaMathView.sequentsViewer_instance () in
+ sequents_viewer#load_logo;
+ cic_math_view#set_href_callback
+ (Some (fun uri -> (MatitaMathView.cicBrowser ())#load
+ (`Uri (UriManager.uri_of_string uri))));
+ let browser_observer _ = MatitaMathView.refresh_all_browsers () in
+ let sequents_observer status =
+ sequents_viewer#reset;
+ match status.proof_status with
+ | Incomplete_proof ((proof, goal) as status) ->
+ sequents_viewer#load_sequents status;
+ sequents_viewer#goto_sequent goal
+ | Proof proof ->
+ sequents_viewer#load_logo_with_qed
+ | No_proof ->
+ sequents_viewer#load_logo
+ | Intermediate _ ->
+ assert false (* only the engine may be in this state *)