Commit graph

5773 commits

Author SHA1 Message Date
Leonardo de Moura
3e6736b374 feat(library/compiler/util): add support for trivial structures at mk_runtime_type 2019-09-11 13:41:41 -07:00
Leonardo de Moura
1062dcbbea refactor(src/library/compiler/erase_irrelevant): move has_trivial_structure to util 2019-09-11 13:04:08 -07:00
Sebastian Ullrich
fdc30e3097 chore(library/type_context): revert "simple instance pre-filtering"
This reverts commit ab2e66e4a3.

This hack is not immediately needed anymore and will hopefully be
replaced with a much better design in the future
2019-09-11 19:51:25 +02:00
Leonardo de Moura
f7af9a73bd chore(library/init/lean/compiler/ir): move addBoxedVersion to entry point file 2019-09-09 10:35:52 -07:00
Leonardo de Moura
a188bb8497 chore(library/init/lean/compiler/ir): remove emitcpp 2019-09-07 19:46:22 -07:00
Leonardo de Moura
dcd15f3424 refactor(runtime): C backend 2019-08-24 07:40:38 -07:00
Leonardo de Moura
6d6cb14f9e feat(library/init/lean/compiler/ir/emitc,shell/lean): add --c=<filename> option 2019-08-20 10:13:40 -07:00
Leonardo de Moura
b2693962bd chore(library/init/lean): export as C functions 2019-08-17 07:30:07 -07:00
Leonardo de Moura
66304d83a0 chore(library/init/lean/compiler): export as C functions 2019-08-17 06:58:36 -07:00
Leonardo de Moura
4429aac0b3 chore(library/compiler/ir): remove box(13) hack 2019-08-16 20:58:30 -07:00
Leonardo de Moura
ec0e74f5f8 chore(library/init/lean): export as C functions 2019-08-16 20:52:10 -07:00
Leonardo de Moura
a5c97e21bf chore(library/init/lean): export as C functions 2019-08-16 20:15:30 -07:00
Leonardo de Moura
19051d9a0d chore(library/init/lean/localcontext): export as C functions 2019-08-16 19:49:17 -07:00
Leonardo de Moura
67a37c6917 chore(library/init/lean/class): export as C functions 2019-08-16 19:42:14 -07:00
Leonardo de Moura
dae30a4ea6 chore(library/compiler/specialize): remove broken assertions 2019-08-16 09:46:05 -07:00
Leonardo de Moura
d2c567ec61 chore(library): remove dead files 2019-08-15 19:01:01 -07:00
Leonardo de Moura
61beb56a83 chore(*): fix some compilation warnings 2019-08-15 09:26:13 -07:00
Leonardo de Moura
92f880b0bf chore(library/equations_compiler/elim_match): remove dead code 2019-08-14 14:39:34 -07:00
Leonardo de Moura
03e455d32d feat(frontends/lean/elaborator): add oldElaborate 2019-08-13 19:23:29 -07:00
Leonardo de Moura
ae7167d626 fix(library/equations_compiler): equation compiler bug reported by @dselsam on Zulip
@kha @dselsam: I added a small repro for the bug reported by Daniel on
Zulip. The current fix is not polished at all since we will replace
the equation compiler with one implemented in Lean.  The bug is once
again on the code that handle nested `match`-expressions containing
recursive calls. We had problems in this module before, and the
current compilation strategy using auxiliary `*._match_<id>` functions
is also very inconvenient for users. They are often puzzled when they
see these auxiliary functions appearing in proof goals after unfolding
and/or simplification.  They usually don't know what to do with these
auxiliary definitions, and have no idea how they were defined and what
they correspond to if the function has several nested
`match`-expression. Right now, the best option is to use `#print
<fun-name>._match_<id>` which is far from ideal.

