Commit graph

16213 commits

Author SHA1 Message Date
Leonardo de Moura
dd72df26bd test(tests/playground/parser): create directory and Makefile for experiment 2019-04-04 10:36:17 -07:00
Leonardo de Moura
5f6106be83 chore(init): add reserve for all control notation at core.lean
cc @kha
2019-04-04 08:53:42 -07:00
Leonardo de Moura
861a292d8f chore(stage0): update 2019-04-03 13:29:09 -07:00
Leonardo de Moura
8b145d7884 chore(library/init/control/combinators): use Applicative instead of Monad in relevant combinators 2019-04-03 13:28:08 -07:00
Leonardo de Moura
e09374afa6 perf(library/init/data/hashmap/basic): reuse AssocList memory cells when expanding hashtable 2019-04-03 10:49:46 -07:00
Leonardo de Moura
273a0775d6 perf(library/init/data/array): mkArray in Lean doesn't seem to buy us anything
The primitive implementation combines all `inc`'s into a single one.
2019-04-03 10:27:58 -07:00
Leonardo de Moura
a18c88a727 perf(library/init/data/hashmap/basic): add [inline] to reinsertAux 2019-04-03 09:52:34 -07:00
Leonardo de Moura
d9be0290ae perf(library/init/data/hashmap/basic): missing @[inline]
This commit adds the auxiliary function `expand` to break a nasty
interaction between code specialization, erasure and memory reuse.

Suppose we have
```lean
let  new_array := array.update array i v in
have pr : <some property that mentions array>, from <proof>,
f  new_array pr
```
Suppose `f` is not marked with `[specialize]`. Then, `pr` is erased and we get:

```lean
let  new_array := array.update array i v in
f  new_array box(0)
```
If `RC(array) == 1`, then the update performs a destructive update, and
we are happy.

Now, assume that `f` is marked with `[specialize]`.
Moreover, function specialization occurs before erasure since we want to
be able to use the to-be-implemented user-defined rewriting rules after specialization.
When we specialize `f` we compute a closure of its dependencies, and one of them is array because of `pr`.
Thus, we get
```lean
let  new_array := array.update array i v in
f_spec new_array array
```
after specialization and erasure, but now, we don't perfom the destructive update.

