Commit graph

17478 commits

Author SHA1 Message Date
Leonardo de Moura
2abca22e00 fix(kernel/instantiate): compilation problem on Windows 2019-09-18 18:41:59 -07:00
Leonardo de Moura
8148136aa9 fix(util/nat): nat::get_small_value must return size_t since unbox now returns size_t 2019-09-18 17:13:46 -07:00
Leonardo de Moura
02e4abb24a feat(library/init/lean/elaborator): convertForall skeleton 2019-09-17 17:17:46 -07:00
Leonardo de Moura
b36caf701a chore(library/print): minor improvements 2019-09-17 17:17:46 -07:00
Leonardo de Moura
06bb3a82d3 feat(library/init/lean/localcontext): add LocalContext.mkLambda and LocalContext.mkForall 2019-09-17 17:17:46 -07:00
Leonardo de Moura
eebc722f57 feat(library/init/lean/expr): add abstractRange 2019-09-17 17:17:46 -07:00
Leonardo de Moura
1d1ad8e2ed chore(library/init): auxiliary combinators 2019-09-17 17:17:46 -07:00
Leonardo de Moura
fdb1bf84b4 refactor(library/init/data/array/basic): cleanup names and types, add monadic versions 2019-09-17 17:17:46 -07:00
Sebastian Ullrich
a083cab532 fix(library/compiler/ir_interpreter): fix UB sequencing found by GCC 2019-09-17 09:51:24 +02:00
Leonardo de Moura
75e5f5bfd8 feat(library/init/lean/expr): expose abstract 2019-09-16 18:34:45 -07:00
Leonardo de Moura
6d7041fcb4 test(tests/playground/inst): add instantiate and instantiateRev simple tests 2019-09-16 18:30:35 -07:00
Leonardo de Moura
704f90d728 feat(library/init/lean/expr): expose instantiate and instantiateRev 2019-09-16 18:29:43 -07:00
Leonardo de Moura
51955bd945 chore(kernel/instantiate): remove obsolete optimization
I also tested its effectiveness in Lean3, and I did not observe any
performance impact when compiling stdlib without it.
2019-09-16 16:09:26 -07:00
Leonardo de Moura
2996d306c9 feat(library/init): add more general modify: modifyGet
This commit also adds a few helper elaboration functions.
2019-09-16 15:14:02 -07:00
Leonardo de Moura
06327238e6 fix(library/compiler/erase_irrelevant): assertion violation
cc @Kha
2019-09-16 07:21:19 -07:00
Leonardo de Moura
bd7ee8b01b feat(library/init/lean/elaborator/term): add elabList, and fix elabTermAux 2019-09-14 08:41:49 -07:00
Leonardo de Moura
306ff7d7e5 fix(library/compiler): fixes #34
`csimp` assumes constructors and `casesOn` applications match.  That
is, given `I.casesOn x ...`, then if `x` is an constructor, then it is
a constructor of the inductive datatype `I`.
The transformation `erase_irrelevant` was violating this property when
it mixes `Decidable` and `Bool`. We fix this issue by mapping
`Decidable.casesOn`, `Decidable.isTrue` and `Decidable.isFalse` to
`Bool.casesOn`, `Bool.true` and `Bool.false` respectively.
2019-09-13 10:20:50 -07:00
Sebastian Ullrich
a1bc3164e8 refactor(library/compiler/ir_interpreter): remove case type inference 2019-09-12 18:38:10 +02:00
Sebastian Ullrich
6c4976e044 perf(library/compiler/ir_interpreter): push_frame: avoid frame copy
6.4% speedup on unionfind
2019-09-12 18:26:15 +02:00
Sebastian Ullrich
7c6668d5c2 perf(library/compiler/ir_interpreter): no need for decl lookup at tail recursion 2019-09-12 18:26:15 +02:00
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
2227873dc6 chore(tests/compiler/binomial): further reduce input size for debug build of interpreter... 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
9f88c949f1 chore(tests/compiler): reduce some test sizes for the interpreter 2019-09-12 18:26:15 +02:00
Sebastian Ullrich
3d53aaf5a7 chore(tests/compiler): ignore some tests for the interpreter 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
e5ef6eae1f chore(tests/playground/task_testX): update syntax 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
560e7af128 fix(library/init/lean/compiler/ir/compilerm): borrow annotations on extern decls do not do anything right now 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
5194f90afc chore(util/kvmap): make constructors explicit
C++ decided to compare a `size_t` and a `nat` by converting them both to `data_value`...
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
d5737d0713 test(shell/CMakeLists.txt): add compiler tests as interpreter tests 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
Sebastian Ullrich
401a4536a8 feat(CMakeLists.txt): export all symbols for dlsym()
We'll see about other platforms
2019-09-12 18:22:02 +02:00
Sebastian Ullrich
9b8300657a refactor(util/option_ref): match other wrapper classes 2019-09-12 18:22:02 +02:00
Sebastian Ullrich
6f59bec057 fix(shell/CMakeLists.txt): update-stage0 should not try to build the stage1 executable, only its sources 2019-09-12 18:22:02 +02:00