Commit graph

16361 commits

Author SHA1 Message Date
Leonardo de Moura
1e101d35a8 feat(library/init/lean/compiler/ir): add auxiliary functions 2019-05-03 12:19:58 -07:00
Leonardo de Moura
4cafd19f72 chore(library/init/lean/compiler): missing prelude 2019-05-03 12:19:58 -07:00
Sebastian Ullrich
c77970a00f refactor(library): remove now-redundant parentheses 2019-05-03 13:57:21 +02:00
Sebastian Ullrich
1aef9ac576 feat(frontends/lean/match_expr): terminate match on dedent between equations 2019-05-03 13:46:10 +02:00
Leonardo de Moura
9b50e9d003 feat(library/compiler/find_jp): locate (and preserve) join points created by user 2019-05-02 17:20:19 -07:00
Leonardo de Moura
8bd0431c19 chore(stage0): update 2019-05-02 16:25:24 -07:00
Leonardo de Moura
fb8bbee609 chore(library/init/lean/compiler/pushproj): cleanup 2019-05-02 15:45:56 -07:00
Leonardo de Moura
02da0177bb feat(library/init/lean/compiler/ir): add updtHeader field
This field is not used in the paper, but we have used in the C++
implementation and got a significant performance boost.
2019-05-02 15:29:42 -07:00
Leonardo de Moura
805ee81e73 chore(library/init/lean/compiler): modifiedJPVals ==> modifyJPs 2019-05-02 15:22:33 -07:00
Leonardo de Moura
2c4811a808 chore(library/init/lean/compiler): remove unnecessary [@export]s 2019-05-02 15:04:28 -07:00
Leonardo de Moura
e3f32a6108 chore(library/init/lean/compiler): cleanup 2019-05-02 15:02:35 -07:00
Leonardo de Moura
e90224b435 fix(library/init/lean/compiler/simpcase): bugs at simpCase 2019-05-02 15:02:21 -07:00
Leonardo de Moura
76a49ec256 chore(library/compiler): add ir::test 2019-05-02 14:40:04 -07:00
Leonardo de Moura
3628b39cb6 feat(library/init/lean/compiler): add simpcase transformation 2019-05-02 12:40:37 -07:00
Leonardo de Moura
db30a23055 fix(library/init/lean/compiler): bug fixes 2019-05-02 12:22:00 -07:00
Leonardo de Moura
81d11db5d2 chore(runtime/object): rename runtime primitives 2019-05-02 10:55:29 -07:00
Leonardo de Moura
4c9a488446 chore(library/init/data/array): naming convention
@kha Trying again :)
I started using the prefix `f` for the `Fin` version (e.g., `fswap` and
`fswapAt`). So, it seemed natural to use the prefix `f` for the `Fin`
versions of `get` and `set`.
BTW, is it too crazy to use `a[i]` (without spaces) as notation for
`a.get i`? The constraint is to make sure `f a [i]` is not ambiguous.
That is, `f a[i]` is `f (a.get i)` and `f a [i]` is `f a (i::nil)`.
This is doable with the new parser.

Then, we could have `a[i]` as notation for `a.fget i` if `i` is a `Fin`,
and `a.get i` if `i` is `Nat`.
Similarly, `a[i := v]` would be notation for `a.fset i v` if `i` is
`Fin`, and `a.set i` if `i` is `Nat`.

