Commit graph

5469 commits

Author SHA1 Message Date
Leonardo de Moura
243d7c08e3 feat(library/compiler/llnf): avoid inc and dec operations on (boxed) small nat literals 2019-02-17 07:31:14 -08:00
Leonardo de Moura
3c60af74ae feat(library/compiler/llnf): avoid inc and dec instructions on neutral elements 2019-02-17 07:17:54 -08:00
Leonardo de Moura
78440919e8 feat(library/compiler/llnf): avoid unnecessary inc x and dec x instructions
Example:
```
x = lean::box(0);
...
lean::inc(x);
...
lean::inc(x);
...
lean::dec(x);
...
```
In the example above, the `inc` and `dec` operations are unnecessary
since `x` is known to be a (boxed) scalar value. This commit fixes this.
2019-02-17 06:50:25 -08:00
Leonardo de Moura
221704900a feat(library/compiler/llnf): avoid inc x and dec x instructions in branches where x is known to be a scalar value 2019-02-17 06:25:00 -08:00
Leonardo de Moura
3c73c43ab2 feat(runtime,library/init/data/array/basic): add builtin support for arrays 2019-02-16 15:27:23 -08:00
Leonardo de Moura
e98acc86b8 feat(library/compiler/emit_cpp): "merge" the case with most occurrences as default: 2019-02-16 12:27:25 -08:00
Leonardo de Moura
54985b5a0e fix(library/compiler/csimp): accidentally removed nat.succ x ==> x + 1 transformation from csimp 2019-02-16 12:05:17 -08:00
Leonardo de Moura
e84f7744c3 feat(library/init/lean/compiler/const_folding): const fold nat.succ and char.of_nat 2019-02-16 11:15:19 -08:00
Leonardo de Moura
61274c7d35 feat(library/init/data/char): use uint32 instead of nat for defining char 2019-02-15 18:07:55 -08:00
Leonardo de Moura
38c7ec133d fix(library/compiler/llnf): missing case 2019-02-15 17:51:08 -08:00
Leonardo de Moura
ab45af5936 fix(library/compiler/csimp): avoid potential expensive reduction at csimp
`whnf_core(e)` uses `whnf` to reduce the major premise of recursors and
projections, and `whnf` unfolds arbitrary definitions.
This commit adds a new option (`cheap`) to `whnf_core`. When
`whnf_core(e, true)` is used, the type checker will not unfolding
definitions when reducing the major premises.
2019-02-15 17:43:21 -08:00
Leonardo de Moura
e0fd89e165 feat(library/init/lean/compiler): fold nat predicates 2019-02-15 16:17:16 -08: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
0cb3ac683d feat(library/compiler): connect new const_folding module implemented in Lean with csimp 2019-02-15 14:37:48 -08:00
Sebastian Ullrich
a6ac98966a refactor(library/attribute_manager): parse attribute data from pexpr instead of abstract_parser 2019-02-15 12:13:45 -08:00
Leonardo de Moura
390c9009f7 chore(shell,boot): update boot, and initialization process 2019-02-14 14:49:16 -08:00
Leonardo de Moura
a8ac25e1ef fix(library/compiler/emit_cpp): bug at emitting exported function headers 2019-02-14 14:35:51 -08:00
Sebastian Ullrich
956a047d1e chore(library/compiler/extern_attribute): style 2019-02-14 14:07:05 -08:00
Sebastian Ullrich
9da149c2df fix(library/messages): message_severity is unboxed 2019-02-14 14:07:05 -08:00
Sebastian Ullrich
7cffe6935e feat(frontends/lean/vm_elaborator): port to new runtime 2019-02-14 14:07:05 -08:00
Leonardo de Moura
19e111c2ff feat(library/compiler): allow main function to also have type io uint32 2019-02-13 16:29:10 -08:00
Leonardo de Moura
9cb2005e8e feat(library/init/lean): add hash functions and dbg_to_string 2019-02-13 16:19:25 -08:00
Leonardo de Moura
6ccdd18260 feat(library/compiler/emit_cpp): initialize the whole system if main module depends directly/indirectly of lean. declarations 2019-02-13 16:16:43 -08:00
Leonardo de Moura
90260e005e feat(library/compiler/emit_bytecode): ignore unknown decls
cc @kha
2019-02-13 10:31:52 -08:00
Leonardo de Moura
6afad35aac feat(library/compiler): emit extern "C" for extern/foreign dependencies when needed 2019-02-13 07:58:06 -08:00
Leonardo de Moura
d4dce78b0e chore(library/compiler): delete compiler/builtin module
It has been replaced with `compiler/extern_attribute`
2019-02-12 18:23:09 -08:00
Leonardo de Moura
456ed23cc2 feat(library/init): use extern when declarating nat primitives 2019-02-12 18:12:29 -08:00
Leonardo de Moura
cd4b8c0c28 fix(library/equations_compiler/unbounded_rec): it was ignored m_gen_code flag 2019-02-12 17:48:11 -08:00
Leonardo de Moura
a82eab824a fix(library/compiler/emit_cpp): skip inline and adhoc extern declarations 2019-02-12 16:05:49 -08:00
Leonardo de Moura
09d194d5b7 feat(library/compiler): emit external declarations
We only skip `inline` and `adhoc` externs.
2019-02-12 15:42:59 -08:00
Leonardo de Moura
888252b5db feat(library/private): more deterministic private names 2019-02-12 14:00:24 -08:00
Leonardo de Moura
425a4b70d1 feat(library/init/data/int/basic): use extern attribute, and fix div/mod mess
Now, int.div and int.mod behave like C++ `/` and `%` for int,
moreover, they satisfy

          (a/b)*b + (a%b) = a
