Sebastian Ullrich
7615c9f92f
chore(library/init/core): style review of the first half
2019-03-21 15:06:45 -07:00
Sebastian Ullrich
d5ec4a4606
chore(frontends/lean/pp): ppAnonymousCtor -> ppAsAnonymousCtor
2019-03-21 15:06:45 -07:00
Sebastian Ullrich
b9edaf888f
chore(library/init/core): ne -> Ne, not -> Not
2019-03-21 15:06:45 -07:00
Sebastian Ullrich
97e5aa2411
chore(library): s/Punit/PUnit/g etc
2019-03-21 15:06:45 -07:00
Leonardo de Moura
1fe3f14ad0
chore(*): Uint => UInt, Usize => USize
2019-03-21 15:06:44 -07:00
Leonardo de Moura
79a8d9aa65
chore(*): decidablePred/decidableRel => DecidablePred/DecidableRel
2019-03-21 15:06:44 -07:00
Leonardo de Moura
0b5862b6ce
chore(*): and => And
2019-03-21 15:06:44 -07:00
Leonardo de Moura
4c50859129
chore(*): or => Or
2019-03-21 15:06:44 -07:00
Leonardo de Moura
2be87ecd92
chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false
2019-03-21 15:06:44 -07:00
Leonardo de Moura
f8113a01eb
chore(library): unit => Unit
2019-03-21 15:06:44 -07:00
Leonardo de Moura
62e6341014
chore(*): lowercase file names
2019-03-21 15:06:44 -07:00
Leonardo de Moura
2ea0baeb99
chore(library): use lowercase in imports
2019-03-21 15:06:44 -07:00
Leonardo de Moura
ac27bd092b
chore(*): small fixes
2019-03-21 15:06:44 -07:00
Leonardo de Moura
675003318e
chore(*): small fixes
2019-03-21 15:06:44 -07:00
Leonardo de Moura
67fb78bb47
chore(*): renaming files
2019-03-21 15:06:44 -07:00
Sebastian Ullrich
beda5f5f43
chore(library): capitalize types and namespaces
2019-03-21 15:06:43 -07:00
Sebastian Ullrich
f7aeeaf237
exclude export/extern, translate constants.txt
2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168
chore(library): switch from snake_case to camelCase
2019-03-21 15:06:43 -07:00
Leonardo de Moura
0b7d987699
feat(frontends/lean, library/init/lean): opaque constants
...
@kha I have added support for opaque constants to the old C++ frontend,
and made sure the new frontend can still parse `library/init/core.lean`.
The kernel should enforce that opaque constants are really opaque, and
the following example should fail
```
constant x : nat := 0
theorem foo : x = 0 := rfl
```
If it doesn't, it is a bug.
Here are some remaining issues:
1- `environment.mk_empty` is currently an axiom because we cannot create
an inhabitant of an opaque type. A possible solution is to use
`option environment` instead of `environment`.
2- There is no support for opaque constants in the new
frontend. However, I modified it to handle axioms, and fixed the literal
values with decl_cmd_kind. I tried to mark some of my changes with
comments, but it is probably much easier for you to just check the
commit change list.
3- I did not add any support for automatically constructing `e`
at `constant x : t := e`. I think we can do this later
after we replace the old frontend with the new one. BTW, it took only a
few minutes to provide the inhabitants manually.
2019-03-15 17:41:44 -07:00
Leonardo de Moura
ecdb9d6df0
feat(library/init, frontends/lean): add abbreviation for abbreviation
2019-03-15 16:01:25 -07:00
Leonardo de Moura
68ebc2a5c5
feat(library/init/data/string/basic): implement iterators using uft8 low level API
2019-03-12 06:56:05 -07:00
Leonardo de Moura
cf3bbd7e25
feat(runtime): add utf8_prev and utf8_set
...
Next goal: implement string.iterator in Lean
2019-03-11 18:05:40 -07:00
Leonardo de Moura
4ca9c6f22e
feat(runtime): add efficient fixpoint implementation
2019-03-10 10:09:57 -07:00
Leonardo de Moura
c862ce4a75
feat(runtime, library/init/data/string/basic): add utf8_pos
...
`utf8_pos` is a low level alternative for `string.iterator`.
TODO: implement `string.iterator` using it.
2019-03-09 12:30:19 -08:00
Leonardo de Moura
2c3cfcf1dd
feat(library/init/data/char/basic): add char.utf8_size
2019-03-09 10:46:29 -08:00
Leonardo de Moura
402034df1f
chore(library/init/data): move usize to uint
2019-03-09 10:32:23 -08:00
Leonardo de Moura
2032b10482
feat(library/init/data): bitwise operations
2019-03-09 10:19:35 -08:00
Leonardo de Moura
6d7411cc07
perf(library/init/data/option/basic): missing [inline]
2019-03-06 10:58:12 -08:00
Leonardo de Moura
778e7e41f9
refactor(library/init/data/rbmap/basic): pass ins node-cell to balance1 and balance2.
...
The idea is to reuse the cell. The trick is like the one we used for
improving state_t. It seems to work pretty well. Now, the Lean
version is 29% slower than the C++ one.
cc @kha
2019-02-20 18:27:58 -08:00
Leonardo de Moura
835718955f
refactor(library/init/data/rbmap/basic): store color in the node
...
@kha Now the Lean version is approx. 50% slower than the C++ version.
2019-02-20 17:52:03 -08:00
Leonardo de Moura
9e0b28d8ce
feat(library/init/data/array/basic): improve
2019-02-16 16:08:10 -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
c855094ecb
feat(library/init/data/char/basic): mark char.of_nat as noinline
2019-02-16 10:45:52 -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
542bd432f8
test(tests/compiler): uint constant folding tests
2019-02-15 14:53:29 -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
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
6be47dfb97
feat(library/init/data/string/basic): use extern attribute
2019-02-11 17:54:24 -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
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
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
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
Sebastian Ullrich
f7a395d035
feat(library/init/data/rbmap/basic): implement rbmap.lower_bound
2018-12-20 15:32:46 +01:00
Sebastian Ullrich
db6b1d6e85
feat(frontends/lean/vm_elaborator,library/init/lean/elaborator): pass parser_state between languages, create parser object on C++ side to existing functions (that don't actually parse anything)
2018-12-18 15:30:38 +01:00