It would also be awesome to have
```
let a[i] := v in
e
```
as notation for
```
let a := a[i := v] in
```
2019-05-02 10:23:53 -07:00
Leonardo de Moura
970941db2c feat(library/init/data/array/basic): add Array.filter 2019-05-02 09:51:08 -07:00
Leonardo de Moura
46c3a14f83 chore(library/init/lean/compiler/pushproj): move comment 2019-05-02 09:48:17 -07:00
Leonardo de Moura
719eb67114 chore(library/init/lean/compiler): VarIdxSet => IndexSet 2019-05-02 08:23:59 -07:00
Leonardo de Moura
3a612bfd8b feat(library/init/lean/compiler): add elimDead transformation 2019-05-02 08:06:45 -07:00
Leonardo de Moura
5a83a2d7bb feat(library/init/data/array/basic): add swapAt 2019-05-02 07:46:11 -07:00
Leonardo de Moura
94fe3c18d0 fix(library/init/data/rbtree/basic): add HasInsert instance
It is useful for defining finite trees
2019-05-01 21:19:07 -07:00
Leonardo de Moura
e52e787ad5 fix(library/init/lean/compiler/pushproj): bug and cleanup 2019-05-01 21:01:03 -07:00
Leonardo de Moura
2991b966e5 featg(library/init/lean/compiler): add pushproj 2019-05-01 17:38:44 -07:00
Leonardo de Moura
1707628b6b feat(library/init/data/array/basic): Array.reverse 2019-05-01 17:38:44 -07:00
Leonardo de Moura
af1d521706 feat(library/init/data/array/basic): add Array.swap 2019-05-01 17:38:44 -07:00
Leonardo de Moura
cfec797e69 feat(library/init/lean/compiler/ir): helper functions 2019-05-01 17:38:44 -07:00
Leonardo de Moura
45d09d3044 fix(library/compiler/ir): bug at LLNF -> IR 2019-05-01 17:38:44 -07:00
Leonardo de Moura
ed5e461130 feat(library/init/lean/compiler/ir): add maxVar 2019-05-01 17:38:44 -07:00
Leonardo de Moura
2614b95a8b refactor(library/init/lean/compiler/ir): use Nat instead of Name for local vars 2019-05-01 17:38:44 -07:00
Leonardo de Moura
fa0b4bff40 chore(tests/playground/parser/syntax): fix experiment 2019-04-30 18:06:03 -07:00
Leonardo de Moura
0c9fa13763 feat(library/init/lean/compiler): convert LLNF into Lean IR 2019-04-30 17:55:43 -07:00
Leonardo de Moura
d433811c64 test(tests/playground): add "checkpoint" variant for rbmap benchmark
@kha I created a variant of the `rbmap` example where we create a tree
but also save "checkpoints". The idea is to simulate the idiom frequently
used in a backtracking search where we "save" the "context" before each
case split in a "trail stack".
The benchmark has two parameters: the number of nodes to be inserted, and a "frequency" (how often we create a "checkpoint").
The command `rbmap_checkpoint.lean.out n n` behaves like the original
`rbmap` benchmark, and `rbmap_checkpoint.lean.out n 1` creates a
checkpoint after each insertion. The frequency provides a simple way to
control the amount of sharing. We can provide performance numbers for
different frequencies, and show the impact on the `reset/reuse` optimization.

BTW, the performance numbers are much better than I expected. For
example,
`./rbmap_checkpoint.lean.out 1000000 10` is only 30% slower than
`./rbmap_checkpoint.lean.out 1000000 1000000`
although 100k checkpoints were created.

Another good news is that we are faster than Haskell even for
`./rbmap_checkpoint.lean.out 1000000 1`
2019-04-30 10:41:23 -07:00
Leonardo de Moura
952eb0f515 feat(library/compiler): C++ API for Lean IR 2019-04-29 18:23:19 -07:00
Leonardo de Moura
8befa9bea5 chore(stage0): update
Make sure Lean IR primitives are available at Stage0.
2019-04-29 17:16:27 -07:00
Leonardo de Moura
2db7cd158b feat(library/init/lean/compiler/ir): export primitives to C++
Remark: we don't need to expose all of them since the C++ code only
generates code in the Lambda_pure fragment.
2019-04-29 17:10:42 -07:00
Leonardo de Moura
a32fcf33c7 feat(util/array_ref): simple wrapper for creating Lean array objects in C++ 2019-04-29 17:10:35 -07:00
Leonardo de Moura
e0821be132 chore(tests/playground/ir): fix test 2019-04-29 10:50:10 -07:00
Leonardo de Moura
c09df2d8c3 feat(library/init/lean/compiler/ir): use Array instead of List
The idea is to use the same approach we have used at `tests/playground/parser/syntax.lean`
2019-04-29 10:48:33 -07:00
Leonardo de Moura
711fab451b refactor(library/init/data/array): Array.foldl argument order 2019-04-29 10:48:33 -07:00
Leonardo de Moura
63442ebde7 feat(library/init/data/array/basic): add iterate₂ and foldl₂ 2019-04-29 10:48:33 -07:00
Leonardo de Moura
5298841def test(tests/playground/ir): small test 2019-04-29 10:47:51 -07:00
Leonardo de Moura
df84868ab4 feat(library/init/data/array/basic): array helper functions 2019-04-28 10:10:24 -07:00
Leonardo de Moura
dd5fa4626f chore(runtime/object): style 2019-04-28 09:18:54 -07:00
Leonardo de Moura
807c9bff6d refactor(library/init): HasToFormat ==> HasFormat, toFormat ==> format 2019-04-28 09:16:47 -07:00
Leonardo de Moura
79e2abe33f feat(CMakeLists): put configuration options relevant to leanc at config.h 2019-04-27 21:04:41 -07:00
Leonardo de Moura
13d2398fb3 feat(library/init/lean/compiler/ir): formatter 2019-04-27 17:55:27 -07:00
Leonardo de Moura
03f42fda34 refactor(library/init/data/rbmap/basic): use [inline] instead of auxiliary "corpse" 2019-04-27 08:10:26 -07:00
Leonardo de Moura
aefe49d575 test(tests/playground): add new rbmap experiment 2019-04-27 08:02:32 -07:00