Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit f8f4110c authored by Jean-Christophe Filliâtre's avatar Jean-Christophe Filliâtre
Browse files

configure: coq plugin detection; timelimit and memlimit now optional arguments; coq-plugin update

parent 05334a87
...@@ -338,21 +338,24 @@ clean:: ...@@ -338,21 +338,24 @@ clean::
############## ##############
ifeq (@enable_coq_support@,yes) ifeq (@enable_coq_support@,yes)
#byte: src/coq-plugin/whytac.cmo byte: src/coq-plugin/whytac.cma
#opt: src/coq-plugin/whytac.cmxs opt: src/coq-plugin/whytac.cmxs
endif endif
COQTREES = kernel lib interp parsing proofs pretyping tactics library COQTREES = kernel lib interp parsing proofs pretyping tactics library
#src/coq-plugin/whytac.cmo: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES)) src/coq-plugin/whytac.cma: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES))
src/coq-plugin/whytac.cmxs: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES)) src/coq-plugin/whytac.cmxs: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES))
#src/coq-plugin/whytac.cmo: BFLAGS+=-rectypes src/coq-plugin/whytac.cma: BFLAGS+=-rectypes
src/coq-plugin/whytac.cmxs: OFLAGS+=-rectypes src/coq-plugin/whytac.cmxs: OFLAGS+=-rectypes
src/coq-plugin/whytac.cmxs: src/why.cmxa src/coq-plugin/whytac.ml src/coq-plugin/whytac.cmxs: src/why.cmxa src/coq-plugin/whytac.ml
$(OCAMLOPT) $(OFLAGS) -o $@ -shared $^ $(OCAMLOPT) $(OFLAGS) -o $@ -shared $^
src/coq-plugin/whytac.cma: src/why.cma src/coq-plugin/whytac.ml
$(OCAMLC) -a $(BFLAGS) -o $@ $^
####### #######
# tools # tools
####### #######
......
...@@ -225,17 +225,13 @@ else ...@@ -225,17 +225,13 @@ else
enable_coq_support=no enable_coq_support=no
AC_MSG_WARN(Cannot find coqc.) AC_MSG_WARN(Cannot find coqc.)
else else
enable_coq_support=yes
AC_CHECK_PROG(COQDEP,coqdep,coqdep,true)
if test "$COQDEP" = true ; then
AC_MSG_ERROR(Cannot find coqdep.)
fi
COQLIB=`$COQC -where | sed -e 's|\\\|/|g' -e 's| |\\ |g'` COQLIB=`$COQC -where | sed -e 's|\\\|/|g' -e 's| |\\ |g'`
AC_MSG_CHECKING(Coq version) AC_MSG_CHECKING(Coq version)
COQVERSION=`$COQC -v | sed -n -e 's|.*version* *\([[^ ]]*\) .*$|\1|p' ` COQVERSION=`$COQC -v | sed -n -e 's|.*version* *\([[^ ]]*\) .*$|\1|p' `
case $COQVERSION in case $COQVERSION in
8.*|trunk) 8.*|trunk)
enable_coq_support=yes
AC_MSG_RESULT($COQVERSION);; AC_MSG_RESULT($COQVERSION);;
*) *)
enable_coq_support=no enable_coq_support=no
...@@ -243,6 +239,9 @@ else ...@@ -243,6 +239,9 @@ else
esac esac
fi fi
fi fi
if test "$enable_coq_support" = yes; then
AC_CHECK_FILE($COQLIB/kernel/term.cmi,,enable_coq_support=no)
fi
#Viewer for ps and pdf #Viewer for ps and pdf
dnl AC_CHECK_PROGS(PSVIEWER,gv evince) dnl AC_CHECK_PROGS(PSVIEWER,gv evince)
......
...@@ -14,26 +14,25 @@ open Pp ...@@ -14,26 +14,25 @@ open Pp
open Why open Why
open Call_provers open Call_provers
open Whyconf
let debug = let debug =
try let _ = Sys.getenv "WHYDEBUG" in true try let _ = Sys.getenv "WHYDEBUG" in true
with Not_found -> false with Not_found -> false
let loadpath = let config = Whyconf.read_config None
try Str.split (Str.regexp ":") (Sys.getenv "WHYLOADPATH")
with Not_found -> ["theories"]
let env = Env.create_env (Typing.retrieve loadpath) let env = Env.create_env (Typing.retrieve config.loadpath)
let timeout = let config_prover =
try int_of_string (Sys.getenv "WHYTIMEOUT") try Util.Mstr.find "alt-ergo" config.provers
with Not_found -> 2 with Not_found -> assert false
let drv = let drv = Driver.load_driver env config_prover.driver
let filename = let command = config_prover.command
try Sys.getenv "WHYDRIVER" with Not_found -> "drivers/alt_ergo.drv" let timelimit = match config.timelimit with
in | None -> 3
Driver.load_driver env filename | Some t -> t
(* Coq constants *) (* Coq constants *)
let logic_dir = ["Coq";"Logic";"Decidable"] let logic_dir = ["Coq";"Logic";"Decidable"]
...@@ -336,7 +335,9 @@ and tr_global_ts env r = ...@@ -336,7 +335,9 @@ and tr_global_ts env r =
in in
let decl = Array.mapi make_one mib.mind_packets in let decl = Array.mapi make_one mib.mind_packets in
let decl = Array.to_list decl in let decl = Array.to_list decl in
task := Task.add_ty_decl !task decl; let decl = Decl.create_ty_decl decl in
Format.printf "decl = %a@." Pretty.print_decl decl;
task := Task.add_decl !task decl;
lookup_global global_ts r lookup_global global_ts r
(* assumption: t:T:Set *) (* assumption: t:T:Set *)
...@@ -563,11 +564,8 @@ let whytac gl = ...@@ -563,11 +564,8 @@ let whytac gl =
try try
tr_goal gl; tr_goal gl;
if debug then Format.printf "@[%a@]@\n---@." Pretty.print_task !task; if debug then Format.printf "@[%a@]@\n---@." Pretty.print_task !task;
let tasks = Driver.apply_transforms drv !task in if debug then Format.printf "@[%a@]@\n---@." (Prover.print_task drv) !task;
assert (List.length tasks = 1); let res = Prover.prove_task ~debug ~command ~timelimit drv !task () in
let task = List.hd tasks in
if debug then Format.printf "@[%a@]@\n---@." (Driver.print_task drv) task;
let res = Driver.call_prover ~debug ~timeout drv task in
match res.pr_answer with match res.pr_answer with
| Valid -> Tactics.admit_as_an_axiom gl | Valid -> Tactics.admit_as_an_axiom gl
| Invalid -> error "Invalid" | Invalid -> error "Invalid"
...@@ -575,7 +573,7 @@ let whytac gl = ...@@ -575,7 +573,7 @@ let whytac gl =
| Failure s -> error ("Failure: " ^ s) | Failure s -> error ("Failure: " ^ s)
| Timeout -> error "Timeout" | Timeout -> error "Timeout"
| HighFailure -> | HighFailure ->
error ("Prover failure\n" ^ res.pr_stdout ^ "\n" ^ res.pr_stderr) error ("Prover failure\n" ^ res.pr_output ^ "\n")
with NotFO -> with NotFO ->
error "Not a first order goal" error "Not a first order goal"
......
...@@ -69,7 +69,7 @@ let call_prover debug command opt_cout buffer = ...@@ -69,7 +69,7 @@ let call_prover debug command opt_cout buffer =
if debug then eprintf "Call_provers: prover output:@\n%s@." out; if debug then eprintf "Call_provers: prover output:@\n%s@." out;
ret, out, time ret, out, time
let call_on_buffer ?(debug=false) ~command ~timelimit ~memlimit let call_on_buffer ?(debug=false) ~command ?(timelimit=0) ?(memlimit=0)
~regexps ~exitcodes ~filename buffer () = ~regexps ~exitcodes ~filename buffer () =
let on_stdin = ref true in let on_stdin = ref true in
let on_timelimit = ref false in let on_timelimit = ref false in
......
...@@ -54,8 +54,8 @@ val print_prover_result : Format.formatter -> prover_result -> unit ...@@ -54,8 +54,8 @@ val print_prover_result : Format.formatter -> prover_result -> unit
val call_on_buffer : val call_on_buffer :
?debug : bool -> ?debug : bool ->
command : string -> command : string ->
timelimit : int -> ?timelimit : int ->
memlimit : int -> ?memlimit : int ->
regexps : (Str.regexp * prover_answer) list -> regexps : (Str.regexp * prover_answer) list ->
exitcodes : (int * prover_answer) list -> exitcodes : (int * prover_answer) list ->
filename : string -> filename : string ->
......
...@@ -377,12 +377,12 @@ let get_filename drv input_file theory_name goal_name = ...@@ -377,12 +377,12 @@ let get_filename drv input_file theory_name goal_name =
let file_of_task drv input_file theory_name task = let file_of_task drv input_file theory_name task =
get_filename drv input_file theory_name (task_goal task).pr_name.id_short get_filename drv input_file theory_name (task_goal task).pr_name.id_short
let call_on_buffer ?debug ~command ~timelimit ~memlimit drv buffer = let call_on_buffer ?debug ~command ?timelimit ?memlimit drv buffer =
let regexps = drv.drv_regexps in let regexps = drv.drv_regexps in
let exitcodes = drv.drv_exitcodes in let exitcodes = drv.drv_exitcodes in
let filename = get_filename drv "" "" "" in let filename = get_filename drv "" "" "" in
Call_provers.call_on_buffer Call_provers.call_on_buffer
?debug ~command ~timelimit ~memlimit ~regexps ~exitcodes ~filename buffer ?debug ~command ?timelimit ?memlimit ~regexps ~exitcodes ~filename buffer
(* (*
Local Variables: Local Variables:
......
...@@ -66,8 +66,8 @@ val file_of_task : driver -> string -> string -> task -> string ...@@ -66,8 +66,8 @@ val file_of_task : driver -> string -> string -> task -> string
val call_on_buffer : val call_on_buffer :
?debug : bool -> ?debug : bool ->
command : string -> command : string ->
timelimit : int -> ?timelimit : int ->
memlimit : int -> ?memlimit : int ->
driver -> Buffer.t -> unit -> Call_provers.prover_result driver -> Buffer.t -> unit -> Call_provers.prover_result
(** {2 syntax arguments} *) (** {2 syntax arguments} *)
......
...@@ -65,9 +65,9 @@ let print_task drv fmt task = ...@@ -65,9 +65,9 @@ let print_task drv fmt task =
let printer = printer (driver_query drv task) in let printer = printer (driver_query drv task) in
fprintf fmt "@[%a@]@?" printer task fprintf fmt "@[%a@]@?" printer task
let prove_task ?debug ~command ~timelimit ~memlimit drv task = let prove_task ?debug ~command ?timelimit ?memlimit drv task =
let buf = Buffer.create 1024 in let buf = Buffer.create 1024 in
let fmt = formatter_of_buffer buf in let fmt = formatter_of_buffer buf in
print_task drv fmt task; pp_print_flush fmt (); print_task drv fmt task; pp_print_flush fmt ();
call_on_buffer ?debug ~command ~timelimit ~memlimit drv buf call_on_buffer ?debug ~command ?timelimit ?memlimit drv buf
...@@ -24,8 +24,8 @@ val print_task : Driver.driver -> Format.formatter -> Task.task -> unit ...@@ -24,8 +24,8 @@ val print_task : Driver.driver -> Format.formatter -> Task.task -> unit
val prove_task : val prove_task :
?debug : bool -> ?debug : bool ->
command : string -> command : string ->
timelimit : int -> ?timelimit : int ->
memlimit : int -> ?memlimit : int ->
Driver.driver -> Task.task -> unit -> Call_provers.prover_result Driver.driver -> Task.task -> unit -> Call_provers.prover_result
(** {2 error reporting} *) (** {2 error reporting} *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment