Commit graph

4492 commits

Author SHA1 Message Date
Leonardo de Moura
f176a7963c feat(library/init/lean/compiler/ir/emitcpp): register arity 0 declarations 2019-06-07 17:15:16 -07:00
Leonardo de Moura
3651dc7618 feat(library/init/lean): add evalConst
The implementation is good enough for implementing extensible parsers,
elaborators and tactics, but there are a few TODOs

1- We should have a better story for standalone applications.
   Most of them don't need `evalConst`, and the global table is
   just initialization overhead.

2- The global table introduces a dependency on the `Lean.Name`
   implementation. So, all standalone applications will depend on it.

3- We are not storing arity 0 constants in the table.
   This one should be easy to fix in the future.
2019-06-07 16:31:28 -07:00
Leonardo de Moura
aadb07d5e4 chore(tests/lean): remove/fix tests 2019-06-07 09:56:11 -07:00
Leonardo de Moura
ff86159297 test(tests/playground/eval): proof of concept for a safe eval function 2019-06-06 17:06:32 -07:00
Leonardo de Moura
1658be20f1 feat(library/init/data/string): add String.isPrefixOf 2019-06-06 14:20:50 -07:00
Leonardo de Moura
e90a79f996 chore(tests/playground/parser/syntax): fix test 2019-06-05 14:19:24 -07:00
Leonardo de Moura
1cdadba4b2 fix(library/compiler/csimp): type error
@kha This is another instance of a problem we discussed last summer.
I guess there are many more instances like this one that we are not handling.
Recall that we want to preserve types at `csimp` because we eventually
want to allow users to use equational theorems as rewriting rules during
compilation.
However, some of the transformations that `csimp` perform do not
preserve typeability in CIC.
Moreover, some of the optimizations require type inference.

I see the possible long term solutions:

1- Erase types and proofs as soon as possible. The main drawback here is
that we would have to develop an approach for translating Lean theorems
into valid rewriting rules for lambda pure. For example, the following
theorem should not be used as a rewriting rule after we erase types.
```
forall (xs : List Unit) (f : Unit -> Unit), List.map f xs = List.map id xs
```
BTW, I don't want to abandon the idea of using lemmas as rewriting rules in
the compiler.

