Commit graph

45 commits

Author SHA1 Message Date
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
d3afb41f51 feat(library/compiler/lambda_lifting): add function detecting lambda_lifting aux declarations 2019-04-06 07:42:45 -07:00
Leonardo de Moura
1080edd490 fix(library/compiler/lambda_lifting): make sure auxiliary _lambda declarations come before the declarations that use them
This fixes a nasty initialization bug where an auxiliary `_closed`
declaration for an auxiliary `_lambda` is accessed before it is
initialized.
2019-02-15 15:23:46 -08:00
Leonardo de Moura
3444a295e7 feat(library/compiler,runtime): builtin support for lean.name 2019-02-05 12:57:46 -08:00
Leonardo de Moura
7365b9ed30 feat(library/compiler/lambda_lifting): cache names for lifted lambdas
We were creating hundreds of different names for simple lambdas. Example:
```
λ a, @coroutine.done a
```
2018-11-13 15:13:55 -08:00
Leonardo de Moura
b23251fd6e feat(library/compiler/lambda_lifting): preserve join points when performing lambda lifting 2018-11-01 16:04:25 -07:00
Leonardo de Moura
e11fe27de2 chore(library/compiler/lambda_lifting): temporary hack
Make sure that a join point that has been lambda lifted is not tagged as
a join point anymore.
2018-11-01 15:21:14 -07:00
Leonardo de Moura
eb02add3de feat(library/compiler): simplify again after lambda lifting
Motivation: we avoid the creation of closures at join point declarations.
2018-10-19 15:17:07 -07:00
Leonardo de Moura
d623c6ef43 chore(library/compiler/lambda_lifting): do not need type_checker::state 2018-10-19 14:41:39 -07:00
Leonardo de Moura
787d1ecb93 feat(library/compiler/lambda_lifting): new lambda lifting 2018-10-08 15:04:59 -07:00
Leonardo de Moura
2eea3d4c4b chore(library/compiler): simplify procedure class
Remark: `procedure` will be deleted soon.
2018-10-05 17:30:27 -07:00
Leonardo de Moura
fa906c6bda fix(library/compiler/lambda_lifting): use user_name 2018-10-02 18:56:13 -07:00
Leonardo de Moura
e466ecd263 chore(library/compiler/lambda_lifting): fix debug mode compilation errors 2018-10-01 14:17:11 -07:00
Leonardo de Moura
b4c2861939 refactor(library/compiler): rename "erasure normal form" functions 2018-10-01 14:17:11 -07:00
Leonardo de Moura
81e9e95570 chore(library/compiler): erase_irrelevant ==> old_erase_irrelevant 2018-10-01 14:17:11 -07:00
Leonardo de Moura
81067d355d chore(library/compiler): util.* ==> old_util.* 2018-09-17 08:44:45 -07:00
Leonardo de Moura
58e91559d0 feat(*): use new inductive datatype module 2018-09-06 18:09:22 -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
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
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
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
2d7b6ed12c chore(library/compiler): remove copy_tag from old compiler 2018-06-07 16:28:54 -07:00
Leonardo de Moura
6333043adf refactor(kernel): abstract_local(s) ==> abstract 2018-06-07 16:28:54 -07:00
Leonardo de Moura
bdea7d420d chore(*): type_context ==> type_context_old 2018-03-05 12:38:24 -08:00
Leonardo de Moura
ada4932507 feat(library/compiler): add new cache support to compiler 2018-02-21 15:04:20 -08:00
Leonardo de Moura
73eda00ba3 refactor(library/compiler): mk_unused_name ==> mk_compiler_unused_name 2018-02-21 15:04:19 -08:00
Leonardo de Moura
6ba4607c28 refactor(library/compiler): rename compiler mk_fresh_name to mk_unused_name 2018-02-21 15:04:19 -08:00
Leonardo de Moura
b61920e9a3 perf(library/compiler/lambda_lifting): missing opportunity for applying eta-reduction and avoiding unnecessary aux decl 2017-11-08 16:23:11 -08:00
Leonardo de Moura
3bcbfbf348 perf(library/compiler/elim_recursors): beta_reduce ==> head_beta_reduce
This commit fixes the byte code generation performace problem
exposed by #1755
2017-07-21 03:32:23 -07:00
Gabriel Ebner
99754188e6 feat(library/compiler/eta_expansion): also eta-expand expressions containing sorry 2017-05-23 11:14:31 -07:00
Sebastian Ullrich
ead6318ee0 feat(frontends/lean/elaborator): substitute reflected locals into expr quotes 2017-05-09 16:02:41 -07:00
Sebastian Ullrich
8c0394b294 refactor(library,frontends/lean): separate expr and pexpr macros 2017-05-09 16:02:41 -07:00
Sebastian Ullrich
9d8c84713c refactor(*): reduce exception context info from expr to pos_info 2017-02-17 13:45:57 +01:00
Leonardo de Moura
53667dd602 fix(library): change API and make sure we don't crash when searching for a non existing local decl
Fixes #1363

After error recovery has been implemented in the elaborator, a few
assumptions made in the type context are not valid anymore since we may
be recovering from errors, and the local and metavariable contexts may
be invalid.

I used the approach used in the class environment.

- find* methods return optional<...>
- get* methods throw exception for unknown elements

Remarks:

I preserved code patterns such as

     optional<local_decl> d = lctx.find_local_decl(...)
     lean_assert(d)

and did not convert them into

     local_decl d = lctx.get_local_decl(...)

Reason: the intention is clear that the local must be defined there.
If it is not we should analyze the problem and decide whether we should
throw an exception or not.

However, I converted code patterns such as

    local_decl d = *lctx.find_local_decl(...)

into

    local_decl d = lctx.get_local_decl(...)

Disclaimer: this change fixes issue #1363, but it may obfuscate other bugs.
2017-02-07 09:38:19 -08:00
Leonardo de Moura
1f2b8745dc fix(library/compiler): prevent let-expressions from being expanded 2017-01-12 11:18:16 -08:00
Leonardo de Moura
d6000416f8 feat(library/compiler,frontends/lean/elaborator): (try to) preserve position information
We will use this information in the debugger.
2016-11-09 16:51:48 -08:00
Leonardo de Moura
d66584f390 feat(library/vm,library/compiler): save argument names 2016-11-08 15:10:04 -08:00
Leonardo de Moura
e62810c9b8 fix(library/compiler/lambda_lifting): make sure constructors are eta-expanded
closes #1133
2016-11-02 13:26:15 -07:00
Leonardo de Moura
2b43f591c9 fix(library/type_context): remove m_cache_owner field
This idiom creates problem if we use (even accidentally) the copy constructor.
2016-06-23 14:03:46 -07:00
Leonardo de Moura
2eafe66240 fix(library/compiler/lambda_lifting): relax assertion 2016-06-06 14:11:05 -07:00
Leonardo de Moura
399b83122c refactor(library): move vm to a separate directory 2016-05-12 14:45:06 -07:00
Leonardo de Moura
70cff1a4bd feat(library/compiler/lambda_lifting): avoid unnecessary auxiliary decls 2016-05-11 16:34:47 -07:00
Leonardo de Moura
3b47d91b3e feat(library/compiler): add lambda lifting 2016-05-11 11:07:39 -07:00