Commit graph

162 commits

Author SHA1 Message Date
Leonardo de Moura
ea5eed7964 fix: do not assume the constructor name prefix is the inductive type name 2020-07-23 14:36:54 -07:00
Leonardo de Moura
e596820f2e chore: remove () modifier
cc @Kha
2020-05-12 15:02:02 -07:00
Leonardo de Moura
c7d96a6522 fix: theorem values are tasks 2020-01-16 17:20:36 -08:00
Leonardo de Moura
b09fb4348d chore: rename Name constructors 2019-11-18 19:54:05 -08:00
Leonardo de Moura
50207e2c5a chore(library/constants.txt): remove dead variables 2019-03-22 13:26:48 -07:00
Leonardo de Moura
2b76d79791 chore(library/init/core): remove more nonsense 2019-03-22 13:14:20 -07:00
Leonardo de Moura
930653f292 chore(library/init): Unit.star => Unit.unit
@kha Our stdlib is starting to match the names we used in our paper :)
2019-03-22 13:06:45 -07:00
Leonardo de Moura
2be87ecd92 chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
Leonardo de Moura
039e7fab48 refactor(library): add suffixes.h with commonly used suffixes such as brec_on 2019-03-21 15:06:43 -07:00
Leonardo de Moura
0888dee25e chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
Leonardo de Moura
0cb3ac683d feat(library/compiler): connect new const_folding module implemented in Lean with csimp 2019-02-15 14:37:48 -08:00
Leonardo de Moura
9675b7c952 fix(frontends/lean/elaborator): ignore mdata when processing field notation 2019-02-11 17:29:38 -08:00
Leonardo de Moura
097aa7ef14 chore(library/compiler): cleanup cce 2018-09-21 10:25:35 -07:00
Leonardo de Moura
2abe11ce63 chore(library): _meta_aux ==> _meta_rec 2018-09-17 09:08:12 -07:00
Leonardo de Moura
dacc4c9cd6 chore(kernel): move abstract_type_context to library 2018-09-08 08:29:51 -07:00
Leonardo de Moura
13fbd8304e chore(library,frontends/lean): use is_constructor, is_recursor, is_inductive helper functions
They do not throw exception if the constant is not declared in the environment.
2018-09-07 20:36:42 -07:00
Leonardo de Moura
5d00936a8f chore(*): remove some old_type_checker dependencies 2018-09-07 08:48:21 -07:00
Leonardo de Moura
58e91559d0 feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
Leonardo de Moura
f335623530 feat(library/constructions/brec_on): add below and ibelow for new inductive datatype module 2018-09-05 14:46:03 -07:00
Leonardo de Moura
92c4b2ee0d chore(library/util): minor 2018-09-05 14:46:03 -07:00
Leonardo de Moura
4964ad660f feat(library/constructions/no_confusion): add no_confusion for new inductive datatype module 2018-09-05 10:27:49 -07:00
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
dd03747d22 chore(kernel): univ_param vs lparam, level_param_names ==> names, and other inconsistencies 2018-09-03 13:05:42 -07:00
Leonardo de Moura
82095cc018 refactor(kernel): split declaration into declaration and constant_info
This is just another step towards the design described at commit 16598391a07d4a
2018-08-22 17:53:11 -07:00
Leonardo de Moura
ec1aa2553c refactor(kernel/declaration): implement definition/constant/axiom/theorem using runtime/object
TODO: inductive, constructor, recursor
2018-06-25 10:05:45 -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
bc57c66ae3 refactor(kernel/level): naming consistency 2018-06-22 10:29:56 -07:00
Leonardo de Moura
c5714c2fac chore(kernel): remove expr.macro constructor
We are now ready to implement `expr` using `runtime/object`.
2018-06-19 17:54:43 -07:00
Leonardo de Moura
13c532d0d4 fix(*): truncation bugs
- Lean strings (like std::string) may contain null characters. The
  codebase was ignoring this issue.

- We now have a wrapper `string_ref` for wrapping Lean string objects in
  C++. This wrapper also implements correctly the coercions std::string <-> string_ref.
  Remark: I also found a few places where the code relies on the
  following property which is not true
  Forall s : std::string, std::string(s.c_str()) == s

