]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/invokeTactics.ml
new getter, logger, and the hell
[helm.git] / helm / gTopLevel / invokeTactics.ml
index 2b0e58d214328d4a7e7c18b5600658a9ac4e283f..5f01eff9f489d967fc9526eb4add5c3b71be4e80 100644 (file)
@@ -53,8 +53,6 @@ module type Callbacks =
         set_metasenv : Cic.metasenv -> unit ;
         context: Cic.context ;
         set_context : Cic.context -> unit >
-    (* output messages *)
-    val output_html : Ui_logger.html_msg -> unit
     (* GUI refresh functions *)
     val refresh_proof : unit -> unit
     val refresh_goals : unit -> unit
@@ -112,7 +110,7 @@ module Make (C: Callbacks) : Tactics =
   struct
 
    let print_uncaught_exception e =
-     C.output_html (`Error (`T (sprintf "Uncaught exception: %s"
+     HelmLogger.log (`Error (`T (sprintf "Uncaught exception: %s"
       (Printexc.to_string e))))
 
    let handle_refresh_exception f savedproof savedgoal =
@@ -120,14 +118,14 @@ module Make (C: Callbacks) : Tactics =
        f ()
      with
      | RefreshSequentException e ->
-        C.output_html (`Error (`T
+        HelmLogger.log (`Error (`T
           (sprintf "Exception raised during the refresh of the sequent: %s"
             (Printexc.to_string e))));
         ProofEngine.set_proof savedproof ;
         ProofEngine.goal := savedgoal ;
         C.refresh_goals ()
      | RefreshProofException e ->
-        C.output_html (`Error (`T
+        HelmLogger.log (`Error (`T
           (sprintf "Exception raised during the refresh of the proof: %s"
             (Printexc.to_string e))));
         ProofEngine.set_proof savedproof ;
@@ -194,8 +192,8 @@ module Make (C: Callbacks) : Tactics =
             C.refresh_goals () ;
             C.refresh_proof ())
           savedproof savedgoal
-     | [] -> C.output_html (`Error (`T "No term selected"))
-     | _ -> C.output_html (`Error (`T "Too many terms selected"))
+     | [] -> HelmLogger.log (`Error (`T "No term selected"))
+     | _ -> HelmLogger.log (`Error (`T "Too many terms selected"))
 
   let call_tactic_with_goal_inputs tactic () =
    let module L = LogicalOperations in
@@ -205,7 +203,7 @@ module Make (C: Callbacks) : Tactics =
      handle_refresh_exception
       (fun () ->
         match (C.sequent_viewer ())#get_selected_terms with
-         | [] -> C.output_html (`Error (`T "No term selected"))
+         | [] -> HelmLogger.log (`Error (`T "No term selected"))
          | terms ->
             tactic terms ;
             C.refresh_goals () ;
@@ -244,8 +242,8 @@ module Make (C: Callbacks) : Tactics =
                C.refresh_proof () ;
                (C.term_editor ())#reset)
           savedproof savedgoal
-     | [] -> C.output_html (`Error (`T "No term selected"))
-     | _ -> C.output_html (`Error (`T "Too many terms selected"))
+     | [] -> HelmLogger.log (`Error (`T "No term selected"))
+     | _ -> HelmLogger.log (`Error (`T "Too many terms selected"))
 
   let call_tactic_with_goal_input_in_scratch tactic () =
    let module L = LogicalOperations in
@@ -263,15 +261,15 @@ module Make (C: Callbacks) : Tactics =
           with
            e -> print_uncaught_exception e
          end
-     | [] -> C.output_html (`Error (`T "No term selected"))
-     | _ -> C.output_html (`Error (`T "Too many terms selected"))
+     | [] -> HelmLogger.log (`Error (`T "No term selected"))
+     | _ -> HelmLogger.log (`Error (`T "Too many terms selected"))
 
   let call_tactic_with_goal_inputs_in_scratch tactic () =
    let module L = LogicalOperations in
    let module G = Gdome in
     let scratch_window = C.scratch_window () in
      match scratch_window#sequent_viewer#get_selected_terms with
-      | [] -> C.output_html (`Error (`T "No term selected"))
+      | [] -> HelmLogger.log (`Error (`T "No term selected"))
       | terms ->
          try
           let expr = tactic terms scratch_window#term in
@@ -295,8 +293,8 @@ module Make (C: Callbacks) : Tactics =
              C.refresh_goals () ;
              C.refresh_proof ())
            savedproof savedgoal
-     | [] -> C.output_html (`Error (`T "No hypothesis selected"))
-     | _ -> C.output_html (`Error (`T "Too many hypotheses selected"))
+     | [] -> HelmLogger.log (`Error (`T "No hypothesis selected"))
+     | _ -> HelmLogger.log (`Error (`T "Too many hypotheses selected"))
 
 
   let intros =