Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
f82ee030
Commit
f82ee030
authored
Mar 16, 2012
by
Jean-Christophe Filliâtre
Browse files
Coq plug-in (in progress)
parent
b4aaa7b0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Makefile.in
View file @
f82ee030
...
...
@@ -875,23 +875,23 @@ endif
ifeq
(@enable_coq_plugin@,yes)
COQGENERATED
=
src/coq-plugin/g_whytac.ml
COQ
P
GENERATED
=
src/coq-plugin/g_whytac.ml
COQ_FILES
=
whytac g_whytac
COQ
P
_FILES
=
whytac g_whytac
COQMODULES
=
$(
addprefix
src/coq-plugin/,
$(COQ_FILES)
)
COQ
P
MODULES
=
$(
addprefix
src/coq-plugin/,
$(COQ
P
_FILES)
)
COQDEP
=
$(
addsuffix
.dep,
$(COQMODULES)
)
COQCMO
=
$(
addsuffix
.cmo,
$(COQMODULES)
)
COQCMX
=
$(
addsuffix
.cmx,
$(COQMODULES)
)
COQ
P
DEP
=
$(
addsuffix
.dep,
$(COQ
P
MODULES)
)
COQ
P
CMO
=
$(
addsuffix
.cmo,
$(COQ
P
MODULES)
)
COQ
P
CMX
=
$(
addsuffix
.cmx,
$(COQ
P
MODULES)
)
COQTREES
=
kernel lib interp parsing proofs pretyping tactics library toplevel
COQINCLUDES
=
-I
src/coq-plugin
$(
addprefix
-I
@COQLIB@/,
$(COQTREES)
)
COQ
P
TREES
=
kernel lib interp parsing proofs pretyping tactics library toplevel
COQ
P
INCLUDES
=
-I
src/coq-plugin
$(
addprefix
-I
@COQLIB@/,
$(COQ
P
TREES)
)
$(COQDEP)
:
DEPFLAGS += -I src/coq-plugin
$(COQCMO) $(COQCMX)
:
INCLUDES += $(COQINCLUDES)
$(COQ
P
DEP)
:
DEPFLAGS += -I src/coq-plugin
$(COQ
P
CMO) $(COQ
P
CMX)
:
INCLUDES += $(COQ
P
INCLUDES)
$(COQDEP)
:
$(COQGENERATED)
$(COQ
P
DEP)
:
$(COQ
P
GENERATED)
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 $(COQ
P
CMX)
$(OCAMLOPT)
$(OFLAGS)
-o
$@
-shared
$^
src/coq-plugin/whytac.cma
:
src/why3.cma $(COQCMO)
src/coq-plugin/whytac.cma
:
src/why3.cma $(COQ
P
CMO)
$(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
$(COQ
P
DEP)
endif
depend
:
$(COQDEP)
depend
:
$(COQ
P
DEP)
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
$(COQ
P
GENERATED)
endif
...
...
configure.in
View file @
f82ee030
...
...
@@ -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)
...
...
src/coq-plugin/g_whytac.ml4
View file @
f82ee030
...
...
@@ -21,6 +21,6 @@
open Whytac
TACTIC EXTEND Why
[ "why" string(s) ] -> [ whytac s ]
TACTIC EXTEND Why
3
[ "why
3
" string(s) ] -> [ whytac s ]
END
src/coq-plugin/test.v
View file @
f82ee030
...
...
@@ -3,11 +3,36 @@ Require Export ZArith.
Open
Scope
Z_scope
.
Require
Export
List
.
Ltac
ae
:=
why
"alt-ergo"
.
Ltac
z
3
:=
why
"z3"
.
Ltac
spass
:=
why
"spass"
.
Ltac
ae
:=
why
3
"alt-ergo"
.
Ltac
Z
3
:=
why
3
"z3
-2
"
.
Ltac
spass
:=
why
3
"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
.
...
...
src/coq-plugin/whytac.ml
View file @
f82ee030
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment