Commit graph

3675 commits

Author SHA1 Message Date
Leonardo de Moura
9e7e600ad7 feat(kernel): add expr.proj constructor
TODO: implement infer_proj and reduce_proj
2018-06-19 15:45:49 -07:00
Leonardo de Moura
d87dfbfb03 chore(library/equations_compiler): remove equations macro 2018-06-19 13:41:08 -07:00
Leonardo de Moura
140e906267 chore(library/equations_compiler): remove equation and no_equation macros 2018-06-19 13:41:07 -07:00
Leonardo de Moura
b4f4924be4 chore(library/equations_compiler): remove as_pattern macro 2018-06-19 13:41:07 -07:00
Leonardo de Moura
c0a9b0bb4b chore(frontends/lean): remove field_notation macro
In the new parser, field_notation will be a syntax object.
2018-06-19 13:41:07 -07:00
Sebastian Ullrich
51d3ff21eb feat(library/init/control/state): monad_state: add specialized MonadState methods + modify
Absent inlining, these may perform better than `lift` when e.g. used with an
implementation based on unboxed tuples
2018-06-19 13:01:15 +02:00
Leonardo de Moura
970d14afa9 refactor(frontends/lean/structure_instance): implement structure instances using mdata 2018-06-18 15:57:42 -07:00
Leonardo de Moura
f948892505 refactor(frontends/lean/choice): use mdata to implement choice 2018-06-18 14:21:11 -07:00
Leonardo de Moura
b84090aaca feat(library/annotation): remove annonation macro
We now use the new `expr.mdata` constructor.
2018-06-18 13:39:02 -07:00
Leonardo de Moura
0847571ea6 feat(kernel): add mdata constructor 2018-06-18 13:36:22 -07:00
Sebastian Ullrich
70970ce5e0 feat(library/init/lean/parser/reader): add simplistic implementation of a tiny initial part of the Lean reader
Maybe 'reader' isn't the best name.
2018-06-18 19:23:58 +02:00
Sebastian Ullrich
bf9bf19215 doc(library/init/lean/parser/parser_t): some monad_parser documentation 2018-06-18 13:50:05 +02:00
Leonardo de Moura
a49de9ccd3 feat(library/init/lean): add kvmap
We use it to implement `expr.mdata` and `options`
2018-06-15 16:05:11 -07:00
Leonardo de Moura
e80ad07590 chore(library/init/core): remove dead code 2018-06-15 16:05:11 -07:00
Sebastian Ullrich
7ae87705c2 feat(library/init/lean/parser/parser_t): introduce monad_parser 2018-06-15 17:48:20 +02:00
Leonardo de Moura
71fc35af1d chore(library/vm): remove meta rb_map
We should use the non-meta rbmap that is implemented in Lean.
2018-06-14 17:34:43 -07:00
Leonardo de Moura
0394018e98 chore(library/init/lean/macro): update TODO 2018-06-14 16:28:34 -07:00
Leonardo de Moura
882fa6e71f fix(library/init/meta/expr): order does not match C++ implementation 2018-06-14 16:12:02 -07:00
Leonardo de Moura
73e067d361 feat(kernel): add expression literals 2018-06-14 14:55:14 -07:00
Leonardo de Moura
3e846e1fc9 chore(library): remove unnecessary inaccessible annotations 2018-06-14 11:33:00 -07:00
Leonardo de Moura
70fc656931 refactor(library/init/data/nat/basic): remove nat.less_than_or_equal inductive predicate
We now define nat.le using (nat.ble : nat -> nat -> bool) function.
We will add builtin support for reducing `nat.ble` efficiently when the arguments are the to be added nat literals.
2018-06-14 11:30:09 -07:00
Leonardo de Moura
021bc40e95 feat(library/init/lean/expr): new lean.expr type 2018-06-13 15:44:15 -07:00
Leonardo de Moura
ba598ada1a fix(library/init/meta/expr): expose quote constructor 2018-06-12 17:55:27 -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
e9b4b811de chore(library/equations_compiler/util): disable generation of equational lemmas
@kha, `eqn_compiler.lemmas` is false by default.
I will keep them disabled until I remove the inductive compiler.
I'm building the new inductive datatype module (to replace the inductive
compiler), and the lemmas will fail to be proved in the next commits
until the transition is complete.
2018-06-12 13:03:25 -07:00
Sebastian Ullrich
b1aff14650 feat(library/init/lean/parser/syntax.lean): simplify syntax debug output 2018-06-07 14:57:13 +02:00
Sebastian Ullrich
613b6805b3 chore(library/init/lean/parser/parser_t.lean): fix comments 2018-06-07 14:57:13 +02:00
Sebastian Ullrich
bdfdd1288e feat(library/init/lean/parser/macro): allow expanders to be skipped dynamically 2018-06-07 14:57:13 +02:00
Leonardo de Moura
ee7bc150f2 chore(library/init/meta/expr): remove elaborated : bool parameter from expr 2018-06-06 09:47:01 -07:00
Leonardo de Moura
3a7229add3 chore(library/init): pexpr is now an opaque constant 2018-06-06 09:36:22 -07:00
Leonardo de Moura
441b9077b2 feat(library/comp_val): add mk_name_val_ne_proof
We need this procedure otherwise it takes forever to prove equation lemmas
for definitions such as:

