Commit graph

139 commits

Author SHA1 Message Date
Sebastian Ullrich
a7ba103e0a chore: remove leanpkg 2022-02-04 19:03:40 +01:00
Leonardo de Moura
e9d85f49e6 chore: remove tryPureCoe?
Based on the discussion at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/for.2C.20unexpected.20need.20for.20type.20ascription/near/269083574
The consensus seemed to be that "auto pure" is more confusing than its worth.
2022-02-03 16:25:24 -08:00
Leonardo de Moura
483f32edd8 feat: in pure code, do use assume Id monad at do notation
This feature produced counterintuitive behavior and confused users.
See discussion at #770.

As pointed out by @tydeu, it is not too much work to write `Id.run <|`
before the `do` when we want to use the `do` notation in pure code.

closes #770
2021-12-10 12:55:14 -08:00
Sebastian Ullrich
2e47a8d5ca test: actually register new benchmark 2021-12-03 09:25:53 +01:00
Sebastian Ullrich
5869283694 test: new linear solver benchmark by Marc 2021-12-02 17:03:35 +01:00
Sebastian Ullrich
2e36e362cb chore: bench: apparently make doesn't like writing to /dev/null anymore? 2021-10-20 12:44:30 +02:00
Sebastian Ullrich
5f4b1b1d44 Revert "Revert "feat: reintroduce libleanshared, link lean & leanpkg against it""
This reverts commit ccbc9d00db.
2021-08-20 09:42:05 -07:00
Sebastian Ullrich
ccbc9d00db Revert "feat: reintroduce libleanshared, link lean & leanpkg against it" 2021-08-20 15:39:00 +02:00
Sebastian Ullrich
40f41a1f14 chore: adjust binary size benchmark 2021-08-18 13:54:52 +02:00
Sebastian Ullrich
d3f007b3cd chore: fix stdlib benchmarks 2021-08-12 22:41:42 +02:00
Leonardo de Moura
90a79a0b06 chore: remove command universes
Now, `universe` may declare many universes. The goal is to make it
consistent with the `variable` command
2021-06-29 17:01:07 -07:00
Jan Hrcek
2753822fe7
doc: fix typos 2021-03-07 15:06:02 +01:00
Sebastian Ullrich
7e521f0105 chore: remove remaining #lang lean4 in tests 2021-01-27 14:45:31 +01:00
Sebastian Ullrich
8a02dfec4f feat: subsume variables under variable
/cc @leodemoura
2021-01-22 14:36:05 +01:00
Leonardo de Moura
36008271ea feat: ensure no unassigned metavariables in the declaration header when type is explicitly provided 2021-01-11 16:40:14 -08:00
Sebastian Ullrich
48361d92dd chore: increase robustness of stdlib benchmark? 2020-12-30 17:01:05 +01:00
Sebastian Ullrich
1fc5b30fe1 chore: measure stage 2 sizes & add C lines benchmark 2020-12-18 17:47:11 +01:00
Sebastian Ullrich
567034e288 chore: benchmark stdlib with interpreter 2020-12-16 21:47:56 +01:00
Leonardo de Moura
2120883307 refactor: heterogeneous operators
@Kha I had some unexpected surprises, but it is a good change.
Here is the summary.

1- We could get rid of `a %ₙ b` and `ModN` class. We can use `HMod`
instead. It was a positive surprise since I didn't remember we had
this `ModN` class.

2- Coercions are never used in heterogeneous operators. This is
expected since `a * b` is now notation for `HMul.hMul a b`, and
`a` and `b` may have different types. I manually added instances such
as `HMul Nat Int Int`. However, I did not try to add generic instances
such as
```
instance [Coe a b] [Mul b] : HMul a b b where
  hMul x y := mul (coe x) y
```
I will try later.

3- Give `h : cs.size > 0`, I got a type error at
```
let idx : Fin cs.size := ⟨cs.size - 1, Nat.predLt h⟩
```
`Nat.predLt h` has type `Nat.pred cs.size < cs.size`
However, `Nat.pred cs.size` doesn't unify with `cs.size - 1`.
The problem is that we can't synthesize the `HSub` instance until
we apply the default instances.
It worked before because `isDefEq` would force the pending TC
problem `Sub Nat` to be resolved, and after that we would be able
to reduce `cs.size - 1` and establish that it is definitionally
equal to `Nat.pred cs.size`.
I considered two possible workarounds
a) `let idx : Fin cs.size := ⟨cs.size - (1:Nat), Nat.predLt h⟩`
b) `let idx : Fin cs.size := ⟨cs.size - 1, by exact Nat.predLt h⟩`
The first one works because we are not providing enough information
for synthesizing the `HSub` instance. The second works because it
postpones the elaboration of `Nat.predLt h`. The default instances
will be applied before we start applying tactics.

4- The `.` notation is affected too. For example, `(x + 1).toUInt8`
doesn't work since we don't know the type of `x+1` until we apply
default instances. I fixed it by using `(x + (1:Nat)).toUInt8`.
Another possible fix is `Nat.toUInt8 (x + 1)`.
Similarly, `(x+1).fold ...` doesn't work.

