Commit graph

3912 commits

Author SHA1 Message Date
Leonardo de Moura
10fe453cf6 test(tests/lean/run/ubscalar): save UB scalar field test 2019-07-28 10:11:35 -07:00
Sebastian Ullrich
b902dc3dac fix(tests/lean/run/inline_fn): pretty-printer segfaults, disable for now 2019-07-26 12:39:35 -07:00
Sebastian Ullrich
aef4a7159b chore(*): remove obsolete leanpkg.path files 2019-07-25 17:46:53 -07:00
Leonardo de Moura
b0d0cf973d chore(tests): fix tests 2019-07-25 17:44:25 -07:00
Leonardo de Moura
40943f84f3 chore(tests): fix tests 2019-07-17 10:46:35 -07:00
Leonardo de Moura
53c946a305 chore(tests/lean): fix tests 2019-07-08 22:11:19 -07:00
Leonardo de Moura
8944767f6c chore(frontends/lean): Π ==> 2019-07-07 08:13:40 -07:00
Leonardo de Moura
ea6eee516b chore(frontends/lean): use => instead of := in match-expressions
Motivation: use same separator used in lambda expressions as in
other programming languages.
2019-07-04 11:38:38 -07:00
Leonardo de Moura
cf465ba085 chore(tests/lean/trust0/basic): fix test 2019-07-02 17:36:13 -07:00
Leonardo de Moura
a02443d23d chore(frontends/lean): fun x, e ==> fun x => e 2019-07-02 13:22:11 -07:00
Sebastian Ullrich
c299e6c0e6 chore(tests): fix do syntax in tests 2019-06-30 13:04:34 +02:00
Leonardo de Moura
bc0c0ee9bc chore(tests): fix tests 2019-06-24 15:48:11 -07:00
Leonardo de Moura
aadb07d5e4 chore(tests/lean): remove/fix tests 2019-06-07 09:56:11 -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
5ee7a211cf chore(tests/lean/run/rc_tests): fix test 2019-05-22 18:46:30 -07:00
Leonardo de Moura
b782191d0b chore(tests/lean/run/float_cases_bug): fix test 2019-05-07 15:22:01 -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
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
e71249f6b3 chore(tests): fix tests 2019-03-27 14:06:23 -07:00
Leonardo de Moura
8225146aa2 chore(library/init/core): HasLt => HasLess, HasLe => HasLessEq, ... 2019-03-23 10:07:46 -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
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
Sebastian Ullrich
f34d37c371 chore(tests): port tests, fix at least compiler tests 2019-03-21 15:11:05 -07:00
Sebastian Ullrich
e0bbc094ad chore(library/init): remove coroutines from stdlib 2019-03-08 15:34:17 +01:00
Leonardo de Moura
8e9b0d2799 fix(library/compiler): inferred types for stage2 declarations 2019-03-06 17:24:43 -08:00
Leonardo de Moura
9cc41c4f3d chore(frontends/lean/inductive_cmds): disable broken check
@kha I have disabled this check. It was implemented 2 years ago by
Daniel, and I don't want to fix it. It seems you have already fixed a
bug there. AFAICT, this check is just for improving error messages.
I believe we may not even need it since the kernel now supports nested
inductive types. AFAIR, Daniel implemented this check here because the
inductive compiler was introducing a lot of auxiliary declarations
that were making the kernel error messages unreadable.
2019-03-04 11:05:21 -08:00
Sebastian Ullrich
534b507aff feat(library/init/lean/frontend): rework error reporting 2019-02-12 13:34:32 +01:00
Leonardo de Moura
7e8f9e6f66 feat(library/compiler): add [extern] attribute 2019-02-09 18:53:44 -08:00
Sebastian Ullrich
4c0f836305 chore(shell/lean): reduce lean interface to taking a single file, assuming all dependencies have already been built 2019-01-25 18:27:38 +01:00
Sebastian Ullrich
9f90dbfd3d feat(library/init/lean/parser/syntax): improve syntax.get_pos for more error positions 2019-01-22 11:16:00 +01:00
Sebastian Ullrich
69e363446d fix(library/init/lean/{parser/term,elaborator}): local notations override previous notations 2019-01-20 16:25:15 +01:00
Leonardo de Moura
c3dfb613d5 test(tests/lean/run/rc_tests): basic explicit_rc_fn tests 2019-01-17 15:25:27 -08:00
Sebastian Ullrich
3611eda136 fix(frontends/lean/vm_elaborator): message order 2019-01-17 19:57:00 +01:00
Sebastian Ullrich
3d66e7dbe1 fix(library/pos_info_provider): row and column were swapped 2019-01-16 19:12:40 +01:00
Sebastian Ullrich
5660a8e690 feat(library/init/lean/elaborator): transmit position information 2019-01-15 18:28:35 +01:00
Sebastian Ullrich
9ac41835ba test(tests/lean/parser1): add some name resolution tests 2019-01-06 18:22:18 +01:00
Sebastian Ullrich
32a3c0e62e feat(library/init/lean/frontend,bin/lean-bootstrapped): expose new frontend as executable 2018-12-20 14:28:18 +01:00
Sebastian Ullrich
0911d16bc3 feat(library/init/lean): compute and show error positions 2018-12-20 14:28:18 +01:00
Sebastian Ullrich
e5aaf391ff fix(library/init/lean/parser/syntax): macro_scopes.flip 2018-12-19 15:04:48 +01:00
Sebastian Ullrich
1d524476b7 chore(tests/lean/parser1): restore #exit... 2018-12-12 11:06:52 +01:00
Sebastian Ullrich
94dec2cb9f feat(library/init/lean/elaborator): elaborate universe 2018-12-11 19:01:41 +01:00
Sebastian Ullrich
11e5d1a8a2 chore(tests/lean/parser1): reintroduce #exit in front of core.lean test 2018-12-06 13:23:25 +01:00
Sebastian Ullrich
143ac0e58a feat(library/init/lean/expander): also normalize bracketed binders in e.g. declarations 2018-12-06 13:23:12 +01:00
Sebastian Ullrich
58def30036 chore(tests/lean/parser1): clearly delimit components in profiler output 2018-12-04 12:31:13 +01:00
Leonardo de Moura
607d22ae58 fix(library/compiler/csimp): bug at float_cases_on_core
The bug occurs when floating `cases_on` application in code of the form
```
let x := C.cases_on ...
in t
```
and when the type of `t` depends on `x`.
The issue here is that the `x` declaration disappears after the float, but the resulting type still depends on it.
We fix the bug by replacing `x` with its value in the type.

cc @kha
2018-11-30 11:40:41 -08:00
Sebastian Ullrich
fd121f03bd feat(library/init/lean/expander): make set of transformers configurable 2018-11-21 18:13:38 +01:00