Commit ac395e54 authored by Guillaume Melquiond's avatar Guillaume Melquiond

Make the why3tac plugin compatible with both Coq 8.4 and 8.5.

parent 403a0f08
......@@ -137,8 +137,7 @@ why3.conf
/src/config.sh
# Coq tactic
/src/coq-tactic/coqCompat.ml
/src/coq-tactic/g_why3tac.ml
/src/coq-tactic/why3tac.ml
/src/coq-tactic/.why3-vo-*
# PVS
......
......@@ -752,9 +752,9 @@ install_local:: bin/why3session
ifeq (@enable_coq_tactic@,yes)
COQPGENERATED = src/coq-tactic/coqCompat.ml src/coq-tactic/g_why3tac.ml
COQPGENERATED = src/coq-tactic/why3tac.ml
COQP_FILES = coqCompat why3tac g_why3tac
COQP_FILES = why3tac
COQPMODULES = $(addprefix src/coq-tactic/, $(COQP_FILES))
......@@ -762,7 +762,7 @@ COQPDEP = $(addsuffix .dep, $(COQPMODULES))
COQPCMO = $(addsuffix .cmo, $(COQPMODULES))
COQPCMX = $(addsuffix .cmx, $(COQPMODULES))
COQPTREES = kernel lib interp parsing proofs pretyping tactics library toplevel
COQPTREES = kernel interp intf lib library parsing pretyping proofs printing tactics toplevel
COQPINCLUDES = -I src/coq-tactic -I +camlp5 $(addprefix -I @COQLIB@/, $(COQPTREES)) @ZIPINCLUDE@
$(COQPDEP): DEPFLAGS += -I src/coq-tactic
......@@ -775,9 +775,6 @@ $(COQPDEP): $(COQPGENERATED)
byte: src/coq-tactic/.why3-vo-byte
opt: src/coq-tactic/.why3-vo-opt
src/coq-tactic/coqCompat.ml: src/coq-tactic/coqCompat@coq_compat_version@.ml
cp -f $< $@
lib/coq-tactic/why3tac.cmxs: OFLAGS += $(addsuffix .cmxa, @ZIPLIB@)
lib/coq-tactic/why3tac.cmxs: OFLAGS += $(addsuffix .cmx, @MENHIRLIB@)
......@@ -792,18 +789,18 @@ lib/coq-tactic/why3tac.cma: lib/why3/why3.cma $(COQPCMO)
$(if $(QUIET),@echo 'Linking $@' &&) \
$(OCAMLC) -a $(BFLAGS) -o $@ $^
src/coq-tactic/g_why3tac.ml: src/coq-tactic/g_why3tac.ml4
src/coq-tactic/why3tac.ml: src/coq-tactic/why3tac.ml4
$(if $(QUIET),@echo 'Camlp5 $<' &&) \
$(CAMLP5O) pr_o.cmo @COQLIB@/parsing/grammar.cma -impl $^ -o $@
$(CAMLP5O) pr_dump.cmo @COQPPLIBS@ pa_macro.cmo -D@coq_compat_version@ -impl $^ -o $@
src/coq-tactic/.why3-vo-byte: lib/coq-tactic/Why3.v lib/coq-tactic/why3tac.cma
$(if $(QUIET),@echo 'Coqc $<' &&) \
WHY3CONFIG="" $(COQC) -byte -I lib/coq-tactic/ $< && \
WHY3CONFIG="" $(COQC) -byte -R lib/coq-tactic Why3 $< && \
touch src/coq-tactic/.why3-vo-byte
src/coq-tactic/.why3-vo-opt: lib/coq-tactic/Why3.v lib/coq-tactic/why3tac.cmxs
$(if $(QUIET),@echo 'Coqc $<' &&) \
WHY3CONFIG="" $(COQC) -opt -I lib/coq-tactic/ $< && \
WHY3CONFIG="" $(COQC) -opt -R lib/coq-tactic Why3 $< && \
touch src/coq-tactic/.why3-vo-opt
# depend and clean targets
......@@ -877,7 +874,7 @@ COQVD = $(addsuffix .vd, $(COQLIBS_FILES))
%.vd: %.v
$(if $(QUIET),@echo 'Coqdep $<' &&) \
$(COQDEP) -slash -R lib/coq Why3 $< > $@
$(COQDEP) -R lib/coq Why3 $< > $@
drivers/coq-realizations.aux: Makefile
$(if $(QUIET),@echo 'Generate $@' &&) \
......
......@@ -497,9 +497,16 @@ else
COQVERSION=`$COQC -v | sed -n -e 's|.*version* *\([[^ ]]*\) .*$|\1|p' `
case $COQVERSION in
8.4*|trunk)
8.4*)
enable_coq_support=yes
coq_compat_version=".8.4"
coq_compat_version="COQ84"
COQPPLIBS="$COQLIB/parsing/grammar.cma"
AC_MSG_RESULT($COQVERSION)
;;
8.5*|trunk)
enable_coq_support=yes
coq_compat_version="COQ85"
COQPPLIBS="$OCAMLLIB/unix.cma $OCAMLLIB/threads/threads.cma $COQLIB/grammar/grammar.cma"
AC_MSG_RESULT($COQVERSION)
;;
*)
......@@ -755,7 +762,7 @@ AC_SUBST(coq_compat_version)
AC_SUBST(COQC)
AC_SUBST(COQDEP)
AC_SUBST(COQLIB)
AC_SUBST(COQVERSION)
AC_SUBST(COQPPLIBS)
AC_SUBST(COMPILETIMECOQ)
AC_SUBST(enable_pvs_libs)
......
......@@ -462,7 +462,7 @@ version_ok = "8.4pl3"
version_ok = "8.4pl2"
version_ok = "8.4pl1"
version_ok = "8.4"
command = "%l/why3-cpulimit 0 %m -s %e -I %l/coq-tactic -R %l/coq Why3 -l %f"
command = "%l/why3-cpulimit 0 %m -s %e -R %l/coq-tactic Why3 -R %l/coq Why3 -l %f"
driver = "drivers/coq.drv"
editor = "coqide"
......@@ -503,7 +503,7 @@ command = "coqide -I %l/coq-tactic -R %l/coq Why3 %f"
[editor proofgeneral-coq]
name = "Emacs/ProofGeneral/Coq"
command = "emacs --eval \"(setq coq-load-path '(\\\"%l/coq-tactic\\\" \
command = "emacs --eval \"(setq coq-load-path '((\\\"%l/coq-tactic\\\" \\\"Why3\\\") \
(\\\"%l/coq\\\" \\\"Why3\\\")))\" %f"
[editor isabelle-jedit]
......
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2014 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
let body_of_constant c = c.Declarations.const_body
let on_leaf_node node f =
match node with
| Lib.Leaf lobj -> f lobj
| Lib.CompilingLibrary _
| Lib.OpenedModule _
| Lib.ClosedModule _
| Lib.OpenedModtype _
| Lib.ClosedModtype _
| Lib.OpenedSection _
| Lib.ClosedSection _
| Lib.FrozenState _ -> ()
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2014 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
let body_of_constant = Declarations.body_of_constant
let on_leaf_node node f =
match node with
| Lib.Leaf lobj -> f lobj
| Lib.CompilingLibrary _
| Lib.OpenedModule _
| Lib.ClosedModule _
| Lib.OpenedSection _
| Lib.ClosedSection _
| Lib.FrozenState _ -> ()
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2014 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
val body_of_constant :
Declarations.constant_body -> Declarations.constr_substituted option
val on_leaf_node : Lib.node -> (Libobject.obj -> unit) -> unit
(********************************************************************)
(* *)
(* The Why3 Verification Platform / The Why3 Development Team *)
(* Copyright 2010-2013 -- INRIA - CNRS - Paris-Sud University *)
(* *)
(* This software is distributed under the terms of the GNU Lesser *)
(* General Public License version 2.1, with the special exception *)
(* on linking described in file LICENSE. *)
(* *)
(********************************************************************)
(*i camlp4deps: "parsing/grammar.cma" i*)
open Why3tac
TACTIC EXTEND Why3
[ "why3" string(s) ] -> [ why3tac s ]
| [ "why3" string(s) "timelimit" integer(n) ] -> [ why3tac ~timelimit:n s ]
END
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