```
def macros : name → option macro
| `lambda := some lambda_macro
| `intro_x := some intro_x_macro
| _ := none
```

We never experienced this problem in Lean3 because we used `name`
literals only occurred in patterns of *meta* definitions. So, no
equation lemma was generated.

@kha `def macros` was taking more than 1 second to elaborate on my
machine. It is now instantaneous.
2018-06-06 09:18:59 -07:00
Leonardo de Moura
e160154d14 fix(library/init/meta/name): duplicate 2018-06-06 08:47:28 -07:00
Leonardo de Moura
530c437953 feat(library/init/data/char/basic): missing theorems for equation compiler 2018-06-06 08:47:17 -07:00
Leonardo de Moura
dda1f0ebaa chore(library/init/meta/interactive): remove more tactics 2018-06-06 08:46:48 -07:00
Leonardo de Moura
e4a168af91 chore(library/init/meta): remove goal tagging feature 2018-06-06 08:46:47 -07:00
Sebastian Ullrich
1c380037d3 refactor(library/init/lean/parser/syntax): replace syntax.lst with syntax.node, remove span field from syntax_node 2018-06-06 15:46:39 +02:00
Sebastian Ullrich
732c823646 feat(library/init/lean/parser): remove syntax_id, use De Bruijn indices instead 2018-06-06 15:36:28 +02:00
Leonardo de Moura
50ce4e8ae9 chore(library/init/meta/interactive_base): remove Lean3 format macros 2018-06-05 16:29:26 -07:00
Leonardo de Moura
bd7138349a chore(library/init/meta/pexpr): remove pexpr primitives 2018-06-05 16:28:12 -07:00
Leonardo de Moura
ab481d7e7b chore(library/init/meta): remove unnecessary primitives 2018-06-05 16:13:22 -07:00
Leonardo de Moura
45202eca16 chore(library/init/meta): cleanup 2018-06-05 15:32:59 -07:00
Leonardo de Moura
1bae8f8eab refactor(library/init/lean/ir/parser): parser.lean => parser_t.lean 2018-06-05 08:00:13 -07:00
Leonardo de Moura
60339d6c87 feat(library/init/data/hashmap/basic): missing function 2018-06-04 19:58:24 -07:00
Sebastian Ullrich
0f7c0ac8bf feat(init/lean/parser/parser): make a monad transformer
Also move parser combinators into the more specific namespace `init.lean.parser.parser_t`.
2018-06-04 12:57:23 +02:00
Sebastian Ullrich
6a0f3056f4 chore(library/init/lean/parser/syntax): cleanup 2018-06-04 11:02:45 +02:00
Leonardo de Moura
ac0352b584 refactor(kernel): remove quotitent normalizer extension
The `quot` type is now implemented in the kernel.
We will do the same thing for inductives.
We will not support normalizer extensions anymore in Lean4.
It doesn't make sense since we settled with 2 extensions: quotients and
inductives. Moreover, any new extension would require substantial
changes (e.g., code generator).
The normalizer_extension feature was useful when we were experimenting
with different kernel flavors.
2018-06-01 10:52:17 -07:00
Leonardo de Moura
9a671d7c7d chore(library/compiler): delete rec_fn_macro 2018-05-31 17:11:25 -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
80545832f4 chore(library): remove user attributes 2018-05-31 09:10:41 -07:00
Leonardo de Moura
4d8549305d doc(library/init/env_ext): document environment extensions in use 2018-05-30 14:28:49 -07:00