Skip to content

fix: replay String.ofList and Char.ofNat first in Kernel.Environment.replay - #15853

Merged
hargoniX merged 1 commit into
masterfrom
joachim/replay-string-lit
Oct 22, 2026
Merged

hargoniX merged 1 commit into
masterfrom
joachim/replay-string-lit

Conversation

@nomeata

@nomeata nomeata commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

This PR makes Kernel.Environment.replay add String.ofList and Char.ofNat (if present) before any other constant. The kernel unfolds string literals to String.ofList [Char.ofNat n, …], but these constants are not syntactic dependencies of a declaration that reduces a string literal. So replay, which orders declarations only by their syntactic dependencies, could check such a declaration first and wrongly reject it, for example

theorem t1 : "abc" ++ "def" = "abcdef" := by decide

(reported via comparator, where both leanchecker --from-export and lean4lean reject it).

Exports without these constants still replay as before.

🤖 Generated with Claude Code

…ment.replay`

This PR makes `Kernel.Environment.replay` add `String.ofList` and `Char.ofNat` (if present) before any other constant. The kernel unfolds string literals using these constants, but they are not syntactic dependencies of a declaration that reduces a string literal, so replay could check such a declaration before they were added and wrongly reject it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nomeata
nomeata requested a review from hargoniX October 21, 2026 18:03
@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 Oct 21, 2026
@hargoniX
hargoniX added this pull request to the merge queue Oct 22, 2026
Merged via the queue into master with commit 94e0a0e Oct 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-other toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants