Commit graph

24 commits

Author SHA1 Message Date
Leonardo de Moura
4773a3be5f feat(library/constructions/no_confusion): add no_confusion_type for new inductive datatype module 2018-09-05 09:55:13 -07:00
Leonardo de Moura
d8e7941116 feat(library/constructions/rec_on): add rec_on for new inductive datatype module 2018-09-04 17:22:16 -07:00
Leonardo de Moura
10a7eccecd feat(library/constructions/cases_on): add cases_on for new inductive datatype module 2018-09-04 09:26:16 -07:00
Leonardo de Moura
af8f3c7bb4 chore(library/constructions): remove injective
It was mainly used to perform dependent elimination with nested
inductive datatypes produced by the inductive compiler.
2018-09-03 17:38:13 -07:00
Leonardo de Moura
cc748c0b17 chore(library/constructions): remove drec (dead code) 2018-09-03 17:32:16 -07:00
Leonardo de Moura
fc96c335fb chore(library/constructions): remove has_sizeof
This will be implemented in Lean in the future.
2018-08-23 11:57:38 -07:00
Leonardo de Moura
e9f843ddf6 refactor(kernel/expr): remove mlocal_* functions
The constructors `mvar` and `fvar` have different memory layouts.
2018-06-22 14:25:31 -07:00
Leonardo de Moura
a7d08d2f3d feat(kernel/inductive/inductive): dependent elimination for inductive predicates
In Lean4, we will not generate non dependent recursors for inductive
predicates. The main goal is to make the shape of the automatically
generated recursors more uniform. The non uniform representation is
leftover from Lean2. In Lean2, we wanted to support different kernels
with different features. For example: we could create proof relevant
kernels, no impredicative universe, etc.
Recall that, in a kernel with an impredicative Prop and no proof
irrelevance, inductive predicates without dependent elimination are
weaker that inductive predicates with dependent elimination.
When proof irrelevance is enabled, we can generate the dependent
recursor from the non dependent one. Actually, the module drec.cpp
generates the dependent recursor.
Now, we only support one kind of kernel, and it doesn't make sense
anymore to generate non dependent recursors for inductive predicates.
This would only produce an unnecessary asymmetry on the inductive
datatype module.

Remark: we had to create non dependent recursors to help the elaborator.
This can be avoid if we improve the elaborator. I will do that in the
new elaborator implemented in Lean.

Remark: equation lemmas are broken for definitions that pattern match on
nested inductive datatypes. The problem is the super messy
`prove_eq_rec_invertible_aux` function. This function will not be needed
after I finish the new inductive datatype support in the kernel.

cc @kha
2018-06-12 13:03:26 -07:00
Leonardo de Moura
cf91139c37 refactor(library/inductive_compiler): remove sizeof lemma generation
Remark: we are in the process of deleting the inductive_compiler
2018-06-12 13:03:25 -07:00
Leonardo de Moura
de48d49b53 feat(kernel): preparing for adding new inductive datatype module 2018-06-01 14:47:49 -07:00
Leonardo de Moura
3c1ccc9b74 refactor(kernel): use m_meta instead of m_trusted 2018-05-31 11:18:00 -07:00
Leonardo de Moura
75c63ec921 refactor(*): list<name> ==> obj_list<name> 2018-05-23 15:48:43 -07:00
Sebastian Ullrich
42eb0c680e feat(kernel/inductive,library/inductive_compiler): do not enforce positivity rule on meta inductives 2017-05-14 19:17:28 -07:00
Leonardo de Moura
36770119b6 feat(library): do not generate C.destruct (for structures), and C.induction_on (for structures and inductive datatypes) 2017-03-15 14:45:13 -07:00
Daniel Selsam
538ac8d187 feat(inductive_compiler): generate injectivity lemmas 2017-03-10 22:27:18 -08:00
Leonardo de Moura
17556758cb feat(library/constructions,library/inductive_compiler): automatically generate dependent eliminator for inductive predicates
The dependent eliminator for an inductive predicate C is called C.drec

TODO: construct dcases_on and drec_on using C.drec

We need this recursor for implementing dependent elimination for
inductive predicates.

We don't need to define acc.drec and eq.drec in the standard library anymore.
2017-02-28 20:58:04 -08:00
Leonardo de Moura
a6f26f0b74 chore(library): poly_unit ==> punit
psum, pprod and punit are used internally.

see #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00
Leonardo de Moura
572751c56e feat(frontends/lean): force user to use meta keyword on meta inductive/structure/class
Before this commit, we were inferring whether an
inductive/structure/class were meta or not. This was bad since the user
had no clue whether the type was trusted (non meta) or not.
Moreover, users could get confused by this behavior and assume the
kernel was allowing trusted code to rely on untrusted one.
2016-09-29 17:56:35 -07:00
Leonardo de Moura
e5ba0d7733 chore(*): cleanup 2016-09-27 17:30:57 -07:00
Leonardo de Moura
d59410cc41 refactor(kernel): support only proof irrelevant mode 2016-09-27 17:18:52 -07:00
Leonardo de Moura
d0d75c0923 refactor(kernel): reduce number of configurations supported in the kernel
Now, eta and impredicativity are assumed to be always true.

Motivation: the rest of the system assumes eta.
Regarding impredicativity, we decided to support only the standard library.
2016-09-27 17:07:01 -07:00
Leonardo de Moura
932d14241b chore(kernel): remove support for mutually inductive datatypes from the kernel 2016-09-10 17:39:17 -07:00
Daniel Selsam
b0c5744eea feat(inductive_compiler): support for mutually inductive types 2016-09-10 14:22:27 -07:00