Commit graph

237 commits

Author SHA1 Message Date
Leonardo de Moura
6030f56df2 chore: remove dead code 2020-07-24 09:52:35 -07:00
Leonardo de Moura
ad485484a5 chore: minor 2020-07-17 17:15:33 -07:00
Leonardo de Moura
428fb5be3c chore: remove dead field 2020-07-17 11:21:43 -07:00
Leonardo de Moura
b5dc185e70 chore: remove private parent structure support from old frontend 2020-07-17 09:21:14 -07:00
Leonardo de Moura
1e862b83c5 chore: remove support for old structure command 2020-07-16 15:11:11 -07:00
Leonardo de Moura
7c76a19885 chore: fix includes 2020-05-22 14:17:25 -07:00
Leonardo de Moura
8bdca35282 chore: use #include <lean/runtime/...> for runtime .h files 2020-05-18 11:30:07 -07:00
Leonardo de Moura
03403ba3c8 feat: make RelaxedImplicit the default behavior 2020-05-12 15:02:03 -07:00
Leonardo de Moura
820016e09a chore: remove dead code 2019-12-12 07:58:55 -08:00
Leonardo de Moura
300414e6e4 chore(frontends/lean): change explicit universe parameter notation in declarations 2019-07-02 08:57:08 -07:00
Leonardo de Moura
557dd16864 chore(library,frontends/lean): remove old attribute manager 2019-06-27 14:01:34 -07:00
Leonardo de Moura
bd58525080 chore(library/class): simplify 2019-06-26 16:51:36 -07:00
Leonardo de Moura
34ca44cca1 chore(frontends/lean,library): remove unnecessary #includes and dead code 2019-06-26 11:36:23 -07:00
Leonardo de Moura
8a1e2bf79b chore(library/projection): preparing to port projection_info to Lean 2019-06-25 13:17:59 -07:00
Leonardo de Moura
e0ddacfd3e feat(library/init/lean/attributes,frontends/lean): allow attributes to specify when they should be applied 2019-06-20 09:17:03 -07:00
Leonardo de Moura
9310c807e6 feat(library/private): use environment extension in Lean
Remark: we don't need the `m_inv_map` anymore.
2019-06-03 11:50:33 -07:00
Leonardo de Moura
9d9f546ad8 refactor(util/sexpr): move options and option_declarations to util 2019-05-16 14:37:24 -07:00
Leonardo de Moura
edeae776da chore(library/module): module::add for declarations is not needed anymore 2019-05-14 11:23:35 -07:00
Leonardo de Moura
35ddd49e7a chore(frontends/lean/structure_cmd): toParent instead of to_Parent 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
Sebastian Ullrich
6e64089123 feat(frontends/lean/structure_cmd): implement structure 2019-01-15 15:01:52 +01:00
Sebastian Ullrich
8753491cb5 chore(library/placeholder): remove obsolete level one_placeholder
Remnant of the previous Type/Sort approach
2018-12-21 15:52:56 +01:00
Leonardo de Moura
5d726eb210 feat(library/compiler/compiler): switch to new compiler frontend
We also rename `vm_compiler` module to `emit_bytecode`.
We will eventually replace this module with the new IR emitter.
2018-10-08 17:38:17 -07:00
Leonardo de Moura
990fbe3c30 feat(library/compiler): provide options to vm_compile 2018-09-30 08:50:40 -07:00
Leonardo de Moura
fabfe32ca5 chore(*): remove unnecessary scoped_ext dependencies 2018-09-08 15:42:48 -07:00
Leonardo de Moura
2315bc4653 chore(library): remove documentation environment extension 2018-09-07 12:09:41 -07:00
Leonardo de Moura
58e91559d0 feat(*): use new inductive datatype module 2018-09-06 18:09:22 -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
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
8ed89c6ac3 chore(library): remove normalize.cpp
The command `#reduce` was also temporarily removed.
2018-09-04 10:51:14 -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
dd03747d22 chore(kernel): univ_param vs lparam, level_param_names ==> names, and other inconsistencies 2018-09-03 13:05:42 -07:00
Sebastian Ullrich
39cdae50ee feat(library,frontends/lean): use mdata instead of hacky cache for position information in preterms 2018-09-02 18:08:41 -07:00
Leonardo de Moura
ae18cee0ea chore(library/module): remove pos_info tracking
We will use a completely different approach in Lean4
2018-08-27 15:55:57 -07:00
Leonardo de Moura
88c8c560a9 chore(library/equations_compiler): do not generate equation lemmas 2018-08-23 14:04:37 -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
f3e99286bb chore(kernel): remove certified_declaration 2018-08-22 12:11:34 -07:00
Sebastian Ullrich
d8122a7284 feat(src/frontends/lean/structure_cmd): allow default values in field parameters 2018-07-12 17:40:45 +02: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
ede1a51d60 refactor(kernel/declaration): remove self_opt flag from reducibility hints
This flag was used by the kernel to decide whether the following
heuristic should be used to avoid unfolding `f` at `is_def_eq`.

       f a =?= f b
       -----------
         a =?= b

This heuristic was introduced at Lean1 after a discussion with
Georges Gontier. Since this discussion, we added support for
caching failures of this heuristic. This proved to be much more
effective to attack the performance problems.
Moreover, we do not even use this flag in the `type_context::is_def_eq`
used during elaboration.

The current codebase contains only one place where this flag was set to
`false`: coercions generated at structure_cmd. This change was
made at commit
1c70514231
in the Lean2 codebase when we were not caching failures and
the kernel type checker was also used during elaboration.
2018-06-22 09:02:50 -07:00
Leonardo de Moura
ee4e0d03d0 chore(frontends/lean/structure_cmd): fix bogus g++ 4.9 warning 2018-06-21 16:52:34 -07:00
Leonardo de Moura
fd5bfc7dfe refactor(kernel): simplify binder_info
Now, it is an enumeration type like its Lean counterpart.
2018-06-20 15:31:40 -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
1a18bb265d chore(frontends/lean): remove a few old_type_checker occurrences 2018-06-14 14:05:04 -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
818170d780 refactor(kernel): remove tag from kernel expressions
We are temporarily storing position information in a global table.
2018-06-08 10:29:22 -07:00