-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: termination arguments as Expr, not Syntax #3658
Merged
Merged
Conversation
This file contains 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
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):
|
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`.
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`.
Louddy
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`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
will-merge-soon
…unless someone speaks up
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
GuessLex
was passed furtheron as
Syntax
, to be elaborated later inWF.Rel
.This didn’t feel quite right anymore. In particular if we want to teach
GuessLex
about guessing more complex termination arguments likexs.size - i
, usingExpr
here is more natural.So this introduces
TerminationArgument
based on anExpr
to be used here.A side-effect of how the termination arguments are elaborated is that the unused
variables linter will now look at
termination_by
variables, 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.