Repository navigation
BS-25: the LSE reader and printer as language-1.2 source (first slice of the lexicon, #269) - #445
Closed
humuhumu33 wants to merge 2 commits into
Closed
humuhumu33 wants to merge 2 commits into
humuhumu33 wants to merge 2 commits into
Conversation
…nter The first slice of the lexicon as source (#269): the row (register 478 -> 479, the §31 table, the RP-07 check and its case), the scenario, the §17.23 prose, the CHANGELOG entry, the README's claim, the CI part, and the case, conformance_bs_25, which holds LexiconLse.parseLse and printLse to lexicon::lse::parse and Lse::print on hand-built vectors that reach every error of the reader and the limit on nesting, on every signature and value of the committed lexicon entries, and on seeded expressions and edits, with 30 planted defects each named by its vector. VERIFICATION.md records the first run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bootstrap/src/LexiconLse.lex.tex: the tokenizer, the reader with its stack of open lists bounded by the depth argument, and the conversion with its work stack, each an iteration over an explicit state, so parseLse admits no recursion and states the oracle's first error to the byte; and printLse, the canonical printer with alpha-renaming, by structural recursion over the expression, its chains, and its universes. Lean verifies the module and the eligibility report gives each root exactly its declared effects. The entrypoint, the lock, the two export roots, and the project README follow. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
Landed in #480 (merge |
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.
Part of #269: the reader and the canonical printer of LexLean Semantic Expressions (
BS-25,lexicon/lse.rs:parseandLse::print) as language-1.2 source, with rootsparseLseandprintLseofLexiconLse. It is the first slice of the lexicon, and it stacks on nothing: the branch isrelease/v0.4after #415.Design
parseLsereads a text in the oracle's three phases, each an iteration over an explicit state: the tokenizer; the reader, with a stack of the open lists bounded by the depth argument, which reports the depth error apart from the syntax errors asParseErrordoes; and the conversion, with a work stack that visits a form's parts in the oracle's order (the function before its arguments, the binder headers of apiorlamlast to first, then the binder types, then the body) and builds the form when its parts are on the value stack. So the root admits norecursionand states the oracle's first error with its message to the byte. Every list of a sort's own values is a chain in the sort, so the data holds no nested inductive.printLsewrites the canonical text by structural recursion over the expression, its chains, and its universes, renaming bindersx0,x1, ... in printing order when asked, with the oracle's scoping (a binder's type before the binder enters the scope, aletentering its name before its type, value, and body). The scope check, the conservative checker, and the rendering expressions stay in the host.Evidence
Measured on the normative host on
release/v0.4at4dc5b803c:signature,value), evaluatorLean verifies the module on a copy of the project whose only entrypoint is
LexiconLse, and the eligibility report givesparseLseexactlyallocationandoverflowandprintLseexactlyallocation,overflow, andrecursion.The first run found one defect in the printer (a constant's universe list closed the list and not the constant) and one certificate rejection (the ID scanner's state as nested pairs tested as a condition; now a structure). VERIFICATION.md records them.
Gates at the head
cargo fmt --check,validate-model(479 IDs),validate-spec-links(479 rows), clippy on the workspace with-D warnings, and the 17 RP cases pass.CI is expected red until the regeneration
The
bootstrap/parse_lseandbootstrap/print_lsepackages are not committed.conformance_bs_25stops at the stack-bound step,bootstrap/parse_lse is no package of the committed exports, after the differentials above have agreed. The regeneration owes the lock, the two packages, the bootstrapexpected/records, the row ofprint_lseintests/stack-bounds.json, and the recount ofBS-05toBS-08andBS-13toBS-15, whose corpora grow with each committed package. It is queued on the normative host.🤖 Generated with Claude Code