Commit graph

24343 commits

Author SHA1 Message Date
Leonardo de Moura
05022cc80b fix: disable implicit lambda insertion at _, ?h, and by ...
@Kha This commit addresses an issue reported by Kevin. Holes and tactic
blocks represent a discontinuity in the elaboration process.
By introducing inaccessible variables (or "things" as Kevin calls
them), we create error message that are harder to understand (see
affected test), and goals where we didn't allow the user to select the
variable name and/or eagerly unfolded a definition.

BTW, I first considered using "reducible" setting when deciding
whether to insert implicit lambdas or not. This is a bad idea.
See `monotone.lean` test. The decision should not depend on
reducibility status, but whether there is "discontinuity" on the
elaboration process or not. As Kevin pointed out,
"introducing implicits work great if you finish the job".
2021-03-25 16:13:15 -07:00
Leonardo de Moura
dd9cc7a273 fix: typo 2021-03-25 15:57:10 -07:00
Leonardo de Moura
083301e286 fix: non-dependent arrow vs dependent arrow issue at DiscrTree 2021-03-25 13:04:24 -07:00
Leonardo de Moura
3bc26a64e6 chore: update stage0 2021-03-25 12:23:14 -07:00
Leonardo de Moura
b7acc38810 feat: add support for "arrow" at DiscrTree 2021-03-25 12:21:10 -07:00
Leonardo de Moura
59ac5be60d chore: add `` 2021-03-25 12:21:10 -07:00
Sebastian Ullrich
1665f8d455 chore: Nix: update vscode-lean4 2021-03-25 18:53:44 +01:00
Sebastian Ullrich
3557d521d5 fix: don't unconditionally format InfoTrees in the server 2021-03-25 14:45:42 +01:00
Sebastian Ullrich
7b9ee8611c fix: trace.Elab.Info in the server 2021-03-25 14:36:30 +01:00
Sebastian Ullrich
96c8cdfb14 chore: revert test changes 2021-03-25 10:35:22 +01:00
Leonardo de Moura
3176be136c feat: improve "discriminant refinement" 2021-03-24 21:05:08 -07:00
Leonardo de Moura
ceba38526a fix: save errToSorry 2021-03-24 20:54:14 -07:00
Leonardo de Moura
66a8683f08 fix: updateMatchType may generate type incorrect terms
If generated type is not correct, we should abort "discriminant
refinement", and use the original error message because users may
be confused by a type error on something they did not write.
2021-03-24 19:41:25 -07:00
Leonardo de Moura
f11a003526 test: add "discriminant refinement" tests 2021-03-24 19:10:50 -07:00
Leonardo de Moura
ce1dda8eea fix: missing withMVarContext 2021-03-24 18:25:41 -07:00
Leonardo de Moura
ec5afce45b feat: contextual := true at simp_all
cc @Kha
2021-03-24 15:49:31 -07:00
Leonardo de Moura
e4d4db45e9 feat: add missing simp lemmas for -> 2021-03-24 14:51:18 -07:00
Leonardo de Moura
4044308090 chore: use double quoted names 2021-03-24 12:36:18 -07:00
Leonardo de Moura
52bc9805e7 chore: update stage0 2021-03-24 12:30:24 -07:00
Leonardo de Moura
e31c02522b feat: closes #327 2021-03-24 12:29:33 -07:00
Leonardo de Moura
d86164cf54 fix: simple match case 2021-03-24 11:46:55 -07:00
Leonardo de Moura
30b9792148 fix: doc 2021-03-24 10:59:11 -07:00
Leonardo de Moura
b3ec00b00a chore: use "discriminant refinement" 2021-03-24 10:43:43 -07:00
Leonardo de Moura
592364270c chore: cleanup 2021-03-24 09:50:56 -07:00
Leonardo de Moura
d03f5fe318 feat: add trivial extensible (macro) tactic 2021-03-24 09:50:56 -07:00
Leonardo de Moura
2dfd262e4d chore: cleanup 2021-03-24 09:50:56 -07:00
Sebastian Ullrich
d15c08e3c8 fix: lean4-mode: void-variable 2021-03-24 15:25:35 +01:00
Sebastian Ullrich
94a9a2516a doc: update server readme 2021-03-24 14:16:37 +01:00
Leonardo de Moura
1eb9d16690 chore: fix typos 2021-03-23 20:47:56 -07:00
Leonardo de Moura
1b7f7e9d39 chore: remove unnecessary annotations 2021-03-23 20:42:59 -07:00
Leonardo de Moura
6f6bb02bcd chore: update stage0 2021-03-23 20:40:45 -07:00
Leonardo de Moura
5742b078af feat: "discriminant refinement" for match-expressions 2021-03-23 20:40:07 -07:00
Leonardo de Moura
5ac7b1232a chore: add workarounds
@Kha It seems the recent parser modifications created some unexpected
problems. I didn't investigate them. I am "lost" in the elaborator and
dependent pattern matching land.