2019-02-12 11:41:46 -08:00
Leonardo de Moura
f20c132ced feat(library/init/lean/elaborator): use extern attribute 2019-02-12 11:40:21 -08:00
Leonardo de Moura
babaaed322 chore(library/compiler/builtin): add remark 2019-02-11 17:59:46 -08:00
Leonardo de Moura
6be47dfb97 feat(library/init/data/string/basic): use extern attribute 2019-02-11 17:54:24 -08:00
Leonardo de Moura
9675b7c952 fix(frontends/lean/elaborator): ignore mdata when processing field notation 2019-02-11 17:29:38 -08:00
Leonardo de Moura
73d590f1fb feat(library/init/io): use extern attribute 2019-02-11 16:56:54 -08:00
Leonardo de Moura
58783a2d3b fix(library/compiler/extern_attribute): bug at get_given_arity 2019-02-11 16:51:23 -08:00
Leonardo de Moura
5a5e949578 feat(library/init/lean/name): use extern attribute 2019-02-11 16:12:25 -08:00
Leonardo de Moura
7b0227572f fix(library/init/core): missing borrowed annotation 2019-02-11 16:01:56 -08:00
Leonardo de Moura
07ed77e724 fix(library/compiler/util): decidable A missing at mk_runtime_type 2019-02-11 15:51:09 -08:00
Leonardo de Moura
ccc4fe1468 fix(library/compiler/extract_closed): add new auxiliary declarations before 2019-02-11 15:40:22 -08:00
Leonardo de Moura
c27167f445 fix(library/compiler/ll_infer_type): use extern_attribute 2019-02-11 15:35:03 -08:00
Leonardo de Moura
9c3675f58f feat(library/init/data): use extern when declaring uint and usize primitives 2019-02-11 15:15:57 -08:00
Leonardo de Moura
03ecc363a0 fix(library/compiler/util): missing case 2019-02-11 15:14:02 -08:00
Leonardo de Moura
6bc23bcc65 feat(library/compiler/extern_attribute): infer ll_type, arity and borrowed flags from type 2019-02-11 14:57:13 -08:00
Leonardo de Moura
8acb2d4ed8 chore(library/compiler): minor modifications before builtin ==> extern refactor 2019-02-11 13:29:39 -08:00
Leonardo de Moura
bc4e06666b chore(*): avoid 0-ary extern declarations 2019-02-11 13:21:17 -08:00
Leonardo de Moura
57411ed039 refactor(library/compiler/extern_attribute): new interface 2019-02-11 12:48:37 -08:00
Leonardo de Moura
96d63ccc0d chore(library/compiler/builtin): remove "m_used_args" 2019-02-11 12:24:30 -08:00