Repository navigation
fix: reject malformed inductive entries in Kernel.Environment.replay - #16717
Merged
Merged
Conversation
This PR makes `Kernel.Environment.replay` (and thus `leanchecker`) reject an inductive type whose `all` or `ctors` field names something other than a stored inductive type or constructor, or whose `all` field does not contain the type itself, with an error instead of a panic. It also rejects stored inductive type metadata (such as `numIndices` or `isRec`) that differs from what the kernel generates. Previously, such entries either panicked via `[n]!` / `inductiveVal!`, or made `replay` skip the stored entry entirely, so a forged inductive could end up accepted by default-mode `leanchecker`. Fixes #16698, fixes #16688. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
nomeata
enabled auto-merge
November 24, 2026 16:16
4 tasks done
4 tasks done
nomeata
added a commit
to arthur-adjedj/lean4
that referenced
this pull request
Nov 24, 2026
Conflict resolutions: * Lean/Replay.lean: keep leanprover#16717's validated `InductiveVal`s and pass their feature flags to the kernel. * tests/elab/issue16698.lean: the forged `InductiveVal`s carry the feature flags instead of `isReflexive`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
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.
This PR makes
Kernel.Environment.replay(and thusleanchecker) reject an inductive type whoseallorctorsfield names something other than a stored inductive type or constructor, or whoseallfield does not contain the type itself, with an error instead of a panic. It also rejects stored inductive type metadata (such asnumIndicesorisRec) that differs from what the kernel generates.Previously, such entries either panicked via
[n]!/inductiveVal!, or madereplayskip the stored entry entirely, so a forged inductive could end up accepted by default-modeleanchecker.Fixes #16698, fixes #16688.
🤖 Generated with Claude Code