Commit eb751c1b authored by MARCHE Claude's avatar MARCHE Claude

allow relative pathnames for drivers stored in the Why3 config file

If drivers in why3.conf are simple names like "alt_ergo", then the driver file
is search as <datadir>/drivers/alt_ergo.drv

This behavior is now the same as when a driver is given with option -D on the
command line for why3prove, why3replay or why3extract

Reminder: the datadir is either given as
1) the environment variable WHY3DATA
2) the field "datadir" of the [main] section of the
   why3 config file if exists
3) or by default the compile-time datadir
parent 3e625c03
......@@ -42,7 +42,7 @@ let provers =
Whyconf.Mprover.fold
(fun _ p acc ->
try
let d = Driver.load_driver env p.Whyconf.driver [] in
let d = Whyconf.load_driver main env p.Whyconf.driver [] in
(p,d)::acc
with e ->
let p = p.Whyconf.prover in
......
......@@ -85,7 +85,7 @@ let env : Env.env = Env.create_env (Whyconf.loadpath main)
(* loading the Alt-Ergo driver *)
let alt_ergo_driver : Driver.driver =
try
Driver.load_driver env alt_ergo.Whyconf.driver []
Whyconf.load_driver main env alt_ergo.Whyconf.driver []
with e ->
eprintf "Failed to load driver for alt-ergo: %a@."
Exn_printer.exn_printer e;
......
......@@ -11,7 +11,7 @@ version_old = "1.10.prv"
version_old = "1.00.prv"
command = "%e -timelimit %t %f"
command_steps = "%e -steps-bound %S %f"
driver = "drivers/alt_ergo.drv"
driver = "alt_ergo"
editor = "altgr-ergo"
use_at_auto_level = 1
......@@ -26,7 +26,7 @@ version_ok = "1.30"
version_old = "1.01"
command = "%e -timelimit %t %f"
command_steps = "%e -steps-bound %S %f"
driver = "drivers/alt_ergo.drv"
driver = "alt_ergo"
editor = "altgr-ergo"
[ATP alt-ergo]
......@@ -40,7 +40,7 @@ version_old = "0.99.1"
version_old = "0.95.2"
command = "%e -no-rm-eq-existential -timelimit %t %f"
command_steps = "%e -no-rm-eq-existential -steps-bound %S %f"
driver = "drivers/alt_ergo.drv"
driver = "alt_ergo"
editor = "altgr-ergo"
# CVC4 version 1.5-prerelease
......@@ -53,7 +53,7 @@ version_switch = "--version"
version_regexp = "This is CVC4 version \\([^ \n\r]+\\)"
version_ok = "1.5-prerelease"
version_ok = "1.5"
driver = "drivers/cvc4_15.drv"
driver = "cvc4_15"
# --random-seed=42 is not needed as soon as --random-freq=0.0 by default
# to try: --inst-when=full-last-call
command = "%e --tlimit-per=%t000 --lang=smt2 %f"
......@@ -67,7 +67,7 @@ exec = "cvc4-1.4"
version_switch = "--version"
version_regexp = "This is CVC4 version \\([^ \n\r]+\\)"
version_ok = "1.4"
driver = "drivers/cvc4_14.drv"
driver = "cvc4_14"
# --random-seed=42 is not needed as soon as --random-freq=0.0 by default
# to try: --inst-when=full-last-call
# --rlimit=%S : cvc4 1.4 DOES NOT accept -1 as argument
......@@ -84,7 +84,7 @@ exec = "cvc4-1.4"
version_switch = "--version"
version_regexp = "This is CVC4 version \\([^ \n\r]+\\)"
version_ok = "1.4"
driver = "drivers/cvc4.drv"
driver = "cvc4"
# --random-seed=42 is not needed as soon as --random-freq=0.0 by default
# to try: --inst-when=full-last-call
# --rlimit=%S : cvc4 1.4 DOES NOT accept -1 as argument
......@@ -106,7 +106,7 @@ version_old = "1.3"
version_old = "1.2"
version_old = "1.1"
version_old = "1.0"
driver = "drivers/cvc4.drv"
driver = "cvc4"
command = "%e --lang=smt2 %f"
# Psyche version 2.x
......@@ -117,7 +117,7 @@ exec = "psyche-2.02"
version_switch = "-version"
version_regexp = "\\([^ \n\r]+\\)"
version_ok = "2.0"
driver = "drivers/psyche.drv"
driver = "psyche"
command = "%e -gplugin dpll_wl %f"
# CVC3 versions 2.4.x
......@@ -132,7 +132,7 @@ version_ok = "2.4.1"
version_old = "2.4"
# the -timeout option is unreliable in CVC3 2.4.1
command = "%e -seed 42 %f"
driver = "drivers/cvc3.drv"
driver = "cvc3"
# CVC3 versions 2.x
[ATP cvc3]
......@@ -145,7 +145,7 @@ version_regexp = "This is CVC3 version \\([^ \n]+\\)"
version_old = "2.2"
version_old = "2.1"
command = "%e -seed 42 -timeout %t %f"
driver = "drivers/cvc3.drv"
driver = "cvc3"
[ATP yices]
name = "Yices"
......@@ -159,7 +159,7 @@ version_old = "^1\.0\.2[5-9]$"
version_old = "^1\.0\.2[0-4]$"
version_old = "^1\.0\.1\.*$"
command = "%e"
driver = "drivers/yices.drv"
driver = "yices"
[ATP yices-smt2]
name = "Yices"
......@@ -169,7 +169,7 @@ version_switch = "--version"
version_regexp = "^Yices \\([^ \n]+\\)$"
version_ok = "2.3.0"
command = "%e"
driver = "drivers/yices-smt2.drv"
driver = "yices-smt2"
[ATP eprover]
name = "Eprover"
......@@ -187,7 +187,7 @@ version_old = "1.6"
version_old = "1.5"
version_old = "1.4"
command = "%e -s -R -xAuto -tAuto --cpu-limit=%t --tstp-in %f"
driver = "drivers/eprover.drv"
driver = "eprover"
use_at_auto_level = 2
[ATP gappa]
......@@ -207,7 +207,7 @@ version_regexp = "Gappa \\([^ \n]*\\)"
version_ok = "^1\.[0-3]\..+$"
version_old = "^0\.1[1-8]\..+$"
command = "%e -Eprecision=70"
driver = "drivers/gappa.drv"
driver = "gappa"
[ATP mathsat]
name = "MathSAT5"
......@@ -217,7 +217,7 @@ version_switch = "-version"
version_regexp = "MathSAT5 version \\([^ \n]+\\)"
version_ok = "5.2.2"
command = "%e -input=smt2 -model -random_seed=80 %f"
driver = "drivers/mathsat.drv"
driver = "mathsat"
[ATP simplify]
name = "Simplify"
......@@ -230,7 +230,7 @@ version_regexp = "Simplify version \\([^ \n,]+\\)"
version_old = "1.5.5"
version_old = "1.5.4"
command = "%e %f"
driver = "drivers/simplify.drv"
driver = "simplify"
[ATP metis]
name = "Metis"
......@@ -239,7 +239,7 @@ version_switch = "-v"
version_regexp = "metis \\([^ \n,]+\\)"
version_ok = "2.3"
command = "%e --time-limit %t %f"
driver = "drivers/metis.drv"
driver = "metis"
[ATP metitarski]
name = "MetiTarski"
......@@ -251,7 +251,7 @@ version_regexp = "MetiTarski \\([^ \n,]+\\)"
version_ok = "2.4"
version_old = "2.2"
command = "%e --time %t %f"
driver = "drivers/metitarski.drv"
driver = "metitarski"
[ATP polypaver]
name = "PolyPaver"
......@@ -261,7 +261,7 @@ version_switch = "--version"
version_regexp = "PolyPaver \\([0-9.]+\\) (c)"
version_ok = "0.3"
command = "%e -d 2 -m 10 --time=%t %f"
driver = "drivers/polypaver.drv"
driver = "polypaver"
[ATP spass]
name = "Spass"
......@@ -271,7 +271,7 @@ version_switch = " | grep 'SPASS V'"
version_regexp = "SPASS V \\([^ \n\t]+\\)"
version_ok = "3.7"
command = "%e -TPTP -PGiven=0 -PProblem=0 -TimeLimit=%t %f"
driver = "drivers/spass.drv"
driver = "spass"
use_at_auto_level = 2
[ATP spass]
......@@ -282,7 +282,7 @@ version_switch = " | grep 'SPASS[^ \\n\\t]* V'"
version_regexp = "SPASS[^ \n\t]* V \\([^ \n\t]+\\)"
version_ok = "3.8ds"
command = "%e -Isabelle=1 -PGiven=0 -TimeLimit=%t %f"
driver = "drivers/spass_types.drv"
driver = "spass_types"
use_at_auto_level = 2
[ATP vampire]
......@@ -292,7 +292,7 @@ exec = "vampire-0.6"
version_switch = "--version"
version_regexp = "Vampire \\([0-9.]+\\)"
command = "%e -t %t"
driver = "drivers/vampire.drv"
driver = "vampire"
version_ok = "0.6"
[ATP princess]
......@@ -303,7 +303,7 @@ exec = "princess-2015-12-07"
# version_regexp = "(CASC version \\([0-9-]+\\))"
version_regexp = "(release \\([0-9-]+\\))"
command = "%e -timeout=%t %f"
driver = "drivers/princess.drv"
driver = "princess"
# version_ok = "2013-05-13"
version_ok = "2015-12-07"
......@@ -314,7 +314,7 @@ exec = "beagle-0.4.1"
# version_switch = "-h"
version_regexp = "version \\([0-9.]+\\)"
command = "%e %f"
driver = "drivers/beagle.drv"
driver = "beagle"
version_ok = "0.4.1"
[ATP verit]
......@@ -324,7 +324,7 @@ exec = "veriT-201410"
version_switch = "--version"
version_regexp = "version \\([^ \n\r]+\\)"
command = "%e --disable-print-success %f"
driver = "drivers/verit.drv"
driver = "verit"
version_ok = "201410"
[ATP verit]
......@@ -335,7 +335,7 @@ version_switch = "--version"
version_regexp = "version \\([^ \n\r]+\\)"
command = "%e --disable-print-success --enable-simp \
--enable-unit-simp --enable-simp-sym --enable-unit-subst-simp --enable-bclause %f"
driver = "drivers/verit.drv"
driver = "verit"
version_old = "201310"
# Z3 >= 4.4.0, with BV support
......@@ -350,7 +350,7 @@ version_regexp = "Z3 version \\([^ \n\r]+\\)"
version_ok = "4.5.0"
version_ok = "4.4.1"
version_ok = "4.4.0"
driver = "drivers/z3_440.drv"
driver = "z3_440"
command = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 %f"
command_steps = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 memory_max_alloc_count=%S %f"
use_at_auto_level = 1
......@@ -368,7 +368,7 @@ version_regexp = "Z3 version \\([^ \n\r]+\\)"
version_ok = "4.5.0"
version_ok = "4.4.1"
version_ok = "4.4.0"
driver = "drivers/z3_432.drv"
driver = "z3_432"
command = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 %f"
command_steps = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 memory_max_alloc_count=%S %f"
......@@ -381,7 +381,7 @@ exec = "z3-4.3.2"
version_switch = "-version"
version_regexp = "Z3 version \\([^ \n\r]+\\)"
version_ok = "4.3.2"
driver = "drivers/z3_432.drv"
driver = "z3_432"
command = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 %f"
command_steps = "%e -smt2 sat.random_seed=42 nlsat.randomize=false smt.random_seed=42 memory_max_alloc_count=%S %f"
......@@ -402,7 +402,7 @@ version_old = "4.2"
version_old = "4.1.2"
version_old = "4.1.1"
version_old = "4.0"
driver = "drivers/z3.drv"
driver = "z3"
command = "%e -smt2 -rs:42 %f"
[ATP z3]
......@@ -416,7 +416,7 @@ version_regexp = "Z3 version \\([^ \n\r]+\\)"
version_old = "3.2"
version_old = "3.1"
version_old = "3.0"
driver = "drivers/z3.drv"
driver = "z3"
# the -T is unreliable in Z3 3.2
command = "%e -smt2 -rs:42 %f"
......@@ -431,7 +431,7 @@ version_switch = "-version"
version_regexp = "Z3 version \\([^ \n\r]+\\)"
version_old = "^2\.2.+$"
version_old = "^2\.1[6-9]$"
driver = "drivers/z3.drv"
driver = "z3"
command = "%e -smt2 -rs:42 \
PHASE_SELECTION=0 \
RESTART_STRATEGY=0 \
......@@ -464,7 +464,7 @@ version_old = "^2\.1[0-5]$"
version_old = "^2\.[0-9]$"
version_old = "1.3"
command = "%e -smt %f"
driver = "drivers/z3_smtv1.drv"
driver = "z3_smtv1"
[ATP zenon]
name = "Zenon"
......@@ -476,7 +476,7 @@ version_regexp = "zenon version \\([^ \n\t]+\\)"
version_ok = "0.8.0"
version_ok = "0.7.1"
command = "%e -p0 -itptp -max-size %mM -max-time %ts %f"
driver = "drivers/zenon.drv"
driver = "zenon"
[ATP zenon_modulo]
name = "Zenon Modulo"
......@@ -485,7 +485,7 @@ version_switch = "-v"
version_regexp = "zenon_modulo version \\([0-9.]+\\)"
version_ok = "0.4.1"
command = "%e -p0 -itptp -max-size %mM -max-time %ts %f"
driver = "drivers/zenon_modulo.drv"
driver = "zenon_modulo"
[ATP iprover]
name = "iProver"
......@@ -497,7 +497,7 @@ version_ok = "0.8.1"
command = "%e --fof true --out_options none \
--time_out_virtual %t --clausifier /usr/bin/env --clausifier_options \
\"eprover --cnf --tstp-format \" %f"
driver = "drivers/iprover.drv"
driver = "iprover"
[ATP mathematica]
name = "Mathematica"
......@@ -508,7 +508,7 @@ version_ok = "9.0"
version_ok = "8.0"
version_ok = "7.0"
command = "%e -noprompt"
driver = "drivers/mathematica.drv"
driver = "mathematica"
# Coq 8.6: do not limit memory
[ITP coq]
......@@ -519,7 +519,7 @@ version_switch = "-v"
version_regexp = "The Coq Proof Assistant, version \\([^ \n]+\\)"
version_ok = "8.6"
command = "%e -I %l/coq-tactic -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f"
driver = "drivers/coq.drv"
driver = "coq"
editor = "coqide"
# Coq 8.5: do not limit memory
......@@ -534,7 +534,7 @@ version_ok = "8.5pl2"
version_ok = "8.5pl1"
version_ok = "8.5"
command = "%e -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f"
driver = "drivers/coq.drv"
driver = "coq"
editor = "coqide"
[ITP coq]
......@@ -546,7 +546,7 @@ version_regexp = "The Coq Proof Assistant, version \\([^ \n]+\\)"
version_ok = "^8\.4pl[1-6]$"
version_ok = "8.4"
command = "%e -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f"
driver = "drivers/coq.drv"
driver = "coq"
editor = "coqide"
[ITP pvs]
......@@ -558,7 +558,7 @@ version_regexp = "PVS Version \\([^ \n]+\\)"
version_ok = "6.0"
version_bad = "^[0-5]\..+$"
command = "%l/why3-call-pvs %l proveit -f %f"
driver = "drivers/pvs.drv"
driver = "pvs"
in_place = true
editor = "pvs"
......@@ -571,7 +571,7 @@ version_ok = "2016-1"
version_bad = "2016"
version_bad = "2015"
command = "%e why3 -b %f"
driver = "drivers/isabelle2016-1.drv"
driver = "isabelle2016-1"
in_place = true
editor = "isabelle-jedit"
......@@ -584,7 +584,7 @@ version_ok = "2016"
version_bad = "2016-1"
version_bad = "2015"
command = "%e why3 -b %f"
driver = "drivers/isabelle2016.drv"
driver = "isabelle2016"
in_place = true
editor = "isabelle-jedit"
......
......@@ -207,7 +207,7 @@ let get_prover s =
else
raise (Whyconf.ProverAmbiguity (wc,fp,provers))
in
let drv = Driver.load_driver env cp.driver cp.extra_drivers in
let drv = Whyconf.load_driver main env cp.driver cp.extra_drivers in
Hashtbl.add provers s (cp, drv);
cp, drv
......
......@@ -191,10 +191,6 @@ let read_auto_detection_data main =
| Not_found ->
Loc.errorm "provers-detection-data.conf not found at %s@." filename
(* dead code
let provers_found = ref 0
*)
let read_editors main =
let filename = Filename.concat (Whyconf.datadir main)
"provers-detection-data.conf" in
......@@ -403,7 +399,7 @@ let generate_auto_strategies config =
(add_strategy
(add_strategy (add_strategy config inline) split) auto1) auto2
let detect_exec env main data acc exec_name =
let detect_exec env data acc exec_name =
let s = ask_prover_version env exec_name data.version_switch in
match s with
| None -> acc
......@@ -482,9 +478,9 @@ let detect_exec env main data acc exec_name =
{prover = prover;
command = c;
command_steps = c_steps;
driver = Filename.concat (datadir main) data.prover_driver;
driver = data.prover_driver;
editor = data.prover_editor;
in_place = data.prover_in_place;
in_place = data.prover_in_place;
interactive = (match data.kind with ITP -> true | ATP -> false);
extra_options = [];
extra_drivers = [] } in
......@@ -512,8 +508,8 @@ let detect_exec env main data acc exec_name =
else (unknown_version env exec_name data.prover_id prover_config priority;
acc)
let detect_prover env main acc data =
List.fold_left (detect_exec env main data) acc data.execs
let detect_prover env acc data =
List.fold_left (detect_exec env data) acc data.execs
(** add the prover unknown *)
let detect_unknown env detected =
......@@ -541,7 +537,7 @@ let convert_shortcuts env =
let run_auto_detection config =
let main = get_main config in
let l,env = read_auto_detection_data main in
let detected = List.fold_left (detect_prover env main) Mprover.empty l in
let detected = List.fold_left (detect_prover env) Mprover.empty l in
let length_detected = Mprover.cardinal detected in
let detected = detect_unknown env detected in
let length_unsupported_version =
......@@ -595,7 +591,7 @@ let add_prover_binary config id path =
let l = List.filter (fun p -> p.prover_id = id) l in
if l = [] then Loc.errorm "Unknown prover id: %s" id;
let detected = List.fold_left
(fun acc data -> detect_exec env main data acc path) Mprover.empty l in
(fun acc data -> detect_exec env data acc path) Mprover.empty l in
let detected = detect_unknown env detected in
if Mprover.is_empty detected then
Loc.errorm "File %s does not correspond to the prover id %s" path id;
......
......@@ -67,7 +67,7 @@ exception UnknownProp of (string list * string list)
exception FSymExpected of lsymbol
exception PSymExpected of lsymbol
let load_driver = let driver_tag = ref (-1) in fun env file extra_files ->
let load_driver_absolute = let driver_tag = ref (-1) in fun env file extra_files ->
let prelude = ref [] in
let regexps = ref [] in
let exitcodes = ref [] in
......
......@@ -15,10 +15,10 @@
type driver
val load_driver : Env.env -> string -> string list -> driver
val load_driver_absolute : Env.env -> string -> string list -> driver
(** loads a driver from a file
@param env environment to interpret theories
@param string driver file name
@param string driver file name (absolute path name)
@param string list additional driver files containing only theories
*)
......
......@@ -396,8 +396,6 @@ let set_policies rc policy =
in
set_family rc "uninstalled_prover" family
let absolute_filename = Sysutil.absolutize_filename
exception DuplicateShortcut of string
let add_prover_shortcuts acc prover shortcuts =
......@@ -408,7 +406,7 @@ let add_prover_shortcuts acc prover shortcuts =
) acc shortcuts
let load_prover dirname (provers,shortcuts) section =
let load_prover (provers,shortcuts) section =
try
let name = get_string section "name" in
let version = get_string ~default:"" section "version" in
......@@ -423,7 +421,7 @@ let load_prover dirname (provers,shortcuts) section =
{ prover = prover;
command = get_string section "command";
command_steps = get_stringo section "command_steps";
driver = absolute_filename dirname (get_string section "driver");
driver = get_string section "driver";
in_place = get_bool ~default:false section "in_place";
editor = get_string ~default:"" section "editor";
interactive = get_bool ~default:false section "interactive";
......@@ -524,7 +522,7 @@ let load_main dirname section =
raise WrongMagicNumber;
{ libdir = get_string ~default:default_main.libdir section "libdir";
datadir = get_string ~default:default_main.datadir section "datadir";
loadpath = List.map (absolute_filename dirname)
loadpath = List.map (Sysutil.absolutize_filename dirname)
(get_stringl ~default:[] section "loadpath");
timelimit = get_int ~default:default_main.timelimit section "timelimit";
memlimit = get_int ~default:default_main.memlimit section "memlimit";
......@@ -550,7 +548,7 @@ let read_config_rc conf_file =
exception ConfigFailure of string (* filename *) * string
let get_dirname filename =
Filename.dirname (absolute_filename (Sys.getcwd ()) filename)
Filename.dirname (Sysutil.absolutize_filename (Sys.getcwd ()) filename)
let get_config (filename,rc) =
let dirname = get_dirname filename in
......@@ -560,7 +558,7 @@ let get_config (filename,rc) =
| Some main -> rc, load_main dirname main
in
let provers = get_simple_family rc "prover" in
let provers,shortcuts = List.fold_left (load_prover dirname)
let provers,shortcuts = List.fold_left load_prover
(Mprover.empty,Mstr.empty) provers in
let fam_shortcuts = get_simple_family rc "shortcut" in
let shortcuts = List.fold_left load_shortcut shortcuts fam_shortcuts in
......@@ -682,7 +680,7 @@ let merge_config config filename =
let main = match get_section rc "main" with
| None -> config.main
| Some rc ->
let loadpath = (List.map (absolute_filename dirname)
let loadpath = (List.map (Sysutil.absolutize_filename dirname)
(get_stringl ~default:[] rc "loadpath")) @ config.main.loadpath in
let plugins =
(get_stringl ~default:[] rc "plugin") @ config.main.plugins in
......@@ -713,15 +711,14 @@ let merge_config config filename =
if not (filter_prover fp p) then c
else
let opt = get_stringl ~default:[] section "option" in
let drv = List.map (absolute_filename dirname)
(get_stringl ~default:[] section "driver") in
let drv = get_stringl ~default:[] section "driver" in
{ c with
extra_options = opt @ c.extra_options;
extra_drivers = drv @ c.extra_drivers })
provers
) config.provers prover_modifiers in
let provers,shortcuts =
List.fold_left (load_prover dirname)
List.fold_left load_prover
(provers,config.prover_shortcuts) (get_simple_family rc "prover") in
(* modify editors *)
let editor_modifiers = get_family rc "editor_modifiers" in
......@@ -911,3 +908,15 @@ module Args = struct
Arg.usage (align_options options) usage;
exit 1
end
(** Loading drivers with relative names *)
let absolute_driver_file main s =
if Sys.file_exists s || String.contains s '/' || String.contains s '.' then s
else Filename.concat main.datadir (Filename.concat "drivers" (s ^ ".drv"))
let load_driver main env file extras =
let file = absolute_driver_file main file in
Driver.load_driver_absolute env file extras
......@@ -259,3 +259,11 @@ module Args : sig
val exit_with_usage : (string * Arg.spec * string) list -> string -> 'a
end
(** Loading drivers with relative names *)
val load_driver : main -> Env.env -> string -> string list -> Driver.driver
(** wrapper for loading a driver from a file that may be relative to the datadir.
See [Driver.load_driver_absolute]
*)
......@@ -1903,10 +1903,11 @@ let load_prover eS prover =
let r = match r with
| None -> None
| Some pr ->
let dr = Driver.load_driver eS.env
pr.Whyconf.driver pr.Whyconf.extra_drivers in
Some { prover_config = pr;
prover_driver = dr}
let dr = Whyconf.load_driver (Whyconf.get_main eS.whyconf)
eS.env
pr.Whyconf.driver pr.Whyconf.extra_drivers in
Some { prover_config = pr;
prover_driver = dr}
in
PHprover.add eS.loaded_provers prover r;
r
......
......@@ -15,7 +15,6 @@ open Stdlib
open Whyconf
open Theory
open Task
open Driver
let usage_msg = sprintf
"Usage: %s [options] [[file|-] [-T <theory> [-G <goal>]...]...]..."
......@@ -151,11 +150,7 @@ let option_list = [
let config, _, env =
Whyconf.Args.initialize option_list add_opt_file usage_msg
let driver_file s =
if Sys.file_exists s || String.contains s '/' || String.contains s '.' then s
else Filename.concat Config.datadir (Filename.concat "drivers" (s ^ ".drv"))
let opt_driver = ref (match List.rev_map driver_file !opt_driver with
let opt_driver = ref (match !opt_driver with
| f::ef -> Some (f, ef)
| [] -> None)
......@@ -385,7 +380,7 @@ let do_input env drv = function
let () =
try
let load (f,ef) = load_driver env f ef in
let load (f,ef) = load_driver (Whyconf.get_main config) env f ef in
let drv = Opt.map load !opt_driver in
Queue.iter (do_input env drv) opt_queue
with e when not (Debug.test_flag Debug.stack_trace) ->
......
......@@ -73,17 +73,13 @@ let opt_output =
exit 1
| Some d -> d
let driver_file s =