5- The following code failed to be elaborated
```
indent (push s!"{ss'}\n") (some (0 - Format.getIndent (← getOptions)))
```
It was working before, but it relied on how the expected type is
propagated. The elaborator process
```
some (0 - Format.getIndent (← getOptions))
```
with expected type `(Option Int)`. So, the `-` is interpreted as
`Int.sub` although `Format.getIndent (← getOptions)` has type `Nat`.
In the new `HSub`, the expected type doesn't really influence TC
resolution since it is an `outparam`. So, we failed with the error
failed to synthesize `HSub Nat Nat Int`.
One possible fix was to add the instance `HSub Nat Nat Int` with
`Int.sub`, but I used the following fix
```
some ((0 : Int) - Format.getIndent (← getOptions))
```
which makes it clear that we want the `Int.sub` operator instead of
`Nat.sub`.
2020-12-01 14:02:46 -08:00
Sebastian Ullrich
1add44916c chore: remove broken & redundant "new parser Core.lean" benchmark 2020-11-13 21:08:46 +01:00
Sebastian Ullrich
0c97f648a8 chore: use stage 2 for benchmarking
/cc @leodemoura
2020-10-29 12:29:52 +01:00
Sebastian Ullrich
72fc3f6679 feat: separate benchmark for profiling the stdlib per-file 2020-10-29 11:53:03 +01:00
Sebastian Ullrich
acc1752874 chore: remove old speedcenter config 2020-10-29 11:53:03 +01:00
Leonardo de Moura
898a08a0c1 chore: avoid Has prefix in type classes
closes #203
2020-10-27 18:29:19 -07:00
Leonardo de Moura
5fed774461 chore: HasRepr ==> Repr 2020-10-27 16:15:10 -07:00
Leonardo de Moura
10c32fcf94 chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
Sebastian Ullrich
b856553b4f chore: fix benchmark 2020-10-25 21:55:50 +01:00
Leonardo de Moura
8cb1ff206c chore: move tests to new frontend 2020-10-23 14:07:26 -07:00
Sebastian Ullrich
ce96fab8de chore: fix passing additional LEAN(C)_OPTS to make 2020-10-22 12:00:39 +02:00
Sebastian Ullrich
5b4247a9c7 chore: fix stdlib benchmark 2020-09-28 13:39:32 +02:00
Sebastian Ullrich
77cbaa752c fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
9c6ff0baac chore: certainly this one is the right fix 2020-08-29 12:56:37 +02:00
Sebastian Ullrich
0b727a6d78 chore: fix stdlib benchmark once more... 2020-08-29 10:40:21 +02:00
Sebastian Ullrich
2c1b0e3114 chore: remove hanging stdlib bench test from CI 2020-08-26 11:34:43 +02:00
Sebastian Ullrich
defc7f766e chore: try to fix benchmark once more... 2020-08-24 17:49:55 +02:00
Sebastian Ullrich
9106417693 chore: fix speedcenter test, perf stat runner not supporting multiline cmds 2020-08-24 16:30:50 +02:00
Sebastian Ullrich
015903f055 chore: speedcenter: benchmark actual, parallel stdlib build 2020-08-24 13:43:44 +02:00
Sebastian Ullrich
55b043cabe chore: update cross benchsuite 2020-08-21 16:05:40 +02:00
Sebastian Ullrich
5e48d2bb7d chore: update cross benches 2020-08-18 11:44:29 +02:00
Sebastian Ullrich
086e9e062a chore: measure maxrss in benchmarks 2020-07-21 14:47:22 +02:00
Sebastian Ullrich
b7f6f37079 chore: remove unreliable cache metrics 2020-07-15 17:16:04 +02:00
Sebastian Ullrich
8826330862 chore: add slightly different config for new speedcenter 2020-07-10 17:28:58 +02:00
Sebastian Ullrich
fe20860c3d chore: delete unused file 2020-06-16 10:41:42 -07:00
Leonardo de Moura
9c0bd9dd41 chore: fix tests 2020-05-26 15:05:00 -07:00
Leonardo de Moura
bd58048449 chore: { <source> with ... } syntax 2020-05-20 15:08:43 -07:00
Sebastian Ullrich
6a0410f8f0 feat: make import A import A.olean instead of A/Default.olean 2020-05-19 11:29:32 -07:00
Sebastian Ullrich
9476ee2f54 fix: benchmarks CI 2020-05-14 14:47:54 +02:00
Sebastian Ullrich
872d5fc7ba feat: stop compiling Lean code as C++, remove --cpp option
Since we don't use static initializers, really the only difference between using `clang` and `clang++` is the default
inclusion of the C++ standard library.
2020-05-14 14:45:33 +02:00
Sebastian Ullrich
053d4bab1c chore: factor out and unify common test behavior; retrieve lean from PATH
`./test_single.sh foo.lean yes` is now `./test_single.sh -i foo.lean`
2020-05-14 14:38:52 +02:00
Sebastian Ullrich
8f67db0101 refactor: never implicitly ignore monadic results
Also change `do e; f` to desugar to `e *> f` so that it is affected as well
2020-04-23 11:09:59 -07:00