coq-plugin: configuration and compilation

parent bf21670e
...@@ -52,10 +52,10 @@ OCAMLYACC = @OCAMLYACC@ ...@@ -52,10 +52,10 @@ OCAMLYACC = @OCAMLYACC@
OCAMLDOC = @OCAMLDOC@ OCAMLDOC = @OCAMLDOC@
OCAMLLIB = @OCAMLLIB@ OCAMLLIB = @OCAMLLIB@
OCAMLBEST = @OCAMLBEST@ OCAMLBEST = @OCAMLBEST@
#CAMLP4 = @CAMLP4O@
OCAMLVERSION = @OCAMLVERSION@ OCAMLVERSION = @OCAMLVERSION@
CAMLP5O = @CAMLP5O@
#PSVIEWER = @PSVIEWER@ #PSVIEWER = @PSVIEWER@
#PDFVIEWER = @PDFVIEWER@ #PDFVIEWER = @PDFVIEWER@
...@@ -338,25 +338,54 @@ clean:: ...@@ -338,25 +338,54 @@ clean::
# Coq plugin # Coq plugin
############## ##############
COQGENERATED = src/coq-plugin/g_whytac.ml
COQ_FILES = whytac g_whytac
COQMODULES = $(addprefix src/coq-plugin/, $(COQ_FILES))
COQML = $(addsuffix .ml, $(COQMODULES))
COQCMO = $(addsuffix .cmo, $(COQMODULES))
COQCMX = $(addsuffix .cmx, $(COQMODULES))
COQTREES = kernel lib interp parsing proofs pretyping tactics library toplevel
COQINCLUDES = -I src/coq-plugin $(addprefix -I @COQLIB@/, $(COQTREES))
$(COQCMO) $(COQCMX): INCLUDES = $(COQINCLUDES)
ifeq (@enable_coq_support@,yes) ifeq (@enable_coq_support@,yes)
byte: src/coq-plugin/whytac.cma 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 toplevel
src/coq-plugin/whytac.cma: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES))
src/coq-plugin/whytac.cmxs: INCLUDES = $(addprefix -I @COQLIB@/, $(COQTREES))
src/coq-plugin/whytac.cma: BFLAGS+=-rectypes -I +camlp5 src/coq-plugin/whytac.cma: BFLAGS+=-rectypes -I +camlp5
src/coq-plugin/whytac.cmxs: OFLAGS+=-rectypes -I +camlp5 src/coq-plugin/whytac.cmxs: OFLAGS+=-rectypes -I +camlp5
src/coq-plugin/whytac.cmxs: src/why.cmxa src/coq-plugin/whytac.ml src/coq-plugin/whytac.cmxs: src/why.cmxa $(COQCMX)
$(OCAMLOPT) $(OFLAGS) -o $@ -shared $^ $(OCAMLOPT) $(OFLAGS) -o $@ -shared $^
src/coq-plugin/whytac.cma: src/why.cma src/coq-plugin/whytac.ml src/coq-plugin/whytac.cma: src/why.cma $(COQCMO)
$(OCAMLC) -a $(BFLAGS) -o $@ $^ $(OCAMLC) -a $(BFLAGS) -o $@ $^
src/coq-plugin/g_whytac.ml: src/coq-plugin/g_whytac.ml4
$(CAMLP5O) pr_o.cmo @COQLIB@/parsing/grammar.cma -impl $^ -o $@
# depend and clean targets
include .depend.coq
.depend.coq: $(COQGENERATED)
$(OCAMLDEP) -slash -I src -I src/coq-plugin $(COQML) > $@
depend: .depend.coq
clean::
rm -f src/coq-plugin/*.cm[iox] src/coq-plugin/*.o
rm -f src/coq-plugin/*.cma src/coq-plugin/*.cmxs
rm -f src/coq-plugin/*.annot src/coq-plugin/*~
rm -f $(COQGENERATED)
rm -f .depend.coq
####### #######
# tools # tools
####### #######
......
...@@ -211,6 +211,8 @@ else ...@@ -211,6 +211,8 @@ else
fi fi
fi fi
AC_CHECK_PROG(CAMLP5O,camlp5o,camlp5o,no)
# checking for sqlite3 # checking for sqlite3
if test "$enable_proof_manager" = yes ; then if test "$enable_proof_manager" = yes ; then
AC_CHECK_FILE($OCAMLLIB/sqlite3/sqlite3.cma,,enable_proof_manager=no) AC_CHECK_FILE($OCAMLLIB/sqlite3/sqlite3.cma,,enable_proof_manager=no)
...@@ -253,8 +255,8 @@ fi ...@@ -253,8 +255,8 @@ fi
if test "$enable_coq_support" = yes; then if test "$enable_coq_support" = yes; then
AC_CHECK_FILE($COQLIB/kernel/term.cmi,,enable_coq_support=no) AC_CHECK_FILE($COQLIB/kernel/term.cmi,,enable_coq_support=no)
fi fi
if test "$enable_coq_support" = yes; then if test "$CAMLP5O" = no; then
AC_CHECK_FILE($OCAMLLIB/camlp5/gramext.cmi,,enable_coq_support=no) enable_coq_support=no
fi fi
#Viewer for ps and pdf #Viewer for ps and pdf
...@@ -289,6 +291,8 @@ dnl AC_SUBST(FORPACK) ...@@ -289,6 +291,8 @@ dnl AC_SUBST(FORPACK)
dnl AC_SUBST(OCAMLGRAPHLIB) dnl AC_SUBST(OCAMLGRAPHLIB)
dnl AC_SUBST(OCAMLWEB) dnl AC_SUBST(OCAMLWEB)
AC_SUBST(CAMLP5O)
AC_SUBST(enable_ide) AC_SUBST(enable_ide)
AC_SUBST(enable_plugins) AC_SUBST(enable_plugins)
AC_SUBST(DYNLINK) AC_SUBST(DYNLINK)
......
(*i camlp4deps: "parsing/grammar.cma" i*)
open Whytac
TACTIC EXTEND Why
[ "why" string(s) ] -> [ whytac s ]
END
...@@ -4,6 +4,8 @@ Open Scope Z_scope. ...@@ -4,6 +4,8 @@ Open Scope Z_scope.
Require Export List. Require Export List.
Ltac ae := why "alt-ergo". Ltac ae := why "alt-ergo".
Ltac z3 := why "z3".
Ltac spass := why "spass".
(* type definitions *) (* type definitions *)
...@@ -22,7 +24,7 @@ Qed. ...@@ -22,7 +24,7 @@ Qed.
Definition p (x:nat) := x=O. Definition p (x:nat) := x=O.
Goal p O. Goal p O.
ae. spass.
Qed. Qed.
Definition eq (A:Set) (x y : A) := x=y. Definition eq (A:Set) (x y : A) := x=y.
...@@ -53,7 +55,7 @@ Qed. ...@@ -53,7 +55,7 @@ Qed.
Definition id A (x:A) := x. Definition id A (x:A) := x.
Goal id nat O = O. Goal id nat O = O.
ae. spass.
Qed. Qed.
(* inductive types *) (* inductive types *)
...@@ -63,7 +65,7 @@ Parameter P : (nat -> nat) -> Prop. ...@@ -63,7 +65,7 @@ Parameter P : (nat -> nat) -> Prop.
Goal forall (a:Set), forall x:nat, x=S O -> P S -> Goal forall (a:Set), forall x:nat, x=S O -> P S ->
let y := (S (S O)) in S x=y. let y := (S (S O)) in S x=y.
intros. intros.
ae. spass.
Qed. Qed.
Goal forall (a:Set), forall x:Z, x=1 -> P S -> let y := 2 in x+1=y. Goal forall (a:Set), forall x:Z, x=1 -> P S -> let y := 2 in x+1=y.
...@@ -73,7 +75,7 @@ Qed. ...@@ -73,7 +75,7 @@ Qed.
Goal forall x: list nat, x=x. Goal forall x: list nat, x=x.
intros. intros.
ae. spass.
Qed. Qed.
(* Mutually inductive types *) (* Mutually inductive types *)
...@@ -87,7 +89,7 @@ with forest : Set := ...@@ -87,7 +89,7 @@ with forest : Set :=
| Cons : tree -> forest -> forest. | Cons : tree -> forest -> forest.
Goal forall x : tree, x=x. Goal forall x : tree, x=x.
ae. spass.
Qed. Qed.
(* Polymorphic, Mutually inductive types *) (* Polymorphic, Mutually inductive types *)
...@@ -101,7 +103,7 @@ with pforest (a:Set) : Set := ...@@ -101,7 +103,7 @@ with pforest (a:Set) : Set :=
| PCons : ptree a -> pforest a -> pforest a. | PCons : ptree a -> pforest a -> pforest a.
Goal forall x : ptree Z, x=x. Goal forall x : ptree Z, x=x.
ae. spass.
Qed. Qed.
(* the same, without parameters *) (* the same, without parameters *)
...@@ -115,6 +117,6 @@ with pforest' : Type -> Type := ...@@ -115,6 +117,6 @@ with pforest' : Type -> Type :=
| PCons' : forall (a:Type), ptree' a -> pforest' a -> pforest' a. | PCons' : forall (a:Type), ptree' a -> pforest' a -> pforest' a.
Goal forall x : ptree' Z, x=x. Goal forall x : ptree' Z, x=x.
ae. spass.
Qed. Qed.
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