Skip to content
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

fix: hasBadParamDep? to look at term, not type #4672

Merged
merged 2 commits into from
Jul 7, 2024

Conversation

nomeata
Copy link
Collaborator

@nomeata nomeata commented Jul 6, 2024

The previous check, looking only at the type of the parameter, was too permissive and led to ill-typed terms later on.

This fixes #4671.

In some cases the previous code might have worked by accident, in this sense this is a breaking change. Affected functions can be fixed by reordering their parameters to that all the function parameters that occur in the parameter of the inductive type of the parameter that the function recurses on come first.

@nomeata nomeata changed the title fix: hasBadParamDep? to look at term, not type fix: hasBadParamDep? to look at term, not type Jul 6, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 6, 2024 14:01 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 6, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 6, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jul 6, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Jul 6, 2024

Mathlib CI status (docs):

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jul 6, 2024
@nomeata nomeata marked this pull request as ready for review July 7, 2024 10:21
@nomeata nomeata added the will-merge-soon …unless someone speaks up label Jul 7, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 7, 2024 10:35 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jul 7, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jul 7, 2024
@nomeata nomeata enabled auto-merge July 7, 2024 15:59
@nomeata nomeata added this pull request to the merge queue Jul 7, 2024
Merged via the queue into master with commit f36bbc8 Jul 7, 2024
15 checks passed
@nomeata nomeata deleted the joachim/hasBadParamDep branch July 7, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN will-merge-soon …unless someone speaks up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

structural recursion: inductive parameters after varying function parameters?
2 participants