Commit graph

5795 commits

Author SHA1 Message Date
Sebastian Ullrich
8dd851d64f perf(library/compiler/ir_interpreter): cache environment lookup in existing symbol cache 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
0c71a493d0 feat(library/compiler/ir_interpreter): check system at the start of each function 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
ea9a5de498 fix(library/compiler/ir_interpreter): values of unboxed types should be stored unboxed
We previously boxed all such values to `object *`s. However, because this does not correspond to the IR types, there are
no `dec` instructions to actually free these values.
2019-09-12 18:26:15 +02:00
Sebastian Ullrich
79588d2ce6 refactor(library/compiler/ir_interpreter): replace C++ template with Python template 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
944de141d3 perf(library/compiler/ir_interpreter): use specialized stubs 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
693fc63702 fix(library/compiler/ir_interpreter): constants do not have to be persistent anymore, so stop leaking them 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
8da203b91a perf(compiler/ir_interpreter): do not allocate temp closure for saturated partial applications 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
237e4a4489 feat(library/compiler/ir_interpreter): multi-threading support 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
daae0f67bb fix(library/compiler/ir_interpreter): --run ignored first argument 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
c23e6829c0 refactor(library/compiler/ir_interpreter): move constant caching into load 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
2d04ecc704 refactor(util/object_ref): move and adjust cnstr_get_ref_t 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
3ee59aa17f feat(library/compiler/ir_interpreter): add Windows support 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
1732461a66 doc(library/compiler/ir_interpreter): add a few comments 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
d27cbe2dc5 perf(library/compiler/ir_interpreter): cache symbol lookup 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
2d4276e819 feat(library/compiler/ir_interpreter): tail recursion 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
bdb7152768 feat(library/compiler/ir_interpreter): cache constants 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
9015fc1e34 chore(library/compiler/ir_interpreter): add step-level trace 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
558d9ad837 feat(library/compiler/ir_interpreter): add call-level trace 2019-09-12 18:22:02 +02:00
Sebastian Ullrich
795359ee49 feat(shell/lean): re-add --run flag 2019-09-12 18:22:02 +02:00
Sebastian Ullrich
99bc069fdd feat(library/compiler/ir_interpreter): implement IR interpreter 2019-09-12 18:22:02 +02:00
Leonardo de Moura
8e47b6396f chore(library/init/lean/compiler/ir): simplify mkCase, the xType field is set by explicitBoxing 2019-09-12 08:55:09 -07:00
Leonardo de Moura
0284d4a7a2 chore(library/compiler/ir): use new mkCase 2019-09-12 08:23:29 -07:00
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