1
|
open VerifierList
|
2
|
|
3
|
let () = Sites.Plugins.Verifiers.load_all ()
|
4
|
|
5
|
let active = ref None
|
6
|
|
7
|
let options () =
|
8
|
List.flatten
|
9
|
(List.map Options_management.verifier_opt
|
10
|
(List.map
|
11
|
(fun m ->
|
12
|
let module M = (val m : VerifierType.S) in
|
13
|
M.name, M.activate, M.options)
|
14
|
(verifiers ())))
|
15
|
|
16
|
let verifier_list verifiers =
|
17
|
List.fold_left
|
18
|
(fun acc m ->
|
19
|
let module M = (val m : VerifierType.S) in
|
20
|
(if acc = "" then "" else acc ^ ", ") ^ M.name)
|
21
|
"" verifiers
|
22
|
|
23
|
let get_active () =
|
24
|
match !active with
|
25
|
| None -> (
|
26
|
(* check that a single one is active and register it *)
|
27
|
let found =
|
28
|
List.fold_left
|
29
|
(fun found m ->
|
30
|
let module M = (val m : VerifierType.S) in
|
31
|
if M.is_active () then m :: found else found)
|
32
|
[] (verifiers ())
|
33
|
in
|
34
|
match found with
|
35
|
| [] ->
|
36
|
raise
|
37
|
(Sys_error
|
38
|
("Please select one verifier in " ^ verifier_list (verifiers ())))
|
39
|
| [ m ] ->
|
40
|
active := Some m;
|
41
|
m
|
42
|
| _ ->
|
43
|
raise (Sys_error ("Too many selected verifiers: " ^ verifier_list found)))
|
44
|
| Some m ->
|
45
|
m
|
46
|
|
47
|
(* Local Variables: *)
|
48
|
(* compile-command:"make -C .." *)
|
49
|
(* End: *)
|