Repository navigation
refactor: termination arguments as Expr, not Syntax - #3658
Merged
Merged
Conversation
This introduces the `ArgsPacker` module and abstraction, to replace the
exising `PackDomain`/`PackMutual` code. The motivation was that we now
have more uses besides `Fix.lean` (`GuessLex` and `FunInd`), and the
code was spread in various places.
The goals are
* consistent function naming withing the the `PSigma` handling, the
`PSum` handling, and the combined interface
* avoid taking a type apart just based on the `PSigma`/`PSum` nesting,
to be robust in case the user happens to be using `PSigma`/`PSum`
somewhere. Therefore, always pass an `arity` or `numFuncs` or
`varNames` around.
* keep all the `PSigma`/`PSum` encoding logic contained within one
module (`ArgsPacker`), and keep that module independent of its users
(so no `EqnInfos` visible here).
* pick good variable names when matching on a packed argument
* the unary function now is either called `fun1._unary` or
`fun1._mutual`, never `fun1._unary._mutual`.
This file has less heavy dependencies than `PackMutual` had, so build
parallelism is improved as well.
|
Mathlib CI status (docs):
|
nomeata
force-pushed
the
joachim/termination-elab2
branch
from
March 12, 2024 18:27
4e43c7e to
7b27e40
Compare
nomeata
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 14, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now.
mathlib-bors Bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 14, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
nomeata
enabled auto-merge
March 14, 2024 16:47
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Mar 14, 2024
nomeata
enabled auto-merge
March 14, 2024 23:13
dagurtomas
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 22, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
utensil
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Mar 26, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
xgenereux
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 15, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
uniwuni
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 19, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
callesonne
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 22, 2024
this will break once leanprover/lean4#3658 lands, so let's fix this now. Also avoids binding unused variables in `termination_by`.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before, the termination argument as inferred by
GuessLexwas passed furtheron as
Syntax, to be elaborated later inWF.Rel.This didn’t feel quite right anymore. In particular if we want to teach
GuessLexabout guessing more complex termination arguments likexs.size - i, usingExprhere is more natural.So this introduces
TerminationArgumentbased on anExprto be used here.A side-effect of how the termination arguments are elaborated is that the unused
variables linter will now look at
termination_byvariables, and that parameterspast the colon are not even invisibly in scope, so
‹_›will not find themSee https://github.com/leanprover-community/mathlib4/pull/11370/files for examples
of fixing these changes.