Repository navigation
#116: a production root's overflow effect discharged by a kernel-checked bound (PD-09, SP-31; RB-23 red) - #295
humuhumu33 wants to merge 66 commits into
Conversation
…he overflow bound (#116) The R3 skeleton of #116 (L3.3 of #106): a production root's overflow effect discharged by a kernel-checked bound. One row per layer, each with its scenario and its conformance test, which fail because no case is wired: PD-09 (the bound, its generated statement, the discharge and its diagnostic), SP-29 (certificate A's rows bounded and root_value), RB-20 (the rendering without checks). The register total moves to 446; sibling sessions add rows on the same line, so the numbers may move on rebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kernel-checked bound (#116) A root may name a bound, production: {bound: T, …}, a prior theorem of its module whose statement linking generates: under x < 2^64 for each natural parameter, every addition and multiplication of naturals of the root's own body is below 2^64, a conjunction in evaluation order with every let substituted (ir/semantic/bound.rs; LLT4017 for a theorem stating another obligation or a construct the rule does not read). Eligibility drops overflow from what it requires of the root exactly when every source of the effect is a covered construct of the root itself, and the report records the bound. Certificate A proves bounded, that the width predicate holds on every argument in the width, from the theorem applied to the parameters, reading the predicate through Bool.and_eq_true_iff, Nat.blt_eq and let instantiation, and root_value, root rewritten with bounded (certificate/data_a/bound.rs). The pinned Lean checks both on Coverage.Bounds.maxOfThree, the new corpus root of production-coverage. The semantic-module schema gains the member, which moves the language-1.2 compiler-semantics ID: every lock, fixture expectation, golden build and verification record is regenerated, except uor-atlas's, which is not. RB-20 stays red: the Rust machine has no unchecked operation certificate B's correspondence covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # VERIFICATION.md
…f_25 (#291, R3 skeleton) The language-1.2 simplify proof form may name the leading premises of its goal, introduce them, and add them to its closed simp only set, so that a prior theorem whose rewrite holds under a condition rewrites where a named hypothesis discharges the condition. The case builds a module in the shape of UOR-Foundation/mcp#24's UTF-8 lead-byte classes (Table 3-7, E1..EC): a step lemma conditional on the lead byte's class, the zero test of the row's conditional, and the composed statement. It fails on this commit: the schema has no `hypotheses` member. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`simplify` gains `hypotheses`, names for the leading premises of the goal. It lowers to `intro h1 … hn` and then `simp only [h1, …, hn, d1, …]`, so a prior theorem whose rewrite holds under a condition rewrites where a named hypothesis discharges that condition. The rule set is still exactly what the source names. Linking (LLT4001) refuses hypotheses where the goal is not the theorem's statement (only the proof itself and branches of cases and induction carry it), more names than the goal's leading implications, a name already in scope or repeated (a hypothesis cannot also be named among the definitions), and the form under language 1.1. A theorem whose hypotheses do not discharge a rule's condition is rejected by Lean (LLV7002). The semantic-module and snapshot schemas gain the optional member, and semantic_ir moves 15 -> 16 and proof_lowering 3 -> 4: the language-1.2 compiler-semantics ID moves. The records are regenerated in the next commit. SPEC §17.12 gains the row of the form (through `cargo xtask spec`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fy-hypotheses # Conflicts: # CHANGELOG.md
…e-116-overflow-bound CHANGELOG keeps both sides, the line first; VERIFICATION auto-merged. README counts 448 registered IDs (AU-14 and RP-17 landed on the line); SPEC.md takes the line and is regenerated by validate-model --write. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The lead-byte module verifies with its exact policy; the ED variant is rejected by Lean (LLV7002, `simp` made no progress); the forged policy is refused (LLV7005); the hypotheses dropped from the simp set, the ED variant made true, and the forged policy made the observed one each turn conformance_pf_25 red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…generated by the writers The semantic-module and snapshot schemas gain `simplify.hypotheses`, and semantic_ir and proof_lowering move to 16 and 4, so the language-1.2 ID moves from 5262e5b4... to 583ff8e2.... The ID was substituted, then check-golden, check-calculus, check-production-export, check-fixtures and verify-examples (without uor-atlas) rewrote their records; every example, compiler, stdlib and bootstrap verified under the new compiler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…otheses # Conflicts: # CHANGELOG.md # VERIFICATION.md
… the merge The schema identity move (language-1.2 ID 50c7b59d) had left the committed calculus (compiler/rust) and production-export packages on the previous ID, which failed gc_01, gn_01, rb_02..05, rb_07 and sl_01/02/07 on the PR head. Rewritten by check-calculus --write and check-production-export --write. SPEC.md is the projection of spec/src (validate-model --write). The Atlas records are not regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README takes the line and counts 450 registered IDs (PC-01, PC-02 landed); the PD, RB and SP rows end at PD-09, RB-20 and SP-29. SPEC.md and spec/lexlean.lock take the line and are regenerated in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge of #288 kept its count of 445 in the generated total; the register has 446 rows. Regenerated by validate-model --write. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rated records after merging #289 The language-1.2 compiler-semantics ID of this branch (50c7b59d) differs from the line's, so spec/lexlean.lock, examples/performance-corpus/lexlean.lock and expected/, the golden, fixtures, calculus and production export are rewritten by their writers; verify-examples --write ran without the Atlas. SPEC.md is the projection of spec/src. The Atlas records are not regenerated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Merged RB-20 remains red by design. It fails where it failed before, Commits on top of
Numbers: PD-09, SP-29 and RB-20 are still free on the line, so nothing is renumbered. The register is 450 (PC-01, PC-02 and RP-17 landed). README's count says 450, and its PD, RB and SP rows end at PD-09, RB-20 and SP-29, which RP-11 had refused on the old head. Run locally, all green: Not verified: the Atlas ( |
…otheses # Conflicts: # README.md # SPEC.md # VERIFICATION.md # spec/lexlean.lock
|
Maintainer: the RB-20 route is ruled on #116 (comment above this one in time): your shape, no new correspondence rule ( Generated by Claude Code |
|
Generated by Claude Code |
|
Generated by Claude Code |
Renumbers this branch's rows past the line's: SP-29 becomes SP-31 and RB-20 becomes RB-23 (the line's SP-29, SP-30 and RB-20..RB-22 are the std runtime, the refinement statements and the loop ends); PD-09 and LLT4017 stay. The register is 481. Chapter 17 keeps the line's text with the Bounds paragraph and the certificate A paragraph re-inserted; the semantic-module schema keeps the line's proof kinds and this branch's `bound` member. Locks, calculus, production export, fixtures and golden are regenerated; the verification records are not yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3QZQru5a9Beo3r4Rfa
The merge moved the language-1.2 compiler-semantics ID; the records of every example but uor-atlas (compiler, bootstrap, stdlib, kappa, spec, the corpora) are rewritten by `cargo xtask verify-examples --write`, with the bdd part registry naming SP-31 where it named SP-29. The Atlas records are not regenerated here; the maintainer joins them from the CI artifacts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3QZQru5a9Beo3r4Rfa
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3QZQru5a9Beo3r4Rfa
…CATION.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3QZQru5a9Beo3r4Rfa
The head is #303's with its reviewed follow-up cd0c6b7 (fix/pf25-source-contract). PF-25 and PF-26 are claimed on release/v0.4 (#507), so simplify hypotheses are registered as PF-28. The schemas and the semantic IR keep both lines' proof forms; semantic_ir and proof_lowering move to 17 and 5. Generated outputs are release/v0.5's, rewritten by the landing regeneration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The landing regeneration writes every generated output again; the ones this branch committed were made on its old base. rust_renderer records the merged renderer sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The SPEC.md text of this branch is written into its chapter module, at the machine family release/v0.5 leaves free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The canonical graphs move the ID to 8c54fe7b15d5ddf9ff9848559747031aaf161e3793ffa932e46c63e6df475972; written by `just relock-identity`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Update joins the primitives nat_bitwise_function maps to None (the match v0.5 added), the merge marker left between refines theorems in RustStd is removed, and rust_runtime_std is written by `cargo xtask semantics-records --write` (#545). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
check_simplify_hypotheses gets its Ok tail back, the nested-induction member branches v0.5 added pass no goal (a member's motive is not the statement), and the inert Simplify arm of proof_binders is dropped for the one that visits the hypotheses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The line's PD-10, SP-32, SP-33 and RB-24 keep their numbers; PD-09 and SP-31 are added beside them (register 523). RB-23, the rendering without checks, is withdrawn with its row, scenario and test and tracked in #546, so the landing carries no red case. Chapter17's Bounds and certificate-A paragraphs are ported onto the line's module (cargo xtask spec port); the two schema members are added to the line's schemas; generated outputs are the line's, to be regenerated on runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
|
I merged release/v0.5 (6c36829) into this branch (febfe91). PD-09 and SP-31 keep their numbers, so the register is 523. Decision: the RB-23 row, its scenario and its test are withdrawn from this PR and tracked as #546, which follows the #116 ruling. That way the bound lands without a red case. Next step is regeneration on runners (atlas included) in the v0.5 identity order. Generated by Claude Code |
The write recipes of SPEC.md §9.2, run by regenerate.yml (https://github.com/UOR-Foundation/lexlean/actions/runs/43649832487), rewrote 5502 paths. The counts writer reported: BS-05 SEEDED_REFUSED_VALIDATE: 273 -> 275 (crates/conformance/src/cases/bootstrap/rust_validate.rs) BS-05: §31 row: nothing BS-05: the §31 row does not state 273 (-> 275) BS-05: register: nothing BS-05: scenario: nothing VERIFICATION.md rows for the landing (counts | before | after): | `BS-05` SEEDED_REFUSED_VALIDATE | 273 | 275 | wrote /home/runner/work/lexlean/lexlean/CONFORMANCE.md and /home/runner/work/lexlean/lexlean/ERRORS.md written, with SPEC.md and the model projected again; next: the parts without LEXLEAN_COUNTS
…olation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
|
The current split is recorded: febfe91 carries PD-09/SP-31 preparation; #546 retains the unimplemented rendering half. #116 must remain open because its accepted condition requires both bound-based admission and rendering without overflow checks, with bound removal restoring both. Withdrawing the red RB-23 registration does not deliver that condition. The PR body still describes the older 482-row tree, RB-23 registered/red and older regeneration. Please replace it with the current523-row, partial-scope status and link #546. The concrete blocker is the missing exporter commit d54dbf8 needed to reconstruct the preservation library from ba52c60; the existing owner should establish recoverable exporter/source provenance before scheduling that work. Keep the existing v0.5 identity order and reuse valid completed evidence; no competing implementation or new regeneration is requested here. |
…-core The byte update moves the ID to cddcb1b0bef5b765fcabe89be5e25ef0ec8a3b736049f058c782adb3df03be6f and the rust-core descriptor to 4bf56bf9 (the renderer record moves). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The semantics records take #443's renderer and std runtime with this change's semantic_ir 17; README counts both landings (523). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The simplify hypotheses move the ID to a29ba62ccdf8f7200ddc7bcffd4a54d61bf1dd12f1e00a1ff866e51ffac848b6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The isolated decimal formatting no longer reaches Classical.choice or Quot.sound, so the exact policy of the production-coverage root follows (LLV7005 on regeneration). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The two schema members merge structurally; README counts the four landings (525). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The bound moves the ID to 34c00a49680f97a55738be3bb48f549ddc6c785c3549dfd4596557ea2522f83b. The two production-bound fixtures, locked under this branch's earlier ID, are relocked too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Its lock came from #441 under that change's ID and was skipped by the relock (LLC0102 in fixtures-write). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
…ge-1.2 ID Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
…ge-1.2 ID Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The merge took the line's lock, whose project_config_sha256 predates the Bounds module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
…ge-1.2 ID Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Implements #116 (L3.3 of #106): the
overfloweffect of a production root is discharged by a kernel-checked bound. Draft againstrelease/v0.5; commits follow R3 (rows, scenarios and failing tests first, then the implementation).Rows (renumbered on the forward merge).
PD-09(production: the bound, its statement, the discharge, the diagnostic),SP-31(preservation: certificate A'sboundedandroot_value; wasSP-29, which the line now uses for the std runtime refinement),RB-23(rust-backend: the rendering without checks, registered and red, see below; wasRB-20, now the std runtime on the line), and the errorLLT4017. The register is 482 (the line's 479 with KA-04, plusPD-09,SP-31,RB-23); README's count and its PD, RB and SP ranges say so (RP-11).The rule. A production root may name a bound,
production: {effects: E, targets: T, bound: B}, whereBis a prior theorem of the root's module whose statement is exactly the obligation linking generates from the root, compared as the model obligations of §17.12 are: underx < 2^64for eachnatparameter, every addition and multiplication of naturals of the root's own body is below 2^64, a conjunction in evaluation order with everyletsubstituted. The rule reads the body throughlet, parameters, literals,+, and the total subtraction, quotient and remainder of naturals, and nothing else; an operation under a match, a conditional or a lambda, in a callee, a successor, or an integer operation is not covered, and a bound over such a body, or a theorem stating another obligation, isLLT4017naming the construct. Eligibility then dropsoverflowfrom what it requires of the root exactly when every source of the effect is a covered construct of the root itself (elseLLT4017), and the report records the bound. Certificate A gainsbounded : ∀ x, x < 2^64 → … → __fits_0 x = true, built from the theorem applied to the parameters, androot_value,rootrewritten withbounded, so the lowered program converges to the root's value on every argument in the width. Nothing is inferred by an optimizer or checked at run time: linking and eligibility can only refuse, and what admits the discharge is the theorem the pinned Lean checks and the rows the kernel checks against the predicate (a wrong statement linking accepted leavesboundedill-typed,LLV7013).Corpus intent (#124).
examples/production-coverage/src/Bounds.lex.tex:Coverage.Bounds.maxOfThree (a b c : Nat), the maximum of three naturals by widening subtraction, two additions, withmaxOfThree_boundbylinear_arithmetic. Admitted onrust-coreandrust-stdwithoutoverflow.Plants (recorded with real output in VERIFICATION.md): the bound removed →
LLT4005; narrowed or reordered →LLT4017; an integer multiplication under an unreadlet→LLT4017; the two negative fixturesproduction-bound-inexactandproduction-bound-uncovered→LLT4017; the bound forged →checkpasses,verifyfailsLLV7002; plus two defects found while building (LLI9001,LLV7005).Red, explained:
RB-23. Registered with its scenario and test;conformance_rb_23fails as "no Rust backend case is wired for RB-23" (rust_backend.rs:1620). The route is ruled on #116 (plain infallible runtime items, no new correspondence rule, a structural armed SP-07 exception,overflow-checks = truein the generated profiles). It is not implemented in this update: it needs newItemconstructors (natAddPlain,natMulPlain) and plainMachineconstructors, and on this line the preservation library (language/preservation-1.2/library/src/*.lex.tex,RustLemmasabout 295,000 lines) is a kernel-DAG export whose terms nameItem.casesOnandMachine; adding constructors means re-elaborating it from Lean sources that predate the line's later grafts, with an exporter commit (d54dbf855) that is not in the repository. Until then the rendering of a bounded root is unchanged (R<T>and?stay) and the package'seffectsomitoverflow, as §17.16 allows for an export whose realization never reaches a failure. Becauseconformance_rb_23is in therestpart, the draft'srestleg stays red on that one test.Identity move.
schemas/semantic-module-v2.schema.jsongains the optionalboundmember (left out of the canonical form when absent, so every earlier module keeps its bytes);schemas/is hashed into the language-1.2 compiler-semantics ID, so the ID moved. Regenerated after the merge ofrelease/v0.5ated549c24f: everylexlean.lockthe move stales (the lock fixtureslock-schema-language-mismatch*andpackage-language-mismatchexcepted, as they were),validate-model --write,check-calculus --write,check-production-export --write,check-fixtures --write,check-golden --write, andverify-examples --writefor every example exceptuor-atlas, which was NOT regenerated (its jobs will be red until the maintainer joins its records).Forward merges. Two merges of
release/v0.5by merge commit (fd14c6252, thened549c24fwith KA-04). Conflicts were in generated files (taken from the line and regenerated), inChapter17(the line's text with theBoundsand certificate A paragraphs re-inserted, nodes renumbered), the schema (the line's proof kinds plusbound), theIds*rows and scenarios,CHANGELOG.md(both sides kept) andREADME.md.Gates run here (Linux x86-64, Lean 4.32.1):
validate-model(482 ids, 87 codes),validate-spec-links,check-calculus,check-production-export,check-golden,check-test-inventory,cargo fmt --check,cargo clippy --workspace --all-targets --all-features -- -D warnings, andconformance_rp_11,pc_01,pd_09,ka_04,sp_31,ex_07green;conformance_rb_23red as stated.check-fixtureswas run with--writebefore the second merge (which touched only the kappa project) and not re-run after it.just vvas a whole was not run here.🤖 Generated with Claude Code
https://claude.ai/code/session_013Asa3QZQru5a9Beo3r4Rfa