Skip to content

BS-52: the conservative checker of LSE expressions as source (#269) - #524

Draft
humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-269-lse-types-r2
Draft

humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-269-lse-types-r2

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Third slice of the lexicon closure of #269. bootstrap/src/LseTypes.lex.tex holds checkSignature and checkValue to lse::check_signature and check_value: the zonked type and every literal's type, or the first error, with the oracle's metavariable numbering and capture-avoiding renames. The lookup closure is handed over as rows plus a fallback (Missing for a closure, Opaque for a package as it loads). Each recursive definition is structural over a chain built from a nesting bound the host passes (192), so both roots admit recursion.

Rust-backend limitation found (no Rust changed here). A definition that calls itself as its last step is rendered as a loop whose exit wraps a tail call to another fallible definition in Err(..) without propagating its overflow, which the validator refuses with LLB6005. The module works around it: inferBinding, inferRest and unifyPiLoop bind their own recursive call and rebuild the record. A fix belongs in calculus/rust/lower.rs.

Case (conformance_bs_52, run on WSL over 26e5e0ace). 39 named vectors over a hand-built glossary, the signatures and defined values of the 43 committed packages that load (224 signature and 236 value runs, each checked against its own package and against the builtins), and seeded expressions. The evaluator agrees on 899 runs and rustc on 3,499; all 20 planted defects are detected.

Regenerated. 8911e442f2 applies regenerate.yml run 43335583294 (base 8fa301f907): the export with LseTypes' two packages and their stack bounds, the oracles, the verify records, and the counts (manifests 330 -> 332). Two commits before it: max_child_output_bytes = 268435456 (the maintainer's decision), and the axioms Lean observes on 21 definitions (LLV7005 in run 43316854893) with pair flags read through definitions. Ready for the parent's batch landing; it stays a draft.

🤖 Generated with Claude Code


Supersedes #502 (rebuilt onto release/v0.4 after RB-24 moved the compiler-semantics ID; the old branch and PR are left untouched).

humuhumu33 and others added 3 commits November 13, 2026 17:55
LseTypes holds checkSignature and checkValue to lse::check_signature and
check_value: the zonked type and the type of every natural literal, or the
first error, with the oracle's metavariable numbering and capture-avoiding
renames. The lookup closure is handed over as rows and a fallback (Missing
for a closure, Opaque for a package as it loads). Each recursive definition
is structural over a chain built from a bound on nesting the host passes, so
both roots admit recursion. 20 planted defects are each detected by their
own vector.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…definitions

Regeneration run 43316854893 stopped on LLV7005: 21 definitions that reach the
standard library's numerals observe Quot.sound and propext; they now declare
them. Conditions on a component of a pair go through flagOf and typedCk, the
shape BS-50's certificate needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant