lambdaclass / lambdaclass/lambda_compiler_kit
refactor: eliminate decreasing_by in Parser.lean in favour of structural recursion
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Problem
Lck/Regex/Parser.lean at lines 646 and 912 uses decreasing_by to convince the termination checker. Per CLAUDE.md, decreasing_by is a code smell for parsers — a well-structured LL(1) parser over a token list should terminate structurally.
Expected fix
Restructure the affected parsing functions so that recursive calls are made on a syntactically smaller token list, allowing the Lean termination checker to accept them without decreasing_by. If this turns out to be infeasible, document why with a comment.
References
- Observed by AI code review on PR #9
- See CLAUDE.md termination discipline
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Lck/Regex/Parser.lean and inspect the parsing code at lines 646 and 912, then read the termination guidance in CLAUDE.md. Determine whether the affected recursive calls can use structurally smaller token lists; done means both uses of decreasing_by are removed, or an explanatory comment documents why restructuring is infeasible.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100