Skip to content

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

Merged
nomeata merged 2 commits into
masterfrom
joachim/hasBadParamDep
Jul 7, 2024
Merged

nomeata merged 2 commits into
masterfrom
joachim/hasBadParamDep

Conversation

@nomeata

@nomeata nomeata commented Jul 6, 2024 •

Copy link
Copy Markdown
Collaborator

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
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Jul 6, 2024
ghost pushed a commit to leanprover-community/mathlib4 that referenced this pull request Jul 6, 2024
@ghost

ghost commented Jul 6, 2024 •

Copy link
Copy Markdown

Mathlib CI status (docs):

@ghost ghost 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
ghost pushed a commit to leanprover-community/batteries that referenced this pull request Jul 7, 2024
ghost pushed 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
@nomeata
nomeata deleted the joachim/hasBadParamDep branch July 7, 2024 16:58

This branch was previously deployed

1 inactive deployment
lean-lang.org/lean4/doc — d026a2ce Deployed Jul 7, 2024 by github-actions[bot]
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?

1 participant