diff --git a/src/plugins/wp/GuiConfig.mli b/src/plugins/wp/GuiConfig.mli index 68df00a85d91ae74c6c5334cea6f54897f2ec27e..d812b88b23b8ae9a4780693ba75105d2401e8be9 100644 --- a/src/plugins/wp/GuiConfig.mli +++ b/src/plugins/wp/GuiConfig.mli @@ -33,12 +33,4 @@ class dp_chooser : method run : unit -> unit (** Edit enabled provers *) end -(* -class dp_button : unit -> - object - inherit Widget.widget - method update : unit -> unit - end -*) - (* ------------------------------------------------------------------------ *) diff --git a/src/plugins/wp/GuiNavigator.ml b/src/plugins/wp/GuiNavigator.ml index 6a97990c81cc72b9ddec73e9b1475dee803d1eed..eed9d0dbb42755fd2a0035f35b4032694a03fb20 100644 --- a/src/plugins/wp/GuiNavigator.ml +++ b/src/plugins/wp/GuiNavigator.ml @@ -91,6 +91,7 @@ class behavior ~(clear : Widget.button) ~(card : card Widget.selector) ~(list : GuiList.pane) + ~(provers : GuiConfig.provers) ~(goal : GuiGoal.pane) ~(source : GuiSource.highlighter) ~(popup : GuiSource.popup) @@ -380,7 +381,7 @@ class behavior card#connect (fun _ -> self#details) ; scope#connect self#set_scope ; popup#on_click self#set_selection ; - popup#on_prove (GuiPanel.run_and_prove main) ; + popup#on_prove (GuiPanel.run_and_prove main provers) ; clear#connect self#clear ; end @@ -505,7 +506,7 @@ let make (main : main_window_extension_points) = let filter = (filter :> _ Widget.selector) in let behavior = new behavior ~main ~next ~prev ~index ~scope ~filter ~clear - ~list ~card ~goal ~source ~popup in + ~list ~provers ~card ~goal ~source ~popup in GuiPanel.on_reload behavior#reload ; GuiPanel.on_update behavior#update ; diff --git a/src/plugins/wp/GuiPanel.ml b/src/plugins/wp/GuiPanel.ml index 078ddb311e1076078b80095c5e563604a33bf05b..c8e6c9759eecbe636134f440610674ab36cca227 100644 --- a/src/plugins/wp/GuiPanel.ml +++ b/src/plugins/wp/GuiPanel.ml @@ -63,8 +63,14 @@ let wp_rte_generated s = not mem else false +let spawn provers vcs = + if not (Bag.is_empty vcs) then + let provers = Why3.Whyconf.Sprover.elements provers#get in + VC.command ~provers ~tip:true vcs + let run_and_prove (main:Design.main_window_extension_points) + (provers:GuiConfig.provers) (selection:GuiSource.selection) = begin @@ -72,9 +78,9 @@ let run_and_prove begin match selection with | S_none -> raise Stop - | S_fun kf -> VC.(command (generate_kf kf)) - | S_prop ip -> VC.(command (generate_ip ip)) - | S_call s -> VC.(command (generate_call s.s_stmt)) + | S_fun kf -> spawn provers (VC.generate_kf kf) + | S_prop ip -> spawn provers (VC.generate_ip ip) + | S_call s -> spawn provers (VC.generate_call s.s_stmt) end ; if wp_rte_generated selection then main#redisplay () diff --git a/src/plugins/wp/GuiPanel.mli b/src/plugins/wp/GuiPanel.mli index 25219a0c506570dcf0aa9d6af42d008c5e78e4ab..83642c83d9cadbc98c2f73137365f10414b3c68f 100644 --- a/src/plugins/wp/GuiPanel.mli +++ b/src/plugins/wp/GuiPanel.mli @@ -27,7 +27,8 @@ val reload : unit -> unit val on_reload : (unit -> unit) -> unit val run_and_prove : - Design.main_window_extension_points -> GuiSource.selection -> unit + Design.main_window_extension_points -> + GuiConfig.provers -> GuiSource.selection -> unit val register : main:Design.main_window_extension_points -> diff --git a/src/plugins/wp/VC.ml b/src/plugins/wp/VC.ml index eed3642e3f00269f91036d8c5abf4f3e67e930cc..506deb1860a12366d1ff070bb8dddc9df185de77 100644 --- a/src/plugins/wp/VC.ml +++ b/src/plugins/wp/VC.ml @@ -96,6 +96,7 @@ let prove = Prover.prove let spawn = Prover.spawn ~delayed:true let server = ProverTask.server -let command vcs = Register.do_wp_proofs_iter (fun f -> Bag.iter f vcs) +let command ?provers ?tip vcs = + Register.do_wp_proofs_iter ?provers ?tip (fun f -> Bag.iter f vcs) (* -------------------------------------------------------------------------- *) diff --git a/src/plugins/wp/VC.mli b/src/plugins/wp/VC.mli index eb916875fb6b2123a2790410784a9a9a7a493ae4..630be0e0e5025b1e9ac3055eae7afd5466531815 100644 --- a/src/plugins/wp/VC.mli +++ b/src/plugins/wp/VC.mli @@ -98,7 +98,9 @@ val server : ?procs:int -> unit -> Task.server The returned server is global to Frama-C, but the number of parallel task allowed will be updated to fit the [~procs] or command-line options. *) -val command : t Bag.t -> unit -(** Run the provers with the command-line interface *) +val command : ?provers:Why3.Whyconf.prover list -> ?tip:bool -> t Bag.t -> unit +(** Run the provers with the command-line interface. + If [~provers] is set, it is used for computing the list of provers to spawn. + If [~tip] is set, it is used to compute the script execution mode. *) (* -------------------------------------------------------------------------- *) diff --git a/src/plugins/wp/register.ml b/src/plugins/wp/register.ml index bbf63ea891321d1ae128250eab3e3fcc86af46ee..e9b9477243ea904b45bf416c80c619b64a3a8375 100644 --- a/src/plugins/wp/register.ml +++ b/src/plugins/wp/register.ml @@ -511,7 +511,6 @@ let do_list_scheduled_result () = (* ------------------------------------------------------------------------ *) type mode = { - mutable why3ide : bool ; mutable tactical : bool ; mutable update : bool ; mutable depth : int ; @@ -585,7 +584,7 @@ let dump_strategies = ))) let default_mode () = { - why3ide = false ; tactical = false ; update=false ; provers = [] ; + tactical = false ; update=false ; provers = [] ; depth=0 ; width = 0 ; auto=[] ; backtrack = 0 ; } @@ -668,11 +667,18 @@ let do_update_session mode iter = Wp_parameters.result "Updated session with %d new script%s to complete." f s ); end -let do_wp_proofs_iter iter = +let do_wp_proofs_iter ?provers ?tip iter = let mode = default_mode () in compute_provers ~mode ; compute_auto ~mode ; - let spawned = mode.why3ide || mode.tactical || mode.provers <> [] in + begin match provers with None -> () | Some prvs -> + mode.provers <- List.map (fun dp -> VCS.BatchMode , VCS.Why3 dp) prvs + end ; + begin match tip with None -> () | Some tip -> + mode.tactical <- tip ; + mode.update <- tip ; + end ; + let spawned = mode.tactical || mode.provers <> [] in begin if spawned then do_list_scheduled iter ; spawn_wp_proofs_iter ~mode iter ;