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
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
c43374d296
refactor(library/init/data/hashmap): use AssocList and HasBeq
2019-04-03 05:55:08 -07:00
Leonardo de Moura
ee050431e0
feat(runtime): add primitive hash functions
2019-04-03 04:01:36 -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
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
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
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
e58949e938
chore(library/init/control/id): rename id monad to Id
2019-03-29 16:45:52 -07:00
Leonardo de Moura
018ff249b9
test(tests/compiler/lazylist): new test for closures and thunks
2019-03-29 15:00:52 -07:00
Leonardo de Moura
4149a25186
chore(tests): fix tests
2019-03-29 11:25:26 -07:00
Leonardo de Moura
e46018bfd8
chore(tests/lean): move test to tests/lean/run
2019-03-28 18:21:10 -07:00
Leonardo de Moura
1ebdb9f1b1
fix(library/compiler): do not inline definitions using unsafe inductives
...
This commit also makes sure that `has_trivial_structure` returns false
for `unsafe` inductive datatypes.
See new test for further details.
2019-03-28 16:07:57 -07:00
Leonardo de Moura
146292d3d6
fix(tests/playground): parser experiments
2019-03-28 10:32:39 -07:00
Leonardo de Moura
2943fce8c8
chore(library/init/core): add strictAnd and strictOr
2019-03-28 09:42:12 -07:00
Leonardo de Moura
19f31d483a
chore(tests/playground/rbmap.library.lean): camelCase
2019-03-28 08:23:38 -07:00
Leonardo de Moura
42fbe3c18c
chore(library/init,runtime,library/compiler): add fix primitive back
...
The new `partial def`s allow us to define `fix` in Lean, but the Lean
implementation is not as efficient as the native one. The native one
in C++ use weak pointers to prevent a closure allocation at every
recursive invocation.
This commit also fixes the `fixCore` helper functions that were broken
after we switched to camelCase.
We have updated the test `fix1.lean` to demonstrate the native
implementation is faster. Here are the numbers on my desktop.
```
./run.sh fix1.lean 24
721420279
Time for 'native fix': 816ms
721420279
Time for 'fix in lean': 1.34s
```
2019-03-27 17:13:53 -07:00
Leonardo de Moura
e71249f6b3
chore(tests): fix tests
2019-03-27 14:06:23 -07:00
Leonardo de Moura
3936b2ba79
chore(library/init/io): we don't need fix anymore
...
`partial def` are much more general
2019-03-27 12:59:43 -07:00
Leonardo de Moura
9a071c18e7
feat(library/equations_compiler): add support for partial definitions
2019-03-27 11:09:32 -07:00
Leonardo de Moura
829a50ccf7
test(tests/playground/partial_eq_lemma): partial equation lemmas
...
@kha I added this example as a template for what the equation compiler
will have to do. The plan is:
- We can use `partial` to define any function if the result type is
inhabited.
- If the result type is of the form `Partial a`, the equation compiler
generates lemmas of the form:
```
theorem fooEq args : terminates (foo args) → foo args = lhs
```
The new test contains an example.
2019-03-26 18:06:04 -07:00
Leonardo de Moura
0ce97893de
chore(tests/playground/parser): port test file to new String API
2019-03-26 16:00:03 -07:00
Sebastian Ullrich
762ccb0d1d
feat(tests/playground/environment_extension): scoped extensions in Lean
2019-03-25 17:35:01 +01:00
Sebastian Ullrich
360a1476cc
chore(tests/playground/environment_ext): use nicer full name like in C++
2019-03-25 16:12:14 +01:00
Leonardo de Moura
8225146aa2
chore(library/init/core): HasLt => HasLess, HasLe => HasLessEq, ...
2019-03-23 10:07:46 -07:00
Leonardo de Moura
df9ce10623
feat(library/compiler): special support for initialization functions of the form def initFn : IO Unit
...
We can now write
```
@[init] def initFn : IO Unit := ...
```
instead of
```
def initFn : IO Unit := ...
@[init initFn] constant execInitFn : Unit := ()
```
2019-03-23 08:46:38 -07:00
Leonardo de Moura
3b70e8785b
chore(tests/compiler/str): fix test
2019-03-22 17:26:43 -07:00
Leonardo de Moura
412d0ea578
feat(library/init/lean/options): add setOptionFromString
...
We can use this primitive to process command line arguments of the form
`-D <key> = <value>`
TODO: allow users to attach `[init]` to definitions of the form
```
@[init] def foo : IO Unit := ...
```
and avoid the awkward auxiliary constant.
2019-03-22 17:26:43 -07:00
Leonardo de Moura
4f80e30574
feat(library/init/data/string/basic): add String.split
2019-03-22 17:26:43 -07:00
Sebastian Ullrich
91b244f679
chore(tests/playground/environment_ext): style and minor changes
2019-03-22 22:51:21 +01:00
Sebastian Ullrich
dc93bc37cc
chore(tests/playground/environment_ext): fix
2019-03-22 22:51:21 +01:00
Leonardo de Moura
45c4a78f59
chore(tests/playground/environment_ext): revert accidental commit
2019-03-22 13:26:17 -07:00
Leonardo de Moura
e24ad8c0b5
feat(library/init/core): add HasBeq default instances for types that implement DecidableEq
...
@kha I think code looks less weird if we don't mix Booleans and
propositions in the same expression.
2019-03-22 11:23:45 -07:00
Leonardo de Moura
548e7c5436
chore(tests/playground): fix playground tests
2019-03-21 18:30:58 -07:00
Leonardo de Moura
452d5107ac
chore(library/init/data/array): naming convention
...
The array read and write operations are now called:
- "Comfortable" version (with runtime bound checks):
`Array.get` and `Array.set` like OCaml.
It is also consistent with `Ref.get` and `Ref.put`,
and `get` and `set` for `MonadState`.
- `Fin` version (without runtime bound checks):
`Array.index` and `Array.update` like in F*.
- `USize` version (without runtime bound checks and unboxing):
`Array.idx` and `Array.updt`.
cc @kha
2019-03-21 18:03:29 -07:00
Leonardo de Moura
3befc219c9
chore(library/init): Empty => empty when it is a function
2019-03-21 17:03:15 -07:00
Leonardo de Moura
4bf41f0036
chore(tests/lean/run/coroutine): fix test
2019-03-21 16:46:53 -07:00
Leonardo de Moura
7bb015c6b3
chore(tests/lean): fix more tests
2019-03-21 15:11:05 -07:00
Leonardo de Moura
2cbdb287c3
chore(tests): fix/disable some tests
2019-03-21 15:11:05 -07:00