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 2c78bda7 authored by Guillaume Melquiond's avatar Guillaume Melquiond
Browse files

Adapt plugin to Coq 8.6.

parent df9875a9
...@@ -760,7 +760,7 @@ COQPDEP = $(addsuffix .dep, $(COQPMODULES)) ...@@ -760,7 +760,7 @@ COQPDEP = $(addsuffix .dep, $(COQPMODULES))
COQPCMO = $(addsuffix .cmo, $(COQPMODULES)) COQPCMO = $(addsuffix .cmo, $(COQPMODULES))
COQPCMX = $(addsuffix .cmx, $(COQPMODULES)) COQPCMX = $(addsuffix .cmx, $(COQPMODULES))
COQPTREES = kernel interp intf lib library parsing pretyping proofs printing tactics toplevel COQPTREES = engine interp intf kernel lib library ltac parsing pretyping printing proofs tactics toplevel
COQPINCLUDES = -I src/coq-tactic -I $(COQCAMLPLIB) $(addprefix -I @COQLIB@/, $(COQPTREES)) @ZIPINCLUDE@ COQPINCLUDES = -I src/coq-tactic -I $(COQCAMLPLIB) $(addprefix -I @COQLIB@/, $(COQPTREES)) @ZIPINCLUDE@
$(COQPDEP): DEPFLAGS += -I src/coq-tactic $(COQPDEP): DEPFLAGS += -I src/coq-tactic
...@@ -786,14 +786,20 @@ src/coq-tactic/why3tac.ml: src/coq-tactic/why3tac.ml4 ...@@ -786,14 +786,20 @@ src/coq-tactic/why3tac.ml: src/coq-tactic/why3tac.ml4
$(SHOW) 'Camlp $<' $(SHOW) 'Camlp $<'
$(HIDE)$(COQCAMLP) pr_dump.cmo @COQPPLIBS@ pa_macro.cmo -D@coq_compat_version@ -impl $^ -o $@ $(HIDE)$(COQCAMLP) pr_dump.cmo @COQPPLIBS@ pa_macro.cmo -D@coq_compat_version@ -impl $^ -o $@
COQRTAC = -R lib/coq-tactic Why3 -R lib/coq Why3
ifeq (@coq_compat_version@,COQ86)
COQRTAC += -I lib/coq-tactic
endif
src/coq-tactic/.why3-vo-byte: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cma src/coq-tactic/.why3-vo-byte: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cma
$(SHOW) 'Coqc $<' $(SHOW) 'Coqc $<'
$(HIDE)WHY3CONFIG="" $(COQC) -byte -R lib/coq-tactic Why3 -R lib/coq Why3 $< && \ $(HIDE)WHY3CONFIG="" $(COQC) -byte $(COQRTAC) $< && \
touch src/coq-tactic/.why3-vo-byte touch src/coq-tactic/.why3-vo-byte
src/coq-tactic/.why3-vo-opt: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cmxs src/coq-tactic/.why3-vo-opt: lib/coq-tactic/Why3.v lib/coq/BuiltIn.vo lib/coq-tactic/why3tac.cmxs
$(SHOW) 'Coqc $<' $(SHOW) 'Coqc $<'
$(HIDE)WHY3CONFIG="" $(COQC) -opt -R lib/coq-tactic Why3 -R lib/coq Why3 $< && \ $(HIDE)WHY3CONFIG="" $(COQC) -opt $(COQRTAC) $< && \
touch src/coq-tactic/.why3-vo-opt touch src/coq-tactic/.why3-vo-opt
# depend and clean targets # depend and clean targets
...@@ -1570,10 +1576,10 @@ test-session.opt: examples/use_api/create_session.ml lib/why3/why3.cmxa ...@@ -1570,10 +1576,10 @@ test-session.opt: examples/use_api/create_session.ml lib/why3/why3.cmxa
@rm -f test-session.opt why3session.xml why3shapes why3shapes.gz @rm -f test-session.opt why3session.xml why3shapes why3shapes.gz
test-coq-tactic.byte: src/coq-tactic/.why3-vo-byte test-coq-tactic.byte: src/coq-tactic/.why3-vo-byte
$(COQC) -byte -R lib/coq-tactic Why3 -R lib/coq Why3 bench/coq-tactic/test.v $(COQC) -byte $(COQRTAC) bench/coq-tactic/test.v
test-coq-tactic.opt: src/coq-tactic/.why3-vo-opt test-coq-tactic.opt: src/coq-tactic/.why3-vo-opt
$(COQC) -opt -R lib/coq-tactic Why3 -R lib/coq Why3 bench/coq-tactic/test.v $(COQC) -opt $(COQRTAC) bench/coq-tactic/test.v
#only test the compilation of runstrat #only test the compilation of runstrat
test-runstrat.byte: lib/why3/why3.cma lib/why3/META test-runstrat.byte: lib/why3/why3.cma lib/why3/META
......
...@@ -525,11 +525,16 @@ if test "$enable_coq_support" = yes; then ...@@ -525,11 +525,16 @@ if test "$enable_coq_support" = yes; then
COQPPLIBS="$COQLIB/parsing/grammar.cma" COQPPLIBS="$COQLIB/parsing/grammar.cma"
AC_MSG_RESULT($COQVERSION) AC_MSG_RESULT($COQVERSION)
;; ;;
8.5*|trunk) 8.5*)
coq_compat_version="COQ85" coq_compat_version="COQ85"
COQPPLIBS="$OCAMLLIB/unix.cma $OCAMLLIB/threads/threads.cma $COQLIB/grammar/grammar.cma" COQPPLIBS="$OCAMLLIB/unix.cma $OCAMLLIB/threads/threads.cma $COQLIB/grammar/grammar.cma"
AC_MSG_RESULT($COQVERSION) AC_MSG_RESULT($COQVERSION)
;; ;;
8.6*|trunk)
coq_compat_version="COQ86"
COQPPLIBS="$OCAMLLIB/unix.cma $OCAMLLIB/threads/threads.cma $COQLIB/grammar/grammar.cma"
AC_MSG_RESULT($COQVERSION)
;;
*) *)
enable_coq_support=no enable_coq_support=no
AC_MSG_WARN(You need Coq 8.4 or later; Coq discarded) AC_MSG_WARN(You need Coq 8.4 or later; Coq discarded)
......
This diff is collapsed.
...@@ -57,7 +57,7 @@ Proof. ...@@ -57,7 +57,7 @@ Proof.
intros a a_WT v m l u h1. intros a a_WT v m l u h1.
assert (u - l <= 0)%Z as h1' by omega. assert (u - l <= 0)%Z as h1' by omega.
unfold occ. unfold occ.
destruct (u - l)%Z ; try easy. destruct (u - l)%Z ; try reflexivity.
now elim h1'. now elim h1'.
Qed. Qed.
......
...@@ -491,6 +491,18 @@ version_ok = "7.0" ...@@ -491,6 +491,18 @@ version_ok = "7.0"
command = "%l/why3-cpulimit %t %m -s %e -noprompt" command = "%l/why3-cpulimit %t %m -s %e -noprompt"
driver = "drivers/mathematica.drv" driver = "drivers/mathematica.drv"
# Coq 8.6: do not limit memory
[ITP coq]
name = "Coq"
compile_time_support = true
exec = "coqtop -batch"
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"
editor = "coqide"
# Coq 8.5: do not limit memory # Coq 8.5: do not limit memory
[ITP coq] [ITP coq]
name = "Coq" name = "Coq"
...@@ -498,6 +510,8 @@ compile_time_support = true ...@@ -498,6 +510,8 @@ compile_time_support = true
exec = "coqtop -batch" exec = "coqtop -batch"
version_switch = "-v" version_switch = "-v"
version_regexp = "The Coq Proof Assistant, version \\([^ \n]+\\)" version_regexp = "The Coq Proof Assistant, version \\([^ \n]+\\)"
version_ok = "8.5pl3"
version_ok = "8.5pl2"
version_ok = "8.5pl1" version_ok = "8.5pl1"
version_ok = "8.5" version_ok = "8.5"
command = "%e -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f" command = "%e -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f"
......
...@@ -58,12 +58,24 @@ let is_global c t = ...@@ -58,12 +58,24 @@ let is_global c t =
| VarRef id, Var id' -> id = id' | VarRef id, Var id' -> id = id'
| _ -> false | _ -> false
let push_named = Environ.push_named
let betadeltaiota = Closure.betadeltaiota
module RedFlags = Closure.RedFlags
ELSE ELSE
open Universes open Universes
open Globnames open Globnames
open Vars open Vars
IFDEF COQ85 THEN
open Errors open Errors
ELSE
open CErrors
open Stdarg
END
let declare_summary name freeze unfreeze init = let declare_summary name freeze unfreeze init =
Summary.declare_summary name Summary.declare_summary name
...@@ -112,6 +124,34 @@ let find_reference t1 t2 = ...@@ -112,6 +124,34 @@ let find_reference t1 t2 =
let is_global c t = is_global (Lazy.force c) t let is_global c t = is_global (Lazy.force c) t
IFDEF COQ85 THEN
let push_named = Environ.push_named
let betadeltaiota = Closure.betadeltaiota
module RedFlags = Closure.RedFlags
ELSE
let push_named (id, c, t) env =
Environ.push_named
(match c with
| None -> Context.Named.Declaration.LocalAssum (id, t)
| Some b -> Context.Named.Declaration.LocalDef (id, b, t))
env
let pf_hyps gl =
List.map (function
| Context.Named.Declaration.LocalAssum (id, t) -> (id, None, t)
| Context.Named.Declaration.LocalDef (id, b, t) -> (id, Some b, t))
(pf_hyps gl)
let betadeltaiota = CClosure.all
module RedFlags = CClosure.RedFlags
END
DECLARE PLUGIN "why3tac" DECLARE PLUGIN "why3tac"
END END
...@@ -260,7 +300,7 @@ let coq_rename_vars env vars = ...@@ -260,7 +300,7 @@ let coq_rename_vars env vars =
let coq_rename_var env na t = let coq_rename_var env na t =
let avoid = ids_of_named_context (Environ.named_context env) in let avoid = ids_of_named_context (Environ.named_context env) in
let id = next_name_away na avoid in let id = next_name_away na avoid in
id, Environ.push_named (id, None, t) env id, push_named (id, None, t) env
let preid_of_id id = Ident.id_fresh (string_of_id id) let preid_of_id id = Ident.id_fresh (string_of_id id)
...@@ -524,8 +564,8 @@ let rec tr_arith_constant dep t = match kind_of_term t with ...@@ -524,8 +564,8 @@ let rec tr_arith_constant dep t = match kind_of_term t with
let rec tr_type dep tvm env evd t = let rec tr_type dep tvm env evd t =
let t = Reductionops.clos_norm_flags let t = Reductionops.clos_norm_flags
(Closure.RedFlags.red_add_transparent (RedFlags.red_add_transparent
Closure.betadeltaiota (get_transp_state env)) betadeltaiota (get_transp_state env))
env evd t in env evd t in
if is_global coq_Z t then if is_global coq_Z t then
Ty.ty_int Ty.ty_int
...@@ -1358,7 +1398,9 @@ let why3tac ?(timelimit=timelimit) s gl = ...@@ -1358,7 +1398,9 @@ let why3tac ?(timelimit=timelimit) s gl =
| StepLimitExceeded -> error "Step Limit Exceeded" | StepLimitExceeded -> error "Step Limit Exceeded"
| HighFailure -> error ("Prover failure\n" ^ res.pr_output ^ "\n") | HighFailure -> error ("Prover failure\n" ^ res.pr_output ^ "\n")
IFDEF COQ85 THEN IFDEF COQ84 THEN
ELSE
let why3tac ?timelimit s = Proofview.V82.tactic (why3tac ?timelimit s) let why3tac ?timelimit s = Proofview.V82.tactic (why3tac ?timelimit s)
......
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