feat(lean): RLE pattern parser for Conway Life (Epic #1647 Phase 2)#1996
Merged
Conversation
Adds Conway/Life/RLE.lean: a total parser for the standard Run Length Encoded pattern format used by LifeWiki / conwaylife.com. - parseRLE : String -> Except String Grid (handles comments, header, whitespace, run counts, b/o/$/!). - 4 flagship pattern constants with their RLE strings and parsed grids: glider, lwss, pulsar, gosper_gun (the 1970 Bill Gosper glider gun, 36 cells, period 30, first known infinite-growth pattern). - #eval sanity checks cross-verify lwss_parsed == lwss and pulsar_parsed == pulsar against the hand-written constants. - No sorry, no theorem (the parser is a pure computation; behavioural correctness is exercised via #eval isSpaceship / isOscillator). Verified locally: lake build Conway.Life.RLE SUCCESS, lake build Conway SUCCESS (3332 jobs), no warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jsboige
added a commit
that referenced
this pull request
Jun 1, 2026
…1996) Adds Conway/Life/RLE.lean: a total parser for the standard Run Length Encoded pattern format used by LifeWiki / conwaylife.com. - parseRLE : String -> Except String Grid (handles comments, header, whitespace, run counts, b/o/$/!). - 4 flagship pattern constants with their RLE strings and parsed grids: glider, lwss, pulsar, gosper_gun (the 1970 Bill Gosper glider gun, 36 cells, period 30, first known infinite-growth pattern). - #eval sanity checks cross-verify lwss_parsed == lwss and pulsar_parsed == pulsar against the hand-written constants. - No sorry, no theorem (the parser is a pure computation; behavioural correctness is exercised via #eval isSpaceship / isOscillator). Verified locally: lake build Conway.Life.RLE SUCCESS, lake build Conway SUCCESS (3332 jobs), no warnings. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Phase 2 of Conway Game-of-Life Epic #1647: RLE (Run Length Encoded) pattern parser.
New module
Conway.Life.RLEParser features
parseRLE : String → Except String Grid— handles comments (#...), header (x = W, y = H), digit run counts, payload charsb/o/$/!parseRLE!— total wrapper returning[]on errorsortDeduplTrimavoidsString.trimdeprecationNamed patterns (RLE + parsed grids)
glider_RLE/glider_parsedConway.Life.gliderlwss_RLE/lwss_parsed== Conway.Life.Spaceships.lwsspulsar_RLE/pulsar_parsed== Conway.Life.Oscillators.pulsargosper_gun_RLE/gosper_gunVerification (lean-merge-discipline HARD gate)
No theorems (parser is pure computation; correctness via
#eval).Follows #1975 (Spaceships + Oscillators, merged). Companion to #1989 (MacroCell + Hashlife).
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com