spec(port): gen_w391_lean as .t27 - #6267
Merged
Merged
Conversation
…loses #6216) Same shape as the W388 port (#6211): the decisions behind the generated Lean text as pure integer functions. The W391 parameters are tested: a 69-variable plus chain, a 68-variable minus chain, an odd depth-51 cancellation, a 26+1+26 zero weight closure (53 steps). All 69 variable names are asserted against the original var_names. The helpers are written in a different form from gen_w388_lean.t27 so that the dupe-ratchet (tools/dupe_scan.py) reports no new duplicate body. Checked with t27c from this tree and Zig 0.16.0: typecheck OK, spec-status IMPLEMENTED, gen 253 lines with no "not yet implemented", test-report 13/13. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 4, 2026
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.
Closes #6216
Adds
specs/port/scripts/gen_w391_lean.t27, the port ofscripts/gen_w391_lean.py. One file, nothing else. Same approach as the merged W388 port (#6211):str + strdoes not compile in t27, so the decisions that shape the Lean text are ported as pure integer functions, andtheorem_blockandmainkeep their names withundefined;bodies.W391-specific behaviour tested: 69-variable plus chain, 68-variable minus chain, depth-51 cancellation (odd, so the rhs keeps one plus MAC), zero-weight closure of 26 + 1 + 26 = 53 steps. All 69 variable names (packed ASCII codes) are asserted against the original
var_names; all seven keywords are tested as skipped.The helpers are written differently from
gen_w388_lean.t27on purpose: cross-module reuse does not work yet (#4298), andpython3 tools/dupe_scan.pyreports a new duplicate body for a byte-identical copy.Checks from this branch with
t27cbuilt from the same tree and Zig 0.16.0:t27c typecheck: OKt27c spec-status: IMPLEMENTEDt27c gen: 253 lines, 0 xnot yet implementedt27c test-report: 13 tests, 13 pass, 0 BLOCKEDpython3 tools/dupe_scan.py: ok, no new duplicate bodyNot checked: CI result is pending.
coverageandspec-guardswere already red on #6251 because of stale seals ofspecs/automation/kanban-card-chat.t27andspecs/runtime/process.t27, which this PR does not touch.🤖 Generated with Claude Code