Commit graph

158 commits

Author SHA1 Message Date
Joachim Breitner
5cd90f5826
feat: drop support for termination_by' (#3033)
until around 7fe6881 the way to define well-founded recursions was to
specify a `WellFoundedRelation` on the argument explicitly. This was
rather low-level, for example one had to predict the packing of multiple
arguments into `PProd`s, the packing of mutual functions into `PSum`s,
and the cliques that were calculated.

Then the current `termination_by` syntax was introduced, where you
specify the termination argument at a higher level (one clause per
functions, unpacked arguments), and the `WellFoundedRelation` is found
using type class resolution.

The old syntax was kept around as `termination_by'`. This is not used
anywhere in the lean, std, mathlib or the theorem-proving-in-lean
repositories,
and three occurrences I found in the wild can do without

In particular, it should be possible to express anything that the old
syntax
supported also with the new one, possibly requiring a helper type with a
suitable instance, or the following generic wrapper that now lives in
std
```
def wrap {α : Sort u} {r : α → α → Prop} (h : WellFounded r) (x : α) : {x : α // Acc r x}
```

Since the old syntax is unused, has an unhelpful name and relies on
internals, this removes the support. Now is a good time before the
refactoring that's planned in #2921.

The test suite was updated without particular surprises.

The parametric `terminationHint` parser is gone, which means we can
match on syntax more easily now, in `expandDecreasingBy?`.
2023-12-11 17:33:17 +00:00
Joachim Breitner
6d23450642
refactor: rewrite TerminationHint elaborators (#2958)
In order to familiarize myself with this code, and so that the next
person has an easier time, I

* added docstrings explaining what I found out these things to
* rewrote the syntax expansion functions using syntax pattern matches,
  to the extend possible
2023-12-02 10:08:07 +00:00
Joachim Breitner
ae470e038e
docs: fix doc comment syntax in declModifiers doc comment (#2590)
The hover on `declModifiers` says doc comments are `/-! … -/`, when it
should say `/-- … -/`.
2023-09-27 11:57:40 +10:00
Sebastian Ullrich
dc60150b5a chore: update domain 2023-09-20 15:13:27 -07:00
Mario Carneiro
2037094f8c
doc: document all parser aliases (#2499) 2023-09-06 09:02:25 +00:00
Mario Carneiro
5661b15e35 fix: spacing and indentation fixes 2023-05-28 18:48:36 -07:00
Sebastian Ullrich
f24608c4d1 fix: make eoi an actual command with info tree 2023-01-26 13:05:57 +01:00
Gabriel Ebner
e71a2e58bb fix: remove misleading leading space in " where" 2022-12-21 22:54:42 +01:00
Leonardo de Moura
a7107aedb3 fix: fixes #1848 2022-11-18 08:49:10 -08:00
Mario Carneiro
765ebcdbf0 feat: use withoutPosition consistently 2022-10-24 12:51:32 -07:00
Mario Carneiro
e7c7678ab0 refactor: line wrapping in parser code 2022-10-24 08:37:29 -07:00
Mario Carneiro
583e023314 chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Mario Carneiro
faa612e7b7 chore: remove #resolve_name 2022-10-17 14:53:51 -07:00
Mario Carneiro
8dfae9eb38 feat: import command stub 2022-10-12 11:11:31 -07:00
Gabriel Ebner
59abb9a332 feat: move docstring before | in ctors 2022-09-14 08:26:17 -07:00
Gabriel Ebner
54e7d31d0f feat: allow empty whereStructInst 2022-09-13 06:19:40 -07:00
Mario Carneiro
3bb3efdedc feat: allow optional type in example 2022-09-13 03:11:04 -07:00
Sebastian Ullrich
4050227e5d chore: revert marking internal notes as parser/elab docstrings 2022-08-31 17:49:43 -07:00
Mario Carneiro
014db5d6d0 doc: relocate doc strings from elab to syntax 2022-08-13 17:16:40 -07:00
Sebastian Ullrich
d7e14ba47f feat: openDecl antiquotation 2022-08-07 15:11:07 +02:00
Leonardo de Moura
55bb8e905a chore: binderIdent normalization
fixes #1411
2022-08-04 21:10:02 -07:00
Mario Carneiro
25aea1b723 doc: document all the tactics 2022-08-01 08:08:03 -07:00
Leonardo de Moura
ab6af0118c doc: add inductive command doc string 2022-07-30 15:15:16 -07:00
Sebastian Ullrich
a2ccf8f122 feat: accept keywords as constructor names 2022-07-28 12:46:28 -07:00
Leonardo de Moura
2c0de29dfd feat: add add_decl_doc command 2022-07-27 09:30:32 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Sebastian Ullrich
8e07e80f72 feat: docComment parser alias 2022-07-22 14:30:49 +02:00
Sebastian Ullrich
cdb855d281 feat: support all sensible modifiers on (builtin_)initialize
Resolves #1324
2022-07-20 22:12:20 +02:00
Gabriel Ebner
243439a75c feat: support modifiers in computed fields 2022-07-11 12:26:53 -07:00
Gabriel Ebner
b1eb022027 feat: computed fields 2022-07-11 12:26:53 -07:00
Sebastian Ullrich
d7bcc271be refactor: avoid nested sequence in simpleBinder 2022-07-08 19:06:10 +02:00
Sebastian Ullrich
c64ac02ffc fix: declModifiers syntax kind 2022-06-28 22:35:13 +02:00
Sebastian Ullrich
c202a2c013 feat: more antiquotation kinds 2022-06-27 22:37:02 +02:00
Gabriel Ebner
ec4200fc75 chore: remove unnecessary ppLine 2022-06-24 10:59:55 +02:00
Sebastian Ullrich
4212cc740b refactor: move linebreak check into sepBy(1)Indent
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
2022-06-16 23:33:57 +02:00
Sebastian Ullrich
ce054fb2e7 fix: introduce semicolonOrLinebreak, replace many(1) with sepBy(1) where appropriate 2022-06-16 23:33:57 +02:00
Leonardo de Moura
22c8f10b12 chore: remove constant command 2022-06-14 17:14:28 -07:00
Leonardo de Moura
05778565ab feat: add opaque command
It will replace the `constant` command. See
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/What.20is.20.60opaque.60.3F/near/284926171
2022-06-14 16:22:36 -07:00
Leonardo de Moura
1e59eb2290 chore: update whereStructInst 2022-06-07 18:41:43 -07:00
Sebastian Ullrich
a2baf2cb96 refactor: split term/command quotations 2022-04-15 08:50:46 -07:00
Leonardo de Moura
8d2d0b3fbe chore: remove {} from structure command 2022-04-13 10:19:00 -07:00
Leonardo de Moura
bd35e8a2be chore: remove {} from ctor parser 2022-04-13 08:47:21 -07:00
Leonardo de Moura
addcbc6fa3 feat: process termination_by syntax 2022-01-12 16:15:30 -08:00
Leonardo de Moura
a1ab5c0ccb feat: simplify termination_by new syntax
We don't need `using` anymore since we are going to use TC inference.
2022-01-12 08:28:03 -08:00
Leonardo de Moura
f9b79092f6 feat: new termination_by syntax 2022-01-11 15:36:50 -08:00
Leonardo de Moura
ce76ad44ea feat: add terminationByCore parser 2022-01-11 14:44:36 -08:00
Gabriel Ebner
ab3e08190b feat: allow opt-out of grouping in formatter 2021-12-15 11:42:38 +00:00
Gabriel Ebner
f1fc8f2441 fix: space before where/:= in inductive 2021-12-15 11:42:38 +00:00
Gabriel Ebner
3f73442a5a fix: space before infer modifiers 2021-12-15 11:42:38 +00:00
Gabriel Ebner
b176efefca fix: print line before deriving 2021-12-15 11:42:38 +00:00