Commit graph

29801 commits

Author SHA1 Message Date
Leonardo de Moura
dba1f79170 feat: improve isDefEq for projections
When solving `a.i =?= b.i`, we first reduce `a` and `b` without using
delta reduction. If at least one become a structure, we reduce the
projection. Otherwise, we try to solve `a =?= b`, only reduce `a.i`
and `b.i` if it fails.
2022-06-30 17:00:43 -07:00
Leonardo de Moura
f3bb0be045 feat: add flag to control projection reduction at whnfCore 2022-06-30 16:48:00 -07:00
Leonardo de Moura
2c152dae7d chore: remove unnecessary partial 2022-06-30 15:47:31 -07:00
Leonardo de Moura
e9e75af834 doc: Lean/Meta/Basic.lean
Add some docstrings
2022-06-30 13:32:19 -07:00
Leonardo de Moura
f6b6b36f47 chore: indentation 2022-06-29 16:45:59 -07:00
Leonardo de Moura
467ac9d98a feat: add support for CommandElabM at #eval
Note that it does not use `MetaEval` to execute the term of type
`CommandEval`. Thus, we can now use `#eval` to execute simple commands.

see #1256
2022-06-29 16:34:49 -07:00
Leonardo de Moura
d83a11bac5 chore: expose exprToSyntax 2022-06-29 16:02:01 -07:00
Leonardo de Moura
66711a9974 chore: update stage0 2022-06-29 15:40:57 -07:00
Leonardo de Moura
d4eed2e490 test: test for #1267 2022-06-29 15:40:13 -07:00
Leonardo de Moura
e8891986f2 chore: update stage0 2022-06-29 15:37:30 -07:00
Leonardo de Moura
95efa3dcd2 fix: withPosition case at MacroArgUtil
fixes #1267 after update stage0
2022-06-29 15:35:34 -07:00
Leonardo de Moura
1b7fab4497 chore: add binder types 2022-06-29 15:31:10 -07:00
Leonardo de Moura
e968dfb68c feat: elaborate do notation even when expected type is not available
see issue #1256
2022-06-29 13:30:06 -07:00
Leonardo de Moura
598898a087 fix: fixes #1265 2022-06-29 12:41:14 -07:00
Leonardo de Moura
15e2a7d5b4 feat: report errors an unassigned metavars at #eval
See #1256
2022-06-29 11:53:33 -07:00
Sebastian Ullrich
3ed910a043 refactor: rename AsyncList.asyncTail to delayed
I often found the terminology confusing as it is inconsistent with
`List.tail`
2022-06-29 17:08:15 +02:00
Sebastian Ullrich
ae683af9c2 refactor: merge AsyncList.updateFinishedPrefix/finishedPrefix
We only ever use both of them together, and forgetting to call the first
one first could lead to subtle bugs.
2022-06-29 17:08:15 +02:00
Sebastian Ullrich
c8fb72195b feat: print panic backtraces on Linux 2022-06-29 16:29:35 +02:00
Leonardo de Moura
a888b21bce fix: compiler bug at And.casesOn
Fixes issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.28libc.2B.2Babi.29.20lean.3A.3Aexception.3A.20incomplete.20case/near/287839995
2022-06-29 06:56:17 -07:00
Sebastian Ullrich
10b0eca41f chore: CI: minor 2022-06-29 12:43:01 +02:00
Leonardo de Moura
98b8e300e1 feat: add evalTerm and Meta.evalExpr
These functions were in Mathlib 4.
2022-06-28 19:14:40 -07:00
Leonardo de Moura
fc7c1d1053 chore: remove unnecessary set_option 2022-06-28 17:37:10 -07:00
Leonardo de Moura
87a72e4bbe chore: update stage0 2022-06-28 16:57:11 -07:00
Sebastian Ullrich
80217cfa90 fix: asynchronous head snapshot fallout 2022-06-28 16:54:29 -07:00
Sebastian Ullrich
99f5e94efe feat: MonadExcept.ofExcept 2022-06-28 16:54:29 -07:00
Sebastian Ullrich
c64ac02ffc fix: declModifiers syntax kind 2022-06-28 22:35:13 +02:00
Sebastian Ullrich
a9cc57c81c chore: CI: more cache setup 2022-06-28 22:31:51 +02:00
Sebastian Ullrich
920fa1109b
chore: CI: ccache permissions 2022-06-28 18:53:36 +02:00
Sebastian Ullrich
9816331562 chore: clean up bootstrapping cleanup 2022-06-28 16:28:36 +02:00
Sebastian Ullrich
995d92d10e chore: CI: fix ccache cache group 2022-06-28 16:24:10 +02:00
Sebastian Ullrich
8f3fda4777 chore: update stage0 2022-06-28 16:01:43 +02:00
Sebastian Ullrich
77c6f433c7 chore: clean up bootstrapping workarounds 2022-06-28 16:01:07 +02:00
Sebastian Ullrich
74c4437874 chore: CI: simplify Nix setup, bring back macOS 2022-06-28 12:50:19 +02:00
Sebastian Ullrich
5bba20d6a9 refactor: revert toParserDescr signature change 2022-06-28 11:50:59 +02:00
Sebastian Ullrich
89a101e9b8 refactor: remove group(·)s 2022-06-28 11:50:59 +02:00
Sebastian Ullrich
9490328429 chore: update stage0 2022-06-28 11:50:59 +02:00
Sebastian Ullrich
eab64997cd fix: auto-group syntax parsers where necessary 2022-06-28 11:50:59 +02:00
Timo
e49a81bb56 doc: fix typo 2022-06-27 19:48:45 -07:00
Leonardo de Moura
34dc2572f3 fix: make sure OfScientific Float instance is never unfolded during type class resolution
This commit fixes issue reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/deterministic.20timeout/near/287654818

Type class resolution was diverging when trying to synthesize
```lean
 HSub (optParam Float 0.0) (optParam Float 1.0) ?m.472
```
and Lean was diverging while unfolding
```lean
 instance : OfScientific Float where
   ofScientific m s e :=
     if s then
       let s := 64 - m.log2 -- ensure we have 64 bits of mantissa left after division
       let m := (m <<< (3 * e + s)) / 5^e
       Float.ofBinaryScientific m (-4 * e - s)
     else
       Float.ofBinaryScientific (m * 5^e) e
```
was being unfolded.

Anothe potential solution for the problem above is to erase the
`optParam` annotations before performing type class resolution.
2022-06-27 17:40:34 -07:00
Sebastian Ullrich
ca19ce1e6f chore: CI: fix Windows 2022-06-28 00:38:19 +02:00
Sebastian Ullrich
18d2296b1c doc: add typed macros to RELEASES.md 2022-06-27 23:42:13 +02:00
Leonardo de Moura
5901fef43a feat: protected aliases
See message: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Namespace-based.20overloading.20does.20not.20find.20exports/near/287633118
2022-06-27 13:56:58 -07:00
Sebastian Ullrich
19c2644d88 chore: add more comments 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
544a046678 chore: use Syntax.Level 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
22475b8669 refactor: introduce common TSyntax abbreviations 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
db42874be4 chore: update Lake 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
e47f248161 doc: TSyntax 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
8b4d8b8dc9 feat: TSyntax singleton kind unexpanders 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
6f7ff3b492 chore: remove unnecessary type annotations 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
6af00ff23e chore: changes to placate coercions 2022-06-27 22:37:02 +02:00