BTW, I assumed we should be able to reduce the arity of `f_spec` after
erasure since the parameter `array` be dead after it. However, I found the following TODO:
https://github.com/leanprover/lean4/blob/master/src/library/compiler/reduce_arity.cpp#L50
2019-04-03 09:38:03 -07:00
Leonardo de Moura
1815331828 perf(library/init/data): add @[specialize] to RBMap and RBTree functions that depend on lt : a -> a -> Bool
A few commits ago, a few `RBMap` and `RBTree` functions had
the parameters `(lt : a -> a -> Prop) [DecidableRel lt]` instead of
`(lt : a -> a -> Bool)`. Recall that the compiler automatically specializes
functions with arguments of the form `[ ... ]`. Thus, after we moved to
`(lt : a -> a -> Bool)` we have to include `@[specialize]` to force the
compiler to specialize.
2019-04-03 09:16:34 -07:00
Leonardo de Moura
a883042dc8 chore(library/init): fold functions argument order consistency 2019-04-03 07:42:14 -07:00
Leonardo de Moura
d6b7c9c1e2 test(tests/playground/map_perf): RBMap vs HashMap 2019-04-03 07:27:10 -07:00
Leonardo de Moura
fb3150e69d chore(tests/playground): fix test 2019-04-03 07:21:17 -07:00
Leonardo de Moura
2c72888af4 chore(stage0): update 2019-04-03 05:59:37 -07:00
Leonardo de Moura
c43374d296 refactor(library/init/data/hashmap): use AssocList and HasBeq 2019-04-03 05:55:08 -07:00
Leonardo de Moura
568b598729 fix(library/init/data/array/basic): incorrect borrow annotation 2019-04-03 05:50:53 -07:00
Leonardo de Moura
19856c4ca7 chore(library/init/data/hashmap/default): missing file 2019-04-03 05:50:19 -07:00
Leonardo de Moura
01b3eb2b05 feat(library/init/data/assoclist): add AssocList 2019-04-03 04:35:52 -07:00
Leonardo de Moura
ee050431e0 feat(runtime): add primitive hash functions 2019-04-03 04:01:36 -07:00
Leonardo de Moura
a46e27a3d7 feat(runtime/hash): use size_t instead of unsigned 2019-04-03 03:19:50 -07:00
Leonardo de Moura
02e6f953c8 chore(stage0): update 2019-04-03 03:02:20 -07:00
Leonardo de Moura
dc6c1e329f refactor(library/init/data/rbmap): use Bool instead of Prop 2019-04-03 02:54:34 -07:00
Leonardo de Moura
beb946d132 chore(library/init/data/int/basic): remove weird notation, dead code, and fix camelCase conversion issues 2019-04-03 02:54:34 -07:00
Sebastian Ullrich
5f8b1328c3 test(tests/playground/expander): add Leo's direct transformation 2019-04-03 11:27:06 +02:00
Leonardo de Moura
3d43f8a441 test(tests/playground/lazylist): LazyList 2019-04-02 17:26:29 -07:00
Leonardo de Moura
54b21bb3cd test(tests/playground/filemap): FileMap 2019-04-02 17:23:13 -07:00
Leonardo de Moura
9745f70fe2 chore(stage0): update 2019-04-02 17:22:19 -07:00
Leonardo de Moura
3d393d9b1d fix(library/compiler/csimp): bug introduced earlier today 2019-04-02 17:21:25 -07:00
Leonardo de Moura
5f36337322 chore(library/init/control/combinators): remove dependency 2019-04-02 17:21:13 -07:00
Leonardo de Moura
9d62e9ef79 chore(stage0): update 2019-04-02 11:18:55 -07:00
Leonardo de Moura
6ab935ebf6 feat(library/compiler/csimp): merge equal casesOn branches 2019-04-02 11:06:07 -07:00
Leonardo de Moura
95ca283854 chore(library/compiler/csimp): remove m_proj2var, we can use m_var2ctor instead 2019-04-02 10:05:20 -07:00
Leonardo de Moura
c4ad8f3dbc chore(stage0): update 2019-04-02 09:54:32 -07:00
Leonardo de Moura
005d62185d feat(library/compiler/csimp): add "case merging" optimization 2019-04-02 09:41:53 -07:00
Leonardo de Moura
498758bdfc chore(stage0): update 2019-04-02 09:41:18 -07:00
Leonardo de Moura
b083b6b655 test(tests/playground/lowtech_expander): remove dead code 2019-04-01 15:45:13 -07:00
Leonardo de Moura
d73d262aa1 test(tests/playground/lowtech_expander): letTransformer skeleton 2019-04-01 15:08:34 -07:00
Leonardo de Moura
b75706ffff test(tests/playground/lowtech_expander): add support for fixing SyntaxNodeKinds when reading Syntax objects from .olean 2019-04-01 12:35:28 -07:00
Leonardo de Moura
8004fcf2f1 test(tests/playground/lowtech_expander): use Nat to identify SyntaxNodeKinds 2019-04-01 12:17:06 -07:00
Leonardo de Moura
76b054bc1d test(tests/playground/lowtech_expander): expander experiment 2019-04-01 10:55:41 -07:00
Leonardo de Moura
5e1a3a7e6a feat(library/init/data/array/basic): make sure we reduce List.length too at List.toArray 2019-04-01 10:54:45 -07:00
Sebastian Ullrich
daf208326a test(tests/playground): expander performance tests 2019-04-01 17:23:14 +02:00
Leonardo de Moura
a6fb9268bc tests(tests/playground/parser): add tests 2019-03-31 10:42:56 -07:00
Leonardo de Moura
e8780c193d test(tests/playground/parser): remove eps field, and make sure bind "preserves tail recursion" 2019-03-30 20:57:24 -07:00
Leonardo de Moura
a7069060f5 fix(library/init/control): camelCase conversion typos 2019-03-30 20:54:39 -07:00
Leonardo de Moura
7e08130c8f test(tests/playground/parser): add leanWhitespace parser 2019-03-30 12:48:18 -07:00
Leonardo de Moura
c9bd22c265 test(tests/playground/parser): add strLit 2019-03-30 08:04:59 -07:00
Leonardo de Moura
5b31f85fcb chore(library/init/core): add extern for strictAnd and strictOr 2019-03-30 08:04:16 -07:00
Leonardo de Moura
5e14a5f561 refactor(library/init/lean/parser/trie): use String.Pos instead of OldIterator
Renamed the old `matchPrefix` to `oldMatchPrefix`.
2019-03-29 18:17:27 -07:00
Leonardo de Moura
e58949e938 chore(library/init/control/id): rename id monad to Id 2019-03-29 16:45:52 -07:00
Leonardo de Moura
6af5f0490e chore(library/init/data/list/basic): cleanup 2019-03-29 16:33:08 -07:00