Commit 171085d9 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

Merge branch 'master' into new_system

Conflicts:
	src/session/session.ml
	src/session/termcode.ml
	src/why3session/why3session_html.ml
parents cb8e5a38 5c6821f9
......@@ -51,6 +51,7 @@ why3.conf
/bench/programs/good/loops/
/bench/programs/good/po/
/bench/valid/list/
/bench/ce/*.out
# /bin/
/bin/why3.byte
......
#!/bin/sh
dir=`dirname $0`
case "$1" in
"-update-oracle")
updateoracle=true;;
"")
updateoracle=false;;
*)
echo "$0: Unknown option '$1'"
exit 2
esac
run_cvc4_15 () {
echo -n " $1... "
$dir/../bin/why3prove.opt -P "CVC4,1.5-prerelease" --get-ce $1 > $1.out
if cmp $1.oracle $1.out > /dev/null 2>&1 ; then
echo "ok"
else
if $updateoracle; then
echo "Updating oracle for $1"
mv $1.out $1.oracle
else
echo "FAILED!"
echo "diff is the following:"
diff $1.oracle $1.out
fi
fi
}
for f in $dir/ce/*.mlw; do
run_cvc4_15 $f
done
theory T
use import int.Int
goal g0 : forall x "model":int. ("model" x >= 42) -> ("model" x + 3 <= 50)
constant g : int
goal g1 : forall x "model":int. ("model" g >= x)
goal g2 : forall x1 "model" "model_trace:X" x2 "model" x3 "model" x4 "model" x5 "model" x6 "model" x7 "model" x8 "model".
("model" "model_trace: X1 + 1 = 2" x1 + 1 = 2) ->
("model" x2 + 1 = 2) ->
("model" x3 + 1 = 2) ->
("model" x4 + 1 = 2) ->
("model" x5 + 1 = 2) ->
("model" x6 + 1 = 2) ->
("model" x7 + 1 = 2) ->
("model" x8 + 1 = 2) ->
("model" x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 = 2)
end
bench/ce/logic.mlw T g0 : Invalid (0.00s)
Counter-example model:File bench/ce/logic.mlw:
Line 6:
x = {"type" : "Integer" ,
"val" : "48" }
bench/ce/logic.mlw T g1 : Invalid (0.00s)
Counter-example model:File bench/ce/logic.mlw:
Line 10:
x = {"type" : "Integer" ,
"val" : "0" }
bench/ce/logic.mlw T g2 : Invalid (0.00s)
Counter-example model:File bench/ce/logic.mlw:
Line 12:
X = {"type" : "Integer" , "val" : "1" }
x2 = {"type" : "Integer" ,
"val" : "1" }
x3 = {"type" : "Integer" ,
"val" : "1" }
x4 = {"type" : "Integer" ,
"val" : "1" }
x5 = {"type" : "Integer" ,
"val" : "1" }
x6 = {"type" : "Integer" ,
"val" : "1" }
x7 = {"type" : "Integer" ,
"val" : "1" }
x8 = {"type" : "Integer" ,
"val" : "1" }
......@@ -137,6 +137,16 @@ else
echo "Make bench succeeded. " >> $REPORT
fi
# run regression bench for counterexamples
bench/ce-bench &> $OUT
if test "$?" != "0" ; then
echo "Counterexample regression tests FAILED" >> $REPORT
cat $OUT >> $REPORT
SUBJECT="$SUBJECT (CE regression failed)"
else
echo "Counterexample regression tests succeeded. " >> $REPORT
fi
# replay proofs
examples/regtests.sh &> $OUT
......
......@@ -11,9 +11,8 @@ 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
[ATP alt-ergo]
name = "Alt-Ergo"
......@@ -26,7 +25,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"
use_at_auto_level = 1
......@@ -41,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
......@@ -54,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"
......@@ -68,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
......@@ -85,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
......@@ -107,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
......@@ -118,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
......@@ -133,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]
......@@ -146,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"
......@@ -160,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"
......@@ -170,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"
......@@ -188,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]
......@@ -208,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"
......@@ -218,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"
......@@ -231,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"
......@@ -240,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"
......@@ -252,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"
......@@ -262,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"
......@@ -272,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]
......@@ -283,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]
......@@ -293,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]
......@@ -304,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"
......@@ -315,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]
......@@ -325,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]
......@@ -336,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
......@@ -351,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
......@@ -369,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"
......@@ -382,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"
......@@ -403,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]
......@@ -417,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"
......@@ -432,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 \
......@@ -465,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"
......@@ -477,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"
......@@ -486,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"
......@@ -498,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"
......@@ -509,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]
......@@ -520,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
......@@ -535,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]
......@@ -547,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]
......@@ -559,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"
......@@ -572,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"
......@@ -585,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
*)
......
......@@ -17,16 +17,27 @@ exception InvalidAnswer of string
let is_connected () = !socket <> None
let client_connect socket_name =
let client_connect ~fail socket_name =
if !socket <> None then raise AlreadyConnected;
if Sys.os_type = "Win32" then begin
let name = "\\\\.\\pipe\\" ^ socket_name in
socket := Some (Unix.openfile name [Unix.O_RDWR] 0)
end else begin
let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
Unix.connect sock (Unix.ADDR_UNIX socket_name);
try
let sock =
if Sys.os_type = "Win32" then
let name = "\\\\.\\pipe\\" ^ socket_name in
Unix.openfile name [Unix.O_RDWR] 0
else
let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
Unix.connect sock (Unix.ADDR_UNIX socket_name);
sock
in
socket := Some sock
end
with
| Unix.Unix_error(err, func, arg) when fail ->
Format.eprintf "client_connect: connection failed: %s (%s,%s) (socket_name=%s)@." (Unix.error_message err) func arg socket_name;
exit 2
| e when fail ->
Format.eprintf "client_connect failed for some unexpected reason: %s@\nAborting.@."
(Printexc.to_string e);
exit 2
let client_disconnect () =
match !socket with
......@@ -86,7 +97,7 @@ let recv_buf : Buffer.t = Buffer.create 1024
let connect_external socket_name =
if is_connected () then raise AlreadyConnected;
Buffer.clear recv_buf;
client_connect socket_name
client_connect ~fail:true socket_name
let connect_internal () =
if is_connected () then raise AlreadyConnected;
......@@ -104,11 +115,11 @@ let connect_internal () =
Unix.chdir cwd;
(* sleep before connecting, or the server will not be ready yet *)
let rec try_connect n d =
if n <= 0 then client_connect socket_name else
try client_connect socket_name with _ ->
if n <= 0 then client_connect ~fail:true socket_name else