- `name` object wrapper was assuming that all numerals were small
  `nat` values. This is true in most cases, but the system would
  crash when processing if it is a big number.

- The commit tries to make sure runtime/util/kernel are correct.
  Modules that will be deleted contain many `TODO` comments
  indicating they may crash and/or produce incorrect results
  when strings contain null characters and numerals are big.

cc @kha

@kha: I thought about using `string` instead of `string_ref`.
We consistently use `std::string`. So, it should be fine, but I
was concerned about code readability.

After we bootstrap Lean4, we will be able to delete `lean::list`
template, and rename `lean::list_ref` to `lean::list`.

I am going to add `pair_ref` for wrapping Lean pair objects.
If we use `lean::string` instead of `lean::string_ref`, then
we should also use `lean::pair` instead of `lean::pair_ref`.
But, there is a problem in this case since we have
https://github.com/leanprover/lean4/blob/master/src/util/pair.h#L13
:(
2018-06-15 16:05:11 -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
62788a9ca3 refactor(kernel): fix terminology: "free_var" is actually a loose bound variable
We represent free variables uisng local constants.
We will fix this terminology too.
2018-06-08 13:25:36 -07:00
Leonardo de Moura
2a79da1ab6 refactor(kernel): move formatting stuff out of the kernel 2018-06-07 16:28:54 -07:00
Leonardo de Moura
c0e1d05199 chore(kernel): type_checker ==> old_type_checker 2018-06-06 16:10:40 -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
75c63ec921 refactor(*): list<name> ==> obj_list<name> 2018-05-23 15:48:43 -07:00
Leonardo de Moura
4af1f31877 feat(util, kernel): add obj_list wrapper for Lean list objects, and use it to implement list of universe levels 2018-05-23 14:48:22 -07:00
Leonardo de Moura
d92679f969 refactor(*): replace name with lean.name 2018-05-20 09:42:44 -07:00
Leonardo de Moura
a52b418452 refactor(*): mk sure old name has same shape of new lean.name type 2018-05-20 08:48:48 -07:00
Sebastian Ullrich
17affbd45d chore(library/util): don't hide commit hash for nightlies 2018-04-02 10:44:43 +02:00
Sebastian Ullrich
0c0646f03b chore(leanpkg/lean_version): recognize nightlies as releases separate from master 2018-03-20 15:14:45 -07:00
Leonardo de Moura
bdea7d420d chore(*): type_context ==> type_context_old 2018-03-05 12:38:24 -08:00
Sebastian Ullrich
f3ca420b64 feat(frontends/lean/elaborator): hide opt/auto param types when elaborating structure field values 2018-02-28 12:49:22 +01:00
Leonardo de Moura
d54d759d56 refactor(library): do not use mk_fresh_name 2018-02-21 15:04:19 -08:00
Leonardo de Moura
f8e0916c64 feat(library/tactic, frontends/lean): replace a few mk_tagged_fresh_name with mk_unused_name 2018-02-21 15:04:19 -08:00
Leonardo de Moura
cc8eb83507 refactor(library/util,util): move is_internal_name to util/ 2018-02-21 15:04:19 -08:00
Sebastian Ullrich
1ee945a31f fix(library): store and validate Lean version of .olean files
Fixes #1770
2018-01-23 11:14:18 -08:00
Leonardo de Moura
c5df94ed17 feat(library/tactic): add support for auto params at simp tactic 2018-01-11 16:47:22 -08:00
Leonardo de Moura
7c1447d615 fix(library/app_builder,library/util): get_level's with slightly different behavior 2017-12-15 11:33:29 -08:00
Leonardo de Moura
ef784ce7b8 fix(library/tactic/simp_lemmas): auto_params when adding simp lemmas 2017-12-09 09:47:39 -08:00
Leonardo de Moura
14301a7f9f feat(library/equations_compiler/compiler): generate meta auxiliary definitions for regular (recursive) definitions
Motivations:

- Clear execution cost semantics for recursive functions.

- Auxiliary meta definition may assist recursive definition unfolding in the type_context object.

Next step: use meta auxiliary definition at code generation.
2017-11-01 11:58:45 -07:00