Leonardo de Moura
ec87283465
perf: use withSynthesize when elaborating let/have type ( #4096 )
...
closes #4051
cc @semorrison
2024-05-09 00:58:43 +00:00
Leonardo de Moura
2a5ca00ad6
perf: issue at binop% and binrel% elaborators ( #4092 )
...
This issue was affecting several Mathlib files.
@mattrobball @semorrison This is a different solution for the issue. The
comment at `Extra.lean` describes the new solution and documents the new
issues found with the previous one.
closes #4085
2024-05-07 23:31:05 +00:00
Kim Morrison
01573067f9
chore: typos ( #4026 )
2024-04-29 14:04:50 +00:00
Kyle Miller
acb1b09fbf
fix: expression tree elaborator for relations now localizes error messages to the LHS or RHS ( #3442 )
...
Added `withRef` when processing the LHS or RHS. Without this, in an
expression such as `true = ()` the entire expression would be
highlighted with "type mismatch, `()` has type `Unit` but is expected to
have type `Bool`". Now the error is localized to `()`.
This behavior was pointed out [on
Zulip](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/error.20location.20bug/near/422665805 ).
2024-03-04 00:53:32 +00:00
Henrik Böving
23e49eb519
perf: add prelude to all Lean modules
2024-02-18 14:55:17 -08:00
Sebastian Ullrich
31f234ba3c
feat: leftact%/rightact% binop variants
2023-11-12 16:57:51 +11:00
Mario Carneiro
f1b2a8acce
fix: lazy_binop + coercion bug
...
fixes #2300
2023-07-01 06:05:25 -07:00
Sebastian Ullrich
d59f5c2ffa
fix: binop% info tree
2023-01-16 08:33:58 -08:00
Gabriel Ebner
8a48a8f119
refactor: use coercion meta API
2022-12-22 02:02:55 +01:00
Leonardo de Moura
e6caee97ec
feat: unop% elaborator
...
We now have support for unary operators at `Op.toTree` and `Op.toExpr`
see #1779
2022-10-26 06:44:44 -07:00
Mario Carneiro
583e023314
chore: snake-case attributes (part 2)
2022-10-19 09:28:08 -07:00
Gabriel Ebner
1c561c39a8
feat: function coercions with unification
2022-10-14 12:08:10 -07:00
Mario Carneiro
85119ba9d1
chore: move Std.* data structures to Lean.*
2022-09-26 05:46:04 -07:00
Leonardo de Moura
d3b0b49c43
feat: improve elabBinRelCore
...
See new test and comments at `elaBinRelCore`
2022-09-15 15:17:57 -07:00
Gabriel Ebner
f1b5fa53f0
chore: use new comment syntax
2022-09-14 08:26:17 -07:00
Leonardo de Moura
ed616abfb3
fix: hover information and go-to definition for notation defined using binop%
2022-08-13 21:34:27 -07:00
Leonardo de Moura
fd0581f485
refactor: add Elab/Calc.lean
2022-07-24 13:30:05 -07:00
Leonardo de Moura
22d37af5c9
feat: improve calc syntax
...
See #1342
2022-07-24 08:32:20 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! ( #1354 )
2022-07-22 12:05:31 -07:00
Gabriel Ebner
3edf22f3f5
fix: crash in binop%
2022-07-17 09:57:56 -07:00
Leonardo de Moura
5e333191a2
feat: improve binop% and binrel% elaboration functions
...
Add support for operators that may not have homogeneous instances for
all types. For example, we have `HPow Nat Nat Nat` and `HPow Int Nat Int`,
but we don't have `HPow Int Int Int`.
2022-07-12 18:12:20 -07:00
Leonardo de Moura
a0e459999b
chore: cleanup
2022-07-12 17:36:04 -07:00
Gabriel Ebner
a8cab84735
refactor: use computed fields for Expr
2022-07-11 14:19:41 -07:00
Leonardo de Moura
d50b33175d
feat: improve forIn elaborator element type propagation
2022-07-08 16:34:42 -07:00
Leonardo de Moura
e4e0f775d6
feat: improve outParam as result type support
2022-07-08 15:29:48 -07:00
Leonardo de Moura
55ad7beb8d
feat: add coercion placeholder for applications that return an output parameter of a local instance
2022-07-06 15:42:39 -07:00
Leonardo de Moura
2ebcf29cde
chore: use a[i]! for array accesses that may panic
2022-07-02 15:12:05 -07:00
Leonardo de Moura
77ae79be46
chore: use let/if in do blocks
2022-06-13 17:10:14 -07:00
Leonardo de Moura
041827bed5
chore: unused variables
2022-06-07 17:54:10 -07:00
Sebastian Ullrich
ae7b895f7a
refactor: unname some unused variables
2022-06-07 16:37:45 -07:00
Leonardo de Moura
fad21a4cda
chore: remove leftovers
2022-05-25 20:38:20 -07:00
Leonardo de Moura
7ce0471f28
feat: improve binrel% elaborator
...
It now relies on `binop%` too, and addresses issue reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Regression.20in.20coercion.20inference/near/281737387
2022-05-09 18:39:52 -07:00
Leonardo de Moura
af5e13e534
feat: improve binop% elaboration function
2022-05-07 10:32:55 -07:00
Leonardo de Moura
eae4b92b0d
feat: use sorry if failed to synthesize default element for unsafe constant
2022-04-05 16:52:54 -07:00
Leonardo de Moura
fdbe893c40
fix: catch mkAppM exceptions
2022-03-23 17:35:04 -07:00
Leonardo de Moura
8b248e2d8c
feat: elaborate for h : x in xs do ... notation
2022-03-03 19:52:26 -08:00
Leonardo de Moura
12e2a79170
chore: fix codebase after removing auto pure
2022-02-03 18:08:14 -08:00
Leonardo de Moura
bac91b9b5b
chore: remove arbitrary
2022-01-15 12:14:27 -08:00
Leonardo de Moura
7d5f14b4a7
chore: elaborate default_or_ofNonempty% and add mkDefault
2022-01-15 11:55:58 -08:00
Leonardo de Moura
a438a2ee21
feat: elaborate arbitrary_or_ofNonempty% and use it to define constants
2022-01-14 17:22:39 -08:00
Sebastian Ullrich
4063729b6c
doc: document some built-in term notations
2021-11-26 17:13:19 +01:00
Leonardo de Moura
ced179f2f5
feat: elaborate binrel_no_prop%
2021-11-09 07:24:46 -08:00
Leonardo de Moura
acd21052c0
chore: remove old notation
2021-10-02 15:06:40 -07:00
Leonardo de Moura
07bd5ae2b8
chore: remove dead code
2021-09-18 07:36:14 -07:00
Leonardo de Moura
55f01fb6e1
feat: elaborate binop_lazy%
2021-09-07 13:30:09 -07:00
Leonardo de Moura
5a862a06c6
chore: remove leftover
2021-09-07 12:57:27 -07:00
Leonardo de Moura
a79b50d629
chore: add type to error message
2021-08-31 10:06:22 -07:00
Leonardo de Moura
c491f829e0
feat: elaborator for the calc notation
...
- It produces better error messages.
- It tweaks the elaboration order.
- It adds a checkpoint after each step.
- It avoids the `show .. from ..` workaround.
2021-08-31 09:56:49 -07:00
Leonardo de Moura
d8340f55a5
doc: document new binop% elaborator
2021-08-13 20:10:30 -07:00
Leonardo de Moura
ddec62f77b
feat: synthesize pending metavariables created before binop% too
...
Reason: some of the `binop%` arguments may be let-variables, and the
values assigned to the let-variables may be in the pending list.
2021-08-13 19:25:45 -07:00