let run_and_prove (main_ui:Design.main_window_extension_points) strategy =
  try
    begin
      match strategy with
        | Snone -> raise Stop
        | Scode s ->
            Register.wp_compute
              s.sp_kf s.sp_bhv s.sp_ip
        | Scall s ->
            Register.wp_compute_call
              ~kf_caller:s.sc_caller
              ~kf_called:s.sc_called
              s.sc_callat
    end ;
    main_ui#rehighlight () ;
    Po_navigator.refresh_panel () ;
    Task.on_server_stop
      (Prover.server ())
      (fun () -> 
         Po_navigator.refresh_status () ; 
         if Wp_parameters.RTE.get () (* TODO[LC] can be optimized *)
         then main_ui#redisplay ()
         else main_ui#rehighlight () ) ;
  with Stop -> ()