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
b985b6e0
Commit
b985b6e0
authored
Apr 14, 2010
by
Jean-Christophe Filliâtre
Browse files
coq-plugin: inductive types (in progress)
parent
490f7095
Changes
2
Show whitespace changes
Inline
Side-by-side
src/coq-plugin/test.v
View file @
b985b6e0
...
@@ -6,5 +6,5 @@ Parameter foo : Set -> Set.
...
@@ -6,5 +6,5 @@ Parameter foo : Set -> Set.
Definition
t
:
Set
:=
foo
Z
.
Definition
t
:
Set
:=
foo
Z
.
Definition
u
:
Set
:=
foo
t
.
Definition
u
:
Set
:=
foo
t
.
Goal
forall
x
:
u
,
x
=
x
.
Goal
forall
x
:
nat
,
x
=
x
.
why
.
why
.
src/coq-plugin/whytac.ml
View file @
b985b6e0
...
@@ -256,7 +256,7 @@ and tr_global_ts env r =
...
@@ -256,7 +256,7 @@ and tr_global_ts env r =
let
b
=
force
b
in
let
b
=
force
b
in
let
(
tv
,
vars
)
,
env
,
t
=
decomp_type_lambdas
env
b
in
let
(
tv
,
vars
)
,
env
,
t
=
decomp_type_lambdas
env
b
in
let
def
=
Some
(
tr_type
tv
env
t
)
in
let
def
=
Some
(
tr_type
tv
env
t
)
in
Ty
.
create_tysymbol
id
vars
None
Ty
.
create_tysymbol
id
vars
def
(* FIXME: is it correct to use None when NotFO? *)
(* FIXME: is it correct to use None when NotFO? *)
|
None
->
|
None
->
let
tv
=
let
tv
=
...
@@ -268,7 +268,31 @@ and tr_global_ts env r =
...
@@ -268,7 +268,31 @@ and tr_global_ts env r =
task
:=
Task
.
add_ty_decl
!
task
[
ts
,
Decl
.
Tabstract
];
task
:=
Task
.
add_ty_decl
!
task
[
ts
,
Decl
.
Tabstract
];
ts
ts
|
IndRef
i
->
|
IndRef
i
->
assert
false
(*TODO*)
Format
.
eprintf
"ici@."
;
let
mib
,
_
=
Global
.
lookup_inductive
i
in
let
make_one_ts
j
_
=
let
r
=
IndRef
(
ith_mutual_inductive
i
j
)
in
let
ty
=
Global
.
type_of_global
r
in
let
tv
,
_
,
t
=
decomp_type_quantifiers
env
ty
in
if
not
(
is_Set
t
)
&&
not
(
is_Type
t
)
then
raise
NotFO
;
let
id
=
preid_of_id
(
Nametab
.
id_of_global
r
)
in
let
tv
=
List
.
map
(
fun
x
->
Ty
.
create_tvsymbol
(
preid_of_id
x
))
tv
in
let
ts
=
Ty
.
create_tysymbol
id
tv
None
in
add_global
global_ts
r
(
Some
ts
)
in
Array
.
iteri
make_one_ts
mib
.
mind_packets
;
let
make_one
j
ib
=
let
ls
=
[]
in
let
r
=
IndRef
(
ith_mutual_inductive
i
j
)
in
let
ts
=
lookup_global
global_ts
r
in
ts
,
Decl
.
Talgebraic
ls
in
let
decl
=
Array
.
mapi
make_one
mib
.
mind_packets
in
let
decl
=
Array
.
to_list
decl
in
task
:=
Task
.
add_ty_decl
!
task
decl
;
lookup_global
global_ts
r
(* assumption: t:T:Set *)
(* assumption: t:T:Set *)
and
tr_term
tv
bv
env
t
=
and
tr_term
tv
bv
env
t
=
...
...
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