lean4-htt/src/Lean/Parser
Joachim Breitner fb0c46a011
feat: termination_by structural (#4542)
This implements the `termination_by structural` syntax proposed in
#3909.

I went with `termination_by structural` over, say,
`termination_by (config := {method := .structural})` mainly because it
was
easier to get going (otherwise I’d have to look into how to define
recursive
parsers, as `Parser.config` depends on `term` and `termination_by` is
part of
term. But also because I find it more ergonomic and aesthetic as a user.
But syntax can still change.

The `termination_by?` syntax will no longer force well-founded
recursion,
and instead the inferred `termination_by structurally` annotation will
be shown
if structural termination is possible.

While I was it, this fixes #4546 the easy way (log errors about but
otherwise
ignore incomplete `termination_by` sets for mutual recursion). Maybe we
get
multiple replacements (#4551), but even then this this good behavior.

Involves a bit of shuffling around `TerimationHints` (now validated for
a
clique already by `PreDefinition.main`) and `TerminationArguments` (now
lifted
out of the `WF` namespace, and a bit simplified).

Fixes #3909

---------

Co-authored-by: Richard Kiss <him@richardkiss.com>
2024-07-01 16:51:30 +00:00
..
Tactic feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
Attr.lean feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
Basic.lean feat: make frontend normalize line endings to LF (#3903) 2024-05-20 17:13:08 +00:00
Command.lean feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
Do.lean fix: missing atomic at match_expr parser (#3572) 2024-03-02 21:55:07 +00:00
Extension.lean feat: quotations for parser aliases (#4307) 2024-05-30 09:22:22 +00:00
Extra.lean fix: don't use info nodes before cursor for completion (#3778) 2024-04-02 08:49:24 +00:00
Level.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Module.lean feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
StrInterpolation.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Syntax.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Tactic.lean feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
Term.lean feat: termination_by structural (#4542) 2024-07-01 16:51:30 +00:00
Types.lean feat: custom error recovery in parser (#3413) 2024-02-21 14:29:54 +00:00