1) We can't write anymore
```
f [1, 2, 3] |>.run' 0 = Except.ok ()
```
We have to use parentheses and the error message is weird :(
```
(f [1, 2, 3] |>.run' 0) = Except.ok ()
```

2) I had to add comments to `macro.lean`, I didn't find a workaround
for one of the rules. BTW, I had to add a bunch of `:term` for fixing
the other rules, and the error messages were counterintuitive.
2021-03-23 18:35:27 -07:00
Leonardo de Moura
e4f8aad664 chore: update stage0 2021-03-23 18:17:18 -07:00
Leonardo de Moura
1b963862c6 test: add test for former weird error message 2021-03-23 18:16:06 -07:00
Leonardo de Moura
b85c60aa75 chore: remove leftovers 2021-03-23 17:33:23 -07:00
Leonardo de Moura
99cd4fa720 feat: refine auto bound implicit locals 2021-03-23 17:33:15 -07:00
Leonardo de Moura
ec409a9bfc fix: fixes #366 2021-03-23 16:02:45 -07:00
Sebastian Ullrich
62ae39e62b fix: pp.all should not turn off pp.binder_types 2021-03-23 19:45:41 +01:00
Sebastian Ullrich
a0eff55772 fix: unhygiene in synthesized notation unexpander 2021-03-23 19:08:06 +01:00
Sebastian Ullrich
dbefb7dd5f feat: support $_ antiquotations in match 2021-03-23 19:07:42 +01:00
Sebastian Ullrich
ba285c1c45 chore: do not hide leanpkg print-paths errors
@Vtec234 I was super confused about why the LEAN_PATH seemed to be set
up the wrong way when in reality an import failed to compile. If this is
an issue in the client or on Windows, we must fix it there.
2021-03-23 15:31:21 +01:00
Sebastian Ullrich
3af7bc0b87 fix: wrong dir in new error message 2021-03-23 14:06:20 +01:00
Sebastian Ullrich
ed55fdfd3e chore: better error message when failing to find current package 2021-03-23 12:10:26 +01:00
Leonardo de Moura
81e6181488 test: add another test 2021-03-22 21:21:14 -07:00
Leonardo de Moura
650c6df380 feat: try other variables after failure 2021-03-22 21:02:26 -07:00
Leonardo de Moura
17907a7829 fix: perform topological sort on pattern variables 2021-03-22 20:35:07 -07:00
Sebastian Ullrich
ed9c3ba525 doc: LHS precedences 2021-03-22 16:33:37 +01:00
Sebastian Ullrich
cd4cd581be feat: make infix non-associative 2021-03-22 16:33:37 +01:00
Sebastian Ullrich
2180898192 fix: |>. must parse its arguments
... since we want it to have a low precedence, which now precludes it
from being used in function position
2021-03-22 16:33:37 +01:00