lean4-htt/src
Kim Morrison 2e779f79de
fix: bump numInstances for delayed grind theorem instances (#12176)
This PR fixes a bug where delayed E-match theorem instances could cause
uniqueId collisions in the instance tracking map.

The `uniqueId` for theorem instances is generated using `numInstances`,
but this counter was only bumped for immediately activated instances
(`.ready` case), not for delayed instances (`.next` case). This caused
ID collisions:

1. Theorem A matches, becomes delayed, gets `uniqueId = N`
2. Counter isn't bumped (stays at N)
3. Theorem B matches next, gets `uniqueId = N` (same!)
4. B's entry overwrites A's entry in `instanceMap`
5. A's tracking is lost

This manifested as `grind?` and `finish?` producing `instantiate approx`
(meaning "we couldn't determine which theorems to use") instead of
proper `instantiate only [...]` with specific theorem lists.

The fix bumps `numInstances` for delayed instances too, ensuring each
theorem instance gets a truly unique ID.

🤖 Prepared with Claude Code

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-28 03:09:27 +00:00
..
bin
cmake chore: fix spelling errors (#10042) 2025-08-22 07:23:12 +00:00
include/lean fix: avoid SIGFPE on x86_64 for ISize division overflow (#12110) 2026-01-27 19:36:07 +00:00
Init feat: add prefix and suffix map injectivity lemmas (#12108) 2026-01-27 22:54:16 +00:00
initialize feat: zero cost BaseIO (#10625) 2025-10-22 10:55:12 +02:00
kernel perf: Options.hasTrace (#12001) 2026-01-16 09:03:40 +00:00
lake fix: scope FamilyOut.fam_eq simp lemma to Lake namespace (#12178) 2026-01-27 04:24:08 +00:00
Lean fix: bump numInstances for delayed grind theorem instances (#12176) 2026-01-28 03:09:27 +00:00
LeanChecker feat: re-integrate lean4checker as leanchecker (#11887) 2026-01-08 09:41:33 +00:00
library fix: symbol name for native boxed declarations in the interpreter (#12095) 2026-01-21 20:38:29 +00:00
runtime doc: add link to reference manual in stack overflow message (#12157) 2026-01-26 07:56:48 +00:00
shell chore: tests: use filenames as test names (#11302) 2025-11-21 12:40:58 +00:00
Std feat: add Option.of_wp_eq and Except.of_wp_eq (#12161) 2026-01-26 12:50:23 +00:00
util perf: avoid allocation on lean_trace use in interpreter (#12036) 2026-01-18 19:33:48 +00:00
cadical.mk
CMakeLists.txt chore: begin development cycle for v4.29.0 (#12169) 2026-01-26 23:31:37 +00:00
config.h.in
githash.h.in
Init.lean feat: add Sym.Simp.evalGround simproc (#12031) 2026-01-17 05:13:12 +00:00
lakefile.toml.in feat: re-integrate lean4checker as leanchecker (#11887) 2026-01-08 09:41:33 +00:00
lean-toolchain
Lean.lean refactor: move error explanation text to the manual (#11688) 2025-12-26 17:14:58 +00:00
lean.mk.in chore: further split libleanshared on Windows to avoid symbol limit (#10136) 2025-08-26 16:01:57 +00:00
Leanc.lean fix: Unicode path support for Lean Windows executables (#10133) 2025-08-27 11:28:55 +00:00
LeanChecker.lean feat: re-integrate lean4checker as leanchecker (#11887) 2026-01-08 09:41:33 +00:00
out feat: ac normalization in grind (#10146) 2025-08-27 03:28:30 +00:00
Std.lean chore: more module system fixes and refinements for finishing batteries port (#10819) 2025-10-21 08:19:50 +00:00
stdlib.make.in feat: re-integrate lean4checker as leanchecker (#11887) 2026-01-08 09:41:33 +00:00
stdlib_flags.h chore: remove comment from wrong stdlib_flags.h (#11646) 2025-12-12 22:59:38 +00:00
version.h.in