Commit graph

4162 commits

Author SHA1 Message Date
Leonardo de Moura
71f5290567 feat(kernel): expose level primitives 2019-02-13 10:37:13 -08:00
Leonardo de Moura
4627929a83 refactor(boot,runtime,util): move name runtime implementation to util/name, and use "extern C" ABI 2019-02-13 08:27:23 -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
52db59eb87 fix(library/init/data/int/basic): nasty bug at int.repr 2019-02-12 15:58:59 -08:00
Leonardo de Moura
88de217cb7 chore(library/init): remove version.lean.in
We are currently not using this file. In the future, we should
reintroduce it, but its functions should be implemented as builtins.
Thus, every `chore(boot): update` commit will not have to update it.
2019-02-12 11:57:09 -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
Sebastian Ullrich
534b507aff feat(library/init/lean/frontend): rework error reporting 2019-02-12 13:34:32 +01: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
73d590f1fb feat(library/init/io): use extern attribute 2019-02-11 16:56:54 -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
9c3675f58f feat(library/init/data): use extern when declaring uint and usize primitives 2019-02-11 15:15:57 -08:00
Leonardo de Moura
bc4e06666b chore(*): avoid 0-ary extern declarations 2019-02-11 13:21:17 -08:00
Leonardo de Moura
1703255330 fix(library/init/core): we simulate the unused attribute feature using extern inline 2019-02-11 11:38:24 -08:00
Leonardo de Moura
befa53ec70 feat(library/compiler/emit_cpp): use new extern_attribute module 2019-02-11 11:03:56 -08:00
Leonardo de Moura
348ccf533c feat(library/compiler): borrowed annotations 2019-02-11 10:08:47 -08:00
Leonardo de Moura
7e8f9e6f66 feat(library/compiler): add [extern] attribute 2019-02-09 18:53:44 -08:00
Leonardo de Moura
e8758a1707 chore(library/compiler/export_attribute): exporting constructors is messy
It is much simpler and only slightly more verbose to export an
auxiliary function that just invokes the constructor.
2019-02-09 18:00:27 -08:00
Sebastian Ullrich
b809bb5311 feat(library/init/lean/frontend): demangle and remove read_file 2019-02-09 19:55:53 +01:00
Leonardo de Moura
613980fb30 fix(library/Makefile.in): add .olean as .cpp dependency 2019-02-08 17:09:53 -08:00
Leonardo de Moura
b50f9de3b8 feat(library/init/lean/extern): declare extern_attr_data and helper functions 2019-02-08 16:55:44 -08:00
Leonardo de Moura
efe64cb2d3 feat(library/init/data/list/basic): tail recursive length 2019-02-08 16:51:44 -08:00
Leonardo de Moura
4734e55f6d feat(library/init/data): tail recursive append 2019-02-08 16:35:20 -08:00
Leonardo de Moura
afc2569f7c fix(library/init/data/nat/basic): tail recursive nat.repeat 2019-02-08 11:00:48 -08:00
Leonardo de Moura
bfbfe94ac9 chore(library/init/control/default): add init.control.combinators 2019-02-07 09:12:53 -08:00
Sebastian Ullrich
12480e665e chore(library/Makefile): make generated CMakeLists.txt deterministic 2019-02-07 14:25:14 +01:00
Sebastian Ullrich
f9b3244d97 fix(library/init/lean/expr): literal: use C++ constructor ordering 2019-02-07 13:03:09 +01:00
Leonardo de Moura
2058d33d07 feat(runtime,library/compiler): add name.dec_eq builtin 2019-02-05 14:36:02 -08:00
Leonardo de Moura
ff54bf337a fix(library/init/data/repr): ultra inefficient to_digits
It was very inefficient, and was producing stack overflows for big numbers.
2019-02-05 13:36:13 -08:00
Leonardo de Moura
0918a599ae feat(*): builtin support for uint functions
@kha The VM versions just throw exceptions. They are just stubs to
make sure we can compile Lean.
I implemented the uint functions in the new runtime, but there are a
few missing cases marked with TODO.
I needed these builtins to be able to compile the C++ generated code for
corelib.
2019-02-01 17:04:24 -08:00
Leonardo de Moura
54f501594d chore(library/init/data/uint,library/init/data/usize): simplify 2019-02-01 15:41:55 -08:00
Leonardo de Moura
4fa06e38b2 chore(*): add skeleton for new builtin primitives, update src/boot 2019-02-01 14:03:03 -08:00
Leonardo de Moura
1a190021ce feat(library/Makefile.in): generate src/boot 2019-02-01 11:15:51 -08:00
Sebastian Ullrich
a823157338 fix(library/init/lean/expander): fix let expansion again
Last bug in core.lean!
2019-01-22 11:16:00 +01:00
Sebastian Ullrich
0846cc2aa0 fix(library/init/lean/elaborator): to_level 2019-01-22 11:16:00 +01:00
Sebastian Ullrich
9f90dbfd3d feat(library/init/lean/parser/syntax): improve syntax.get_pos for more error positions 2019-01-22 11:16:00 +01:00
Sebastian Ullrich
099354eb5f fix(library/init/lean/expander): expansion of parameterized let 2019-01-21 22:07:10 +01:00
Sebastian Ullrich
814ceb43fe fix(library/init/lean/parser/declaration): axiom, constant, what's the difference 2019-01-21 18:09:26 +01:00
Sebastian Ullrich
abf60e3242 feat(library/init/lean/elaborator): include 2019-01-21 18:09:18 +01:00
Sebastian Ullrich
53d9cb5358 fix(library/init/lean/elaborator): resolve idents after 'attribute' 2019-01-21 17:47:17 +01:00
Sebastian Ullrich
c22fbb5cde feat(library/init/lean,frontends/lean/vm_elaborator): set_option 2019-01-20 18:21:41 +01:00
Sebastian Ullrich
88534abccd fix(library/init/lean/expander): tuple element order 2019-01-20 16:41:46 +01:00
Sebastian Ullrich
b24796d98e feat(library/init/lean/elaborator): inaccessible 2019-01-20 16:41:33 +01:00
Sebastian Ullrich
69e363446d fix(library/init/lean/{parser/term,elaborator}): local notations override previous notations 2019-01-20 16:25:15 +01:00
Sebastian Ullrich
05bf392385 fix(library/init/lean/frontend): parser error positions 2019-01-20 16:24:12 +01:00
Sebastian Ullrich
fc7acc9898 fix(library/init/lean/elaborator): choice 2019-01-20 14:39:22 +01:00
Sebastian Ullrich
dcd3b3dc5d fix(library/init/lean/elaborator): section variables need to be preresolved as well
In
```
section binary
variables {α : Type u} {β : Type v}
variable f : α → α → α
local infix * := f
def commutative        := ∀ a b, a * b = b * a
end binary
```
the expansion of `*` applies a macro scope to `f`, so we need to resolve it
before that
2019-01-20 13:22:08 +01:00
Sebastian Ullrich
1708fc74f8 fix(library/init/lean/elaborator): structure instances 2019-01-19 15:35:11 +01:00
Sebastian Ullrich
a23df570fc fix(library/init/lean/elaborator): match 2019-01-17 19:57:00 +01:00