Skip to content
Snippets Groups Projects
Commit 6342c482 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[wp/gui] filter mainstream provers

parent f9a9ad0d
No related branches found
No related tags found
No related merge requests found
...@@ -34,13 +34,17 @@ class provers = ...@@ -34,13 +34,17 @@ class provers =
initializer initializer
begin begin
(** select automatically the provers set on the command line *) (** select automatically the provers set on the command line *)
let cmdline = Wp_parameters.Provers.get () in let cmdline =
match Wp_parameters.Provers.get () with
| [] -> [ "alt-ergo" ]
| prvs -> prvs
in
let selection = List.fold_left let selection = List.fold_left
(fun acc e -> (fun acc e ->
match Why3Provers.find_opt e with match Why3Provers.find_opt e with
| None -> acc | None -> acc
| Some p -> S.add p acc) | Some p -> S.add p acc)
S.empty cmdline S.empty cmdline
in in
self#set selection ; self#set selection ;
end end
...@@ -62,13 +66,14 @@ class dp_chooser ...@@ -62,13 +66,14 @@ class dp_chooser
let array = new Wpane.warray () in let array = new Wpane.warray () in
object(self) object(self)
val mutable mainstream = true
val mutable selected = M.empty val mutable selected = M.empty
method private enable dp e = method private enable dp e =
selected <- M.add dp e selected selected <- M.add dp e selected
method private lookup dp = method private lookup dp =
M.find dp selected try M.find dp selected with Not_found -> false
method private entry dp = method private entry dp =
let text = Why3Provers.title dp in let text = Why3Provers.title dp in
...@@ -91,9 +96,15 @@ class dp_chooser ...@@ -91,9 +96,15 @@ class dp_chooser
array#update () ; array#update () ;
end end
method private detect () = method private provers =
let filter p =
self#lookup p || not mainstream || Why3Provers.is_mainstream p
in S.filter filter (Why3Provers.provers_set ())
method private filter () =
begin begin
self#configure (Why3Provers.provers_set ()); mainstream <- not mainstream ;
self#configure self#provers ;
end end
method private apply () = method private apply () =
...@@ -105,7 +116,8 @@ class dp_chooser ...@@ -105,7 +116,8 @@ class dp_chooser
selected) selected)
method run () = method run () =
let dps = Why3Provers.provers_set () in selected <- M.empty ;
let dps = self#provers in
let sel = provers#get in let sel = provers#get in
selected <- M.merge selected <- M.merge
(fun _ avail enab -> (fun _ avail enab ->
...@@ -119,7 +131,8 @@ class dp_chooser ...@@ -119,7 +131,8 @@ class dp_chooser
initializer initializer
begin begin
dialog#button ~action:(`ACTION self#detect) ~label:"Detect Provers" () ; dialog#button ~action:(`ACTION self#filter) ~label:"Filter"
~tooltip:"Switch to main stream / alternative solvers" () ;
dialog#button ~action:(`CANCEL) ~label:"Cancel" () ; dialog#button ~action:(`CANCEL) ~label:"Cancel" () ;
dialog#button ~action:(`APPLY) ~label:"Apply" () ; dialog#button ~action:(`APPLY) ~label:"Apply" () ;
array#set_entry self#entry ; array#set_entry self#entry ;
......
...@@ -94,6 +94,7 @@ let print_wp s = ...@@ -94,6 +94,7 @@ let print_wp s =
let title p = Pretty_utils.sfprintf "%a" Why3.Whyconf.print_prover p let title p = Pretty_utils.sfprintf "%a" Why3.Whyconf.print_prover p
let name p = p.Why3.Whyconf.prover_name let name p = p.Why3.Whyconf.prover_name
let compare = Why3.Whyconf.Prover.compare let compare = Why3.Whyconf.Prover.compare
let is_mainstream p = p.Why3.Whyconf.prover_altern = ""
let provers () = let provers () =
Why3.Whyconf.Mprover.keys (Why3.Whyconf.get_provers (config ())) Why3.Whyconf.Mprover.keys (Why3.Whyconf.get_provers (config ()))
......
...@@ -41,6 +41,7 @@ val compare : t -> t -> int ...@@ -41,6 +41,7 @@ val compare : t -> t -> int
val provers : unit -> t list val provers : unit -> t list
val provers_set : unit -> Why3.Whyconf.Sprover.t val provers_set : unit -> Why3.Whyconf.Sprover.t
val is_available : t -> bool val is_available : t -> bool
val is_mainstream : t -> bool
val has_shortcut : t -> string -> bool val has_shortcut : t -> string -> bool
(**************************************************************************) (**************************************************************************)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment