From 6c849a88f1978a6d30e081de7790870ae6d94013 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Strub Date: Fri, 24 Nov 2023 15:35:35 +0100 Subject: [PATCH] SMT timeout can now be configured in INI files The configuration key is "timeout" --- src/ecOptions.ml | 9 ++++++++- src/ecOptions.mli | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ecOptions.ml b/src/ecOptions.ml index e214abef5d..640831c604 100644 --- a/src/ecOptions.ml +++ b/src/ecOptions.ml @@ -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; } @@ -367,7 +368,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 (obind (fun x -> x.ini_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; @@ -502,6 +507,7 @@ 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 @@ -509,5 +515,6 @@ let read_ini_file (filename : string) = 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; } diff --git a/src/ecOptions.mli b/src/ecOptions.mli index b12f113919..68cfcb997d 100644 --- a/src/ecOptions.mli +++ b/src/ecOptions.mli @@ -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; }