Henrik Böving
23e49eb519
perf: add prelude to all Lean modules
2024-02-18 14:55:17 -08:00
Joachim Breitner
f40c999f68
feat: improve termination_by error messages ( #3255 )
...
as suggested in
<https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/termination_by.20regression/near/419786430 >
Also refactored the code a bit and removed the code smell around
`GuessLex`-produced termination arguments (which may not be
surface-syntactically expressible) a bit by introducing an explicit flag
for those.
2024-02-05 13:13:53 +00:00
Joachim Breitner
b5122b6a7b
feat: per-function termination hints
...
This change
* moves `termination_by` and `decreasing_by` next to the function they
apply to
* simplify the syntax of `termination_by`
* apply the `decreasing_by` goal to all goals at once, for better
interactive use.
See the section in `RELEASES.md` for more details and migration advise.
This is a hard breaking change, requiring developers to touch every
`termination_by` in their code base. We decided to still do it as a
hard-breaking change, because supporting both old and new syntax at the
same time would be non-trivial, and not save that much. Moreover, this
requires changes to some metaprograms that developers might have
written, and supporting both syntaxes at the same time would make
_their_ migration harder.
2024-01-10 17:27:35 +01:00
Mario Carneiro
43f6d0a761
feat: implement have this (part 1)
2023-06-02 16:19:02 +02:00
Mario Carneiro
583e023314
chore: snake-case attributes (part 2)
2022-10-19 09:28:08 -07:00
Leonardo de Moura
fce7697151
fix: def _root_ and dotted notation in recursive definitions
...
closes #1289
2022-07-07 07:57:51 -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
ea682830d1
refactor: change addTermInfo type
2022-04-08 15:01:57 -07:00
Leonardo de Moura
1cfe403edf
chore: style
2022-02-09 10:13:52 -08:00
Sebastian Ullrich
0ef5985b5f
fix: binder info range for let rec/where
2022-02-06 07:21:51 -08:00
Leonardo de Moura
739ef7d166
fix: annotate let rec declarations as auxDecl
...
Reason:
1- Tactics such as `assumption` should ignore them.
2- We must annotate recursive applications with `mkRecAppWithSyntax`.
2022-01-10 14:35:05 -08:00
Sebastian Ullrich
77aed3a0b1
fix: add binder info nodes for parameter copies in body
2021-12-09 18:12:51 +01:00
Sebastian Ullrich
7e317d23db
feat: term info on where declarations
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
4a4b4c1ef4
fix: mkAtomFrom: generate synthetic position like other *From functions
...
Also consistently use binders as reference position for an elided binder type.
Before, type errors were always given extent 1, the length of the
synthetic `_` token.
2021-07-19 13:24:59 -07:00
Leonardo de Moura
1df84e3a6d
feat: allow haveDecl, sufficesDecl, letRecDecls in antiquotations
2021-03-12 17:40:16 -08:00
Leonardo de Moura
be841a7cad
chore: throwError! => throwError, throwErrorAt! => throwErrorAt
...
@Kha I marked the corresponding methods as `protected`.
I currently can't stand `throw_error`, and I am optimistic about
server highlighting feature you are working on :)
2021-03-11 11:59:45 -08:00
Leonardo de Moura
84f78edb31
feat: store declaration ranges
2021-01-11 12:50:11 -08:00
Leonardo de Moura
308c61027a
feat: save doc strings
...
We can now document `let rec` too.
2021-01-10 07:13:33 -08:00
Leonardo de Moura
619885e745
feat: add throwMVarError!
2020-12-25 10:03:42 -08:00
Leonardo de Moura
0869f38de4
chore: update structure, class, inductive
2020-11-27 15:09:30 -08:00
Leonardo de Moura
a056332c03
fix: registerLetRecsToLift
2020-11-18 18:47:22 -08:00
Leonardo de Moura
0af30273c5
feat: hide auxiliary metavariables used to compile let-rec
2020-10-30 14:58:17 -07:00
Leonardo de Moura
b4e8862716
chore: cleanup
2020-10-26 07:54:11 -07:00
Leonardo de Moura
13c2a8ff51
chore: remove #lang lean4 header
2020-10-25 09:54:07 -07:00
Leonardo de Moura
0ee5e81513
chore: use #lang lean4
2020-10-15 10:44:16 -07:00
Leonardo de Moura
d3a22397b4
chore: move to new frontend
2020-10-13 16:38:25 -07:00
Leonardo de Moura
7c6b10012b
chore: add helper function
2020-10-11 19:58:07 -07:00
Leonardo de Moura
0fe705f3a1
feat: improve error messages for unassigned metavariables
...
cc @Kha
2020-09-29 17:18:03 -07:00
Leonardo de Moura
78adaf3e94
fix: "let rec" attributes were not being processed
2020-09-25 18:48:23 -07:00
Leonardo de Moura
d33f7c7885
feat: attribute command
2020-09-20 09:11:36 -07:00
Leonardo de Moura
6ac227a63c
chore: elabAttrs, elabDeclAttrs
2020-09-20 07:39:14 -07:00
Leonardo de Moura
250dc3e3a9
fix: adjust expanders and elaborators to new matchAlts node
2020-09-04 18:59:28 -07:00
Leonardo de Moura
0faaa5ac54
fix: use mkForallFVars and mkLambdaFVars
2020-09-03 08:33:16 -07:00
Leonardo de Moura
06c6002d45
feat: lift nested 'let-rec's
2020-09-02 18:53:18 -07:00
Leonardo de Moura
f2a6562eed
feat: validate 'let rec' types
2020-09-02 17:02:40 -07:00
Leonardo de Moura
1afecc3fbf
fix: applyAttributes at 'let rec'
2020-09-02 17:02:35 -07:00
Leonardo de Moura
8aa5409bac
feat: elaborate 'let rec'
...
Remark: the actual lift is going to be performed at `MutualDef.lean`.
2020-09-02 17:02:35 -07:00
Leonardo de Moura
0883f96da0
chore: remove optional partial from 'let rec'
...
It will inherit the parent declaration annotation.
2020-09-02 17:02:22 -07:00
Leonardo de Moura
9f16d01058
refactor: reduce DeclModifiers dependencies
2020-08-31 10:12:06 -07:00
Leonardo de Moura
6f1975aef5
feat: report errors for unassigned metavariables
...
We were not reporting unassigned metavariables due to
1- `_`
2- Named holes (e.g., `?x`)
3- Implicit arguments
2020-08-27 15:03:41 -07:00
Leonardo de Moura
00599cf62b
fix: types of the recursive functions being defined cannot reference other functions in the same mutual block
2020-08-26 15:29:06 -07:00
Leonardo de Moura
8543a20b8f
feat: add checkpoint using withSynthesize
2020-08-26 15:10:26 -07:00
Leonardo de Moura
5af763f243
feat: use checkNotAlreadyDeclared
2020-08-26 13:44:25 -07:00
Leonardo de Moura
497d8592cf
feat: elaborate letrec values
2020-08-26 13:35:51 -07:00
Leonardo de Moura
5dc5e8a92f
feat: add LetRecView and expand letEqnsDecl occurring in letrec's
2020-08-26 11:30:06 -07:00
Leonardo de Moura
70e508d704
chore: add Lean/Elab/LetRec.lean
2020-08-26 10:07:59 -07:00