Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMT timeout can now be configured in INI files #469

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/ecOptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type ini_options = {
ini_why3 : string option;
ini_ovrevict : string list;
ini_provers : string list;
ini_timeout : int option;
ini_idirs : (string option * string) list;
ini_rdirs : (string option * string) list;
}
Expand All @@ -86,6 +87,8 @@ module Ini : sig

val get_provers : ini_context -> string list

val get_timeout : ini_context -> int option

val get_idirs : ini_context -> (string option * string) list

val get_rdirs : ini_context -> (string option * string) list
Expand All @@ -99,6 +102,8 @@ module Ini : sig

val get_all_provers : ini_context list -> string list

val get_all_timeout : ini_context list -> int option

val get_all_idirs : ini_context list -> (string option * string) list

val get_all_rdirs : ini_context list -> (string option * string) list
Expand Down Expand Up @@ -128,6 +133,9 @@ end = struct
let get_provers (ini : ini_context) =
ini.inic_ini.ini_provers

let get_timeout (ini : ini_context) =
ini.inic_ini.ini_timeout

let get_idirs (ini : ini_context) =
List.map
(snd_map (absolute ?root:ini.inic_root))
Expand All @@ -151,6 +159,9 @@ end = struct
let get_all_provers (ini : ini_context list) =
List.flatten (List.map get_provers ini)

let get_all_timeout (ini : ini_context list) =
List.find_map_opt get_timeout ini

let get_all_idirs (ini : ini_context list) =
List.flatten (List.map get_idirs ini)

Expand Down Expand Up @@ -454,7 +465,11 @@ let prv_options_of_values ini values =
in match provers with [] -> None | provers -> Some provers
in
{ prvo_maxjobs = odfl 4 (get_int "max-provers" values);
prvo_timeout = odfl 3 (get_int "timeout" values);
prvo_timeout = begin
match get_int "timeout" values with
| None -> odfl 3 (Ini.get_all_timeout ini)
| Some i -> i
end;
prvo_cpufactor = odfl 1 (get_int "cpu-factor" values);
prvo_provers = provers;
prvo_pragmas = get_string_list "pragmas" values;
Expand Down Expand Up @@ -615,12 +630,14 @@ let read_ini_file (filename : string) =
ini_why3 = tryget "why3conf";
ini_ovrevict = trylist "no-evict";
ini_provers = trylist "provers" ;
ini_timeout = tryint "timeout" ;
ini_idirs = List.map parse_idir (trylist "idirs");
ini_rdirs = List.map parse_idir (trylist "rdirs"); } in

{ ini_ppwidth = ini.ini_ppwidth;
ini_why3 = omap expand ini.ini_why3;
ini_ovrevict = ini.ini_ovrevict;
ini_provers = ini.ini_provers;
ini_timeout = ini.ini_timeout;
ini_idirs = ini.ini_idirs;
ini_rdirs = ini.ini_rdirs; }
1 change: 1 addition & 0 deletions src/ecOptions.mli
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type ini_options = {
ini_why3 : string option;
ini_ovrevict : string list;
ini_provers : string list;
ini_timeout : int option;
ini_idirs : (string option * string) list;
ini_rdirs : (string option * string) list;
}
Expand Down
Loading