Coq plug-in (in progress)

parent b4aaa7b0
......@@ -875,23 +875,23 @@ endif
ifeq (@enable_coq_plugin@,yes)
COQGENERATED = src/coq-plugin/g_whytac.ml
COQPGENERATED = src/coq-plugin/g_whytac.ml
COQ_FILES = whytac g_whytac
COQP_FILES = whytac g_whytac
COQMODULES = $(addprefix src/coq-plugin/, $(COQ_FILES))
COQPMODULES = $(addprefix src/coq-plugin/, $(COQP_FILES))
COQDEP = $(addsuffix .dep, $(COQMODULES))
COQCMO = $(addsuffix .cmo, $(COQMODULES))
COQCMX = $(addsuffix .cmx, $(COQMODULES))
COQPDEP = $(addsuffix .dep, $(COQPMODULES))
COQPCMO = $(addsuffix .cmo, $(COQPMODULES))
COQPCMX = $(addsuffix .cmx, $(COQPMODULES))
COQTREES = kernel lib interp parsing proofs pretyping tactics library toplevel
COQINCLUDES = -I src/coq-plugin $(addprefix -I @COQLIB@/, $(COQTREES))
COQPTREES = kernel lib interp parsing proofs pretyping tactics library toplevel
COQPINCLUDES = -I src/coq-plugin $(addprefix -I @COQLIB@/, $(COQPTREES))
$(COQDEP): DEPFLAGS += -I src/coq-plugin
$(COQCMO) $(COQCMX): INCLUDES += $(COQINCLUDES)
$(COQPDEP): DEPFLAGS += -I src/coq-plugin
$(COQPCMO) $(COQPCMX): INCLUDES += $(COQPINCLUDES)
$(COQDEP): $(COQGENERATED)
$(COQPDEP): $(COQPGENERATED)
byte: src/coq-plugin/whytac.cma
opt: src/coq-plugin/whytac.cmxs
......@@ -899,10 +899,10 @@ opt: src/coq-plugin/whytac.cmxs
src/coq-plugin/whytac.cma: BFLAGS+=-rectypes -I +camlp5
src/coq-plugin/whytac.cmxs: OFLAGS+=-rectypes -I +camlp5
src/coq-plugin/whytac.cmxs: src/why3.cmxa $(COQCMX)
src/coq-plugin/whytac.cmxs: src/why3.cmxa $(COQPCMX)
$(OCAMLOPT) $(OFLAGS) -o $@ -shared $^
src/coq-plugin/whytac.cma: src/why3.cma $(COQCMO)
src/coq-plugin/whytac.cma: src/why3.cma $(COQPCMO)
$(OCAMLC) -a $(BFLAGS) -o $@ $^
src/coq-plugin/g_whytac.ml: src/coq-plugin/g_whytac.ml4
......@@ -911,16 +911,16 @@ src/coq-plugin/g_whytac.ml: src/coq-plugin/g_whytac.ml4
# depend and clean targets
ifneq "$(MAKECMDGOALS)" "clean"
include $(COQDEP)
include $(COQPDEP)
endif
depend: $(COQDEP)
depend: $(COQPDEP)
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/*.dep src/coq-plugin/*~
rm -f $(COQGENERATED)
rm -f $(COQPGENERATED)
endif
......
......@@ -399,8 +399,8 @@ if test "$enable_coq_plugin" = yes -a "$CAMLP5O" = no; then
fi
# coq-plugin currently disabled
enable_coq_plugin=no
reason_coq_plugin=" (not yet implemented)"
dnl enable_coq_plugin=no
dnl reason_coq_plugin=" (not yet implemented)"
if test "$enable_coq_libs" = yes; then
AC_CHECK_PROG(COQDEP,coqdep,coqdep,no)
......
......@@ -21,6 +21,6 @@
open Whytac
TACTIC EXTEND Why
[ "why" string(s) ] -> [ whytac s ]
TACTIC EXTEND Why3
[ "why3" string(s) ] -> [ whytac s ]
END
......@@ -3,11 +3,36 @@ Require Export ZArith.
Open Scope Z_scope.
Require Export List.
Ltac ae := why "alt-ergo".
Ltac z3 := why "z3".
Ltac spass := why "spass".
Ltac ae := why3 "alt-ergo".
Ltac Z3 := why3 "z3-2".
Ltac spass := why3 "spass".
Print length.
(*
Inductive sorted (a: Set) : list a -> Prop :=
c: sorted _ (@nil a)
| d: forall x: a, sorted _ (cons x nil).
Goal sorted _ (@nil Z).
ae.
*)
Parameter p: Z -> Prop.
(* let in *)
Goal
let t := Z in
let f := p 0 in
(forall x:t, p x -> p (let y := x+1 in y)) ->
f -> p 1.
ae.
(* cast *)
Goal
(
(forall x:Z, p x -> p (x+1)) -> p (0 : Z) -> p 1 : Prop).
ae.
Qed.
(* type definitions *)
......@@ -24,9 +49,9 @@ Qed.
(* predicate definition *)
Definition p (x:nat) := x=O.
Definition p' (x:nat) := x=O.
Goal p O.
Goal p' O.
ae.
Qed.
......@@ -36,9 +61,11 @@ Goal plus O O = O.
ae.
Qed.
Definition eq (A:Set) (x y : A) := x=y.
Goal eq nat O O.
Definition eq' (A:Set) (x y : A) := x=y.
Goal
eq' nat O O.
ae.
(*
why "z3". (* BUG encoding decorate ici ? *)
......@@ -80,9 +107,7 @@ Qed.
Print In.
Goal In 0 (cons 1 (cons 0 nil)).
spass.
(*ae.*)
(* ICI *)
ae.
Qed.
(* inductive types *)
......@@ -106,13 +131,15 @@ ae.
Qed.
Goal (match (S (S (S O))) with (S (S _)) => True | _ => False end).
spass.
ae.
Qed.
Goal forall a, forall (x: list (list a)), 1<=2 -> match x with nil => 1 | x :: r => 2 end <= 2.
Goal
forall a, forall (x: list (list a)),
1<=2 -> match x with nil => 1 | x :: r => 2 end <= 2.
intros a x.
spass.
Z3.
Qed.
......@@ -156,6 +183,17 @@ Goal forall x : ptree Z, x=x.
ae.
Qed.
Definition a := 0+0.
Definition b := a.
Goal b=0.
ae.
Qed.
Goal b=0.
ae.
Fixpoint ptree_size (a:Set) (t:ptree a) : Z := match t with
| PLeaf => 0
| PNode _ f => 1 + pforest_size _ f end
......@@ -167,10 +205,10 @@ Goal ptree_size _ (@PLeaf Z) = 0.
ae.
Qed.
Goal forall (a:Set), ptree_size a (PLeaf _) = 0.
Goal forall (a:Set), ptree_size a (PLeaf a) = 0.
intros.
(* BUG ICI *)
spass.
ae.
(* TODO: intro context *)
Admitted.
......
This diff is collapsed.
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