Commit 41e2a5b8 authored by Claude Marche's avatar Claude Marche

Compiles with Coq 8.4

parent 4d2d92ca
...@@ -785,9 +785,9 @@ endif ...@@ -785,9 +785,9 @@ endif
ifeq (@enable_coq_plugin@,yes) ifeq (@enable_coq_plugin@,yes)
COQPGENERATED = src/coq-tactic/g_why3tac.ml COQPGENERATED = src/coq-tactic/coqCompat.ml src/coq-tactic/g_why3tac.ml
COQP_FILES = why3tac g_why3tac COQP_FILES = coqCompat why3tac g_why3tac
COQPMODULES = $(addprefix src/coq-tactic/, $(COQP_FILES)) COQPMODULES = $(addprefix src/coq-tactic/, $(COQP_FILES))
...@@ -806,6 +806,10 @@ $(COQPDEP): $(COQPGENERATED) ...@@ -806,6 +806,10 @@ $(COQPDEP): $(COQPGENERATED)
byte: src/coq-tactic/.why3-vo-byte byte: src/coq-tactic/.why3-vo-byte
opt: src/coq-tactic/.why3-vo-opt opt: src/coq-tactic/.why3-vo-opt
src/coq-tactic/coqCompat.cmo: BFLAGS+=-rectypes
src/coq-tactic/coqCompat.cmx: OFLAGS+=-rectypes
src/coq-tactic/why3tac.cmo: BFLAGS+=-rectypes -I +camlp5
src/coq-tactic/why3tac.cmx: BFLAGS+=-rectypes -I +camlp5
lib/coq-tactic/why3tac.cma: BFLAGS+=-rectypes -I +camlp5 lib/coq-tactic/why3tac.cma: BFLAGS+=-rectypes -I +camlp5
lib/coq-tactic/why3tac.cmxs: OFLAGS+=-rectypes -I +camlp5 lib/coq-tactic/why3tac.cmxs: OFLAGS+=-rectypes -I +camlp5
......
...@@ -389,13 +389,14 @@ else ...@@ -389,13 +389,14 @@ else
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.0*|8.1*|8.2*) 8.3*)
enable_coq_support=no enable_coq_support=yes
AC_MSG_WARN(You need Coq 8.3 or later; Coq discarded) cp -f src/coq-tactic/coqCompat.8.3.ml src/coq-tactic/coqCompat.ml
reason_coq_support=" (need version 8.3 or later)" AC_MSG_RESULT($COQVERSION)
;; ;;
8.*|trunk) 8.*|trunk)
enable_coq_support=yes enable_coq_support=yes
cp -f src/coq-tactic/coqCompat.8.4.ml src/coq-tactic/coqCompat.ml
AC_MSG_RESULT($COQVERSION) AC_MSG_RESULT($COQVERSION)
;; ;;
*) *)
......
let body_of_constant c = c.const_body
let body_of_constant = Declarations.body_of_constant
val body_of_constant :
Declarations.constant_body -> Declarations.constr_substituted option
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
(**************************************************************************) (**************************************************************************)
open Names open Names
open Nameops
open Namegen open Namegen
open Term open Term
open Termops open Termops
...@@ -504,7 +503,7 @@ and tr_global_ts dep env r = ...@@ -504,7 +503,7 @@ and tr_global_ts dep env r =
let (_,vars), _, t = decomp_type_quantifiers env ty in let (_,vars), _, t = decomp_type_quantifiers env ty in
if not (is_Set t) && not (is_Type t) then raise NotFO; if not (is_Set t) && not (is_Type t) then raise NotFO;
let id = preid_of_id (Nametab.basename_of_global r) in let id = preid_of_id (Nametab.basename_of_global r) in
let ts = match (Global.lookup_constant c).const_body with let ts = match CoqCompat.body_of_constant (Global.lookup_constant c) with
| Some b -> | Some b ->
let b = force b in let b = force b in
let tvm, env, t = decomp_type_lambdas Idmap.empty env vars b in let tvm, env, t = decomp_type_lambdas Idmap.empty env vars b in
...@@ -652,7 +651,7 @@ and make_one_ls dep env r = ...@@ -652,7 +651,7 @@ and make_one_ls dep env r =
add_poly_arity ls vars add_poly_arity ls vars
and decompose_definition dep env c = and decompose_definition dep env c =
let dl = match (Global.lookup_constant c).const_body with let dl = match CoqCompat.body_of_constant (Global.lookup_constant c) with
| None -> | None ->
[ConstRef c, None] [ConstRef c, None]
| Some b -> | Some b ->
...@@ -1126,8 +1125,10 @@ let tr_top_decl = function ...@@ -1126,8 +1125,10 @@ let tr_top_decl = function
| _, Lib.CompilingLibrary _ | _, Lib.CompilingLibrary _
| _, Lib.OpenedModule _ | _, Lib.OpenedModule _
| _, Lib.ClosedModule _ | _, Lib.ClosedModule _
(*
| _, Lib.OpenedModtype _ | _, Lib.OpenedModtype _
| _, Lib.ClosedModtype _ | _, Lib.ClosedModtype _
*)
| _, Lib.OpenedSection _ | _, Lib.OpenedSection _
| _, Lib.ClosedSection _ | _, Lib.ClosedSection _
| _, Lib.FrozenState _ -> () | _, Lib.FrozenState _ -> ()
......
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