2- Go over `csimp` and other compiler steps and make sure they work
properly even when `type_checker::infer_type` fails.
2019-06-03 17:36:40 -07:00
Leonardo de Moura
ffbccf1ee9 fix(library/compiler): ByteArray bug 2019-06-03 15:01:16 -07:00
Leonardo de Moura
30a6a2ade8 feat(library/init/data, runtime): remove parray support from runtime, and implement them in Lean using Scala/Clojure Radix trees
The Scala/Clojure approach for persistent arrays works great with our
`reset/reuse`. We seem to be much more efficient than their
implementations because of `reset/reuse`. The new approach also seems
better than the old one implemented in the runtime, and has a few
advantages:
1- The reroot procedure used in the old approach required
synchronization for multi-threaded code, or we would need to perform
deep copies when sending `parray` objects between threads.
2- We don't need any runtime extension for the new approach.
3- The old approach used "trail lists" for undoing array updates.
This works well for bactracking search use cases, but it is bad
in use cases where we are simultaneously updating the persistent
arrays that have shared nodes.
2019-06-02 09:18:19 -07:00
Leonardo de Moura
9d00a8d262 feat(tests/playground/radixtree): use bit shift and land instead instead of / and % 2019-06-01 11:06:45 -07:00
Leonardo de Moura
336761d787 feat(tests/playground/radixtree): add stats 2019-06-01 09:47:57 -07:00
Leonardo de Moura
e87c471e7f test(tests/playground/radixtree): Scala/Clojure inspired persistent arrays
@kha It is a pity we didn't use this example in our paper. It works
really well with `reset`/`reuse`.
2019-05-31 21:55:57 -07:00
Sebastian Ullrich
9fe86c3f96 chore(tests/bench): further tweak Swift support 2019-05-31 10:48:50 +02:00
Sebastian Ullrich
2a6fb67afc feat(tests/bench): add qsort.swift 2019-05-31 00:40:09 +02:00
Leonardo de Moura
fab4fdf7c4 tests(tests/bench): add rbmap.swift 2019-05-30 14:47:06 -07:00
Leonardo de Moura
27c690b0c5 test(tests/bench/rbmap_checkpoint): add swift version 2019-05-30 14:35:58 -07:00
Leonardo de Moura
c347643361 test(tests/bench): add deriv.swift 2019-05-30 11:34:58 -07:00
Sebastian Ullrich
d532c4ad29 feat(tests/bench): add safe binarytrees.swift from https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/binarytrees-swift-1.html 2019-05-30 19:33:38 +02:00
Sebastian Ullrich
c30209ee02 feat(tests/bench): add Swift support 2019-05-30 19:33:23 +02:00
Leonardo de Moura
4da2e9f7b6 test(tests/bench/rbmap_checkpoint): OCaml version using myLen 2019-05-30 07:40:53 -07:00
Leonardo de Moura
40ce455e79 chore(tests/bench/rbmap_checkpoint): myLen version for GHC 2019-05-30 07:35:22 -07:00
Leonardo de Moura
e954ed12bc chore(tests/bench/rbmap_checkpoint): use myLean 2019-05-30 07:30:07 -07:00
Sebastian Ullrich
007e45794f chore(tests/bench/default): update MLKit 2019-05-30 16:25:41 +02:00
Sebastian Ullrich
9ec570416d chore(tests/bench): rename benchmarks 2019-05-30 16:25:41 +02:00
Sebastian Ullrich
8a2c2ffe84 chore(tests/bench/Makefile): reduce rbmap input sizes 2019-05-30 16:18:03 +02:00
Leonardo de Moura
30fefdb188 chore(tests/playground): add zipper 2019-05-29 14:33:47 -07:00
Leonardo de Moura
0009435add chore(tests/playground/lazylist): fix test 2019-05-29 14:33:47 -07:00
Sebastian Ullrich
4e3191123c chore(tests/bench/default.nix): remove compilers of retired categories 2019-05-29 17:36:42 +02:00
Sebastian Ullrich
dfea4be7a4
chore(tests/bench): add readme 2019-05-29 17:32:35 +02:00
Sebastian Ullrich
5f14d12344 feat(tests/bench/Makefile): update HTML report 2019-05-29 17:13:55 +02:00
Sebastian Ullrich
4d0e4c545e chore(tests/bench/default.nix): fix 2019-05-29 17:13:55 +02:00
Sebastian Ullrich
9b9465d299 chore(tests/bench): move out from playground/ 2019-05-29 16:33:50 +02:00
Sebastian Ullrich
d082a7e42f fix(tests/playground/Makefile): fix rbmap_shared input size 2019-05-29 15:03:44 +02:00
Sebastian Ullrich
1ad692eb77 chore(tests/playground/Makefile): retire unionfind1 2019-05-29 14:58:58 +02:00
Sebastian Ullrich
423b087782 chore(tests/playground/Makefile): build *.tex by default 2019-05-29 10:08:39 +02:00
Sebastian Ullrich
adc462789a chore(tests/playground/Makefile): output tables after benchmarking 2019-05-29 10:08:39 +02:00
Sebastian Ullrich
9e22ae1f12 chore(tests/playground): update temci 2019-05-29 09:59:53 +02:00
Sebastian Ullrich
bebbb8413e chore(tests/playground/Makefile): benchmark scaling 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
f25669666b chore(tests/playground/temci): update temci 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
ff16feb661 chore(tests/playground): fix frontend benchmark 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
0644835a7b chore(tests/playground/Makefile): disable broken benchmark 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
8114e88639 fix(tests/playground/bench): build 2 stages 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
d15cc74c13 chore(tests/playground/temci): update temci settings 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
af85733a6d chore(tests/playground/temci): update temci 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
609c27c31f fix(tests/playground/Makefile): create correct .cpp files when called directly 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
fff2899176 feat(tests/playground/Makefile): add TEMCI_FLAGS 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
e50b2040b6 feat(tests/playground/Makefile): more output polishing 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
90430e9696 chore(tests/playground): delete intermediate files 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
c1ba216bcc feat(tests/playground): Lean variant benchmarks 2019-05-28 19:12:45 +02:00
Sebastian Ullrich
5302a40763 feat(tests/playground): MLKit GC% 2019-05-28 19:12:45 +02:00