@kha: @dselsam and I discussed an alternative approach where we do not
create the auxiliary definitions, annotate the generated `cases_on`
applications with meta-data indicating they correspond to a nested
match, and modify the pretty printer to display these annotated
`cases_on` applications using the `match` syntax. With these
modifications, the behavior will be similar to the one in Coq where
complex `match`-expressions are reduced to atomic ones. The only
difference is that we represent these "atomic" `match`-expressions
using `cases_on` applications.
This commit uses a simpler version of this approach where we do not
create auxiliary `*._match_<id>` functions, and more importantly do
not use the dreadful `pull_nested_rec_fn` code.
2019-08-12 19:20:26 -07:00
Leonardo de Moura
64adc4c798 feat(library/metavar_context): use MetavarContext implemented in Lean 2019-08-10 08:03:13 -07:00
Leonardo de Moura
99d4b33559 feat(library/metavar_context): metavar_decl as Lean object 2019-08-09 20:38:59 -07:00
Leonardo de Moura
5dd3b67a75 feat(library/metavar_context): delayed_assignment as Lean object 2019-08-09 20:30:52 -07:00
Leonardo de Moura
d1671ffcea chore(library): remove dead code 2019-08-09 16:08:51 -07:00
Leonardo de Moura
bf2a365501 chore(library/compiler/compiler): remove dead code 2019-08-07 17:24:07 -07:00
Leonardo de Moura
73f96730bb feat(library/init/lean,kernel): add KernelException, addDecl and compileDecl
This commit also refines the type of `addAndCompile`.
We also add `ElabException.kernel` constructor for kernel exceptions.
2019-08-07 17:15:40 -07:00
Leonardo de Moura
d707026cd8 feat(library/local_context): ensure local_context is just a wrapper for LocalContext
This is a temporary hack. After we eliminate the old elaborator,
we will delete the C++ class `local_context`.
In Lean4, we will not have two different kinds of local context:
`local_ctx` and `local_context`.
2019-08-07 13:11:08 -07:00
Leonardo de Moura
8ac58a66f8 chore(library/abstract_type_context): remove unnecessary virtual method only used at old pp.cpp 2019-08-07 12:05:10 -07:00
Leonardo de Moura
ae97cfdd68 feat(kernel/local_ctx): use LocalContext 2019-08-07 11:50:20 -07:00
Leonardo de Moura
b27f215b9a chore(library/local_context): simplify pp 2019-08-06 10:27:10 -07:00
Leonardo de Moura
f1eaebba31 fix(library/compiler/csimp): bug at float_cases_on
The scope of the expr2ctor cache updates was incorrect.
This bug affects code of the form
```
let x := C.cases_on y ...; K[x]
```
when we try to float the `cases_on` application, and the continuation
`K[x]` contains another `cases_on` application with major `y`.
The new test exposes the bug.
This commit also fixes the case where the continuation `K[x]` projects `y`.

Fixes #26
2019-08-05 13:23:27 -07:00
Leonardo de Moura
99e90f0410 chore(library/compiler): add trace.compiler.simp_float_cases option 2019-08-05 13:13:18 -07:00
Leonardo de Moura
215a3ac8fd chore(library/tactic/clear_tactic): remove dead code 2019-08-05 08:58:59 -07:00
Leonardo de Moura
7f142ac7e3 chore(kernel/expr): hide get_weight and get_depth 2019-08-03 10:57:30 -07:00
Sebastian Ullrich
55104ad0c6 chore(library/compiler/csimp): remove wrong assertion 2019-07-30 17:52:43 -07:00
Sebastian Ullrich
d09c512784 chore(library/module): lsan: ignore module objects 2019-07-30 17:52:43 -07:00
Leonardo de Moura
fb14110b22 fix(library/compiler/llnf): sort scalar fields by size to avoid UB 2019-07-28 09:53:53 -07:00
Leonardo de Moura
ff6b868440 chore(library/module): remove dead code 2019-07-27 19:03:07 -07:00
Sebastian Ullrich
7b18bc94fd fix(library/module): make sure header length preserves alignment 2019-07-26 12:39:35 -07:00
Sebastian Ullrich
53a26b94ff chore(util/lean_path): remove leanpkg.path support
Because Lean 4 will not compile dependencies by itself, there is not much of a
point in it resolving them by itself either. The build tool that ensures that
all dependencies have been built should call `lean` with the `LEAN_PATH`
environment variable set accordingly.
2019-07-25 17:46:40 -07:00
Leonardo de Moura
cf8daf4b24 feat(library/init/lean/elaborator): process header
TODO:
- improve/fix `setSearchPath`
- add `IO.getEnv`
- add support for relative imports at `absolutizeModuleName`
2019-07-24 07:37:33 -07:00
Leonardo de Moura
022d22cac4 feat(library/compiler/extract_closed): fine grain extraction
Motivation: increase reuse
2019-07-10 11:14:20 -07:00
Leonardo de Moura
17cc34def5 feat(library/compiler/compiler): add option compiler.extract_closed
It is useful when using `unsafeIO`
2019-07-10 11:08:34 -07:00
Leonardo de Moura
85d151a335 feat(library/compiler): use eta expansion at eager_lambda_lifting 2019-07-09 16:34:20 -07:00
Leonardo de Moura
f1a2c83e8c feat(library/compiler/eager_lambda_lifting): do not pass closed terms as arguments to lifted decl 2019-07-09 14:06:14 -07:00
Leonardo de Moura
0f873b7ba2 fix(library/compiler/eager_lambda_lifting): collect type dependencies 2019-07-09 13:32:41 -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
4e444a283d feat(library/class): switch to Lean implementation 2019-06-27 13:51:09 -07:00
Leonardo de Moura
8399e41a5b feat(library/class): simpler get_class function
It does not depend on `type_context.h`, and we will used it as a
template to implement the Lean version.
2019-06-27 10:42:14 -07:00
Leonardo de Moura
6727c1fa68 feat(library/compiler/specialize): switch to specExtension in Lean 2019-06-27 10:08:39 -07:00