Skip to content

V-CNF2: one Lean theorem from cnf-check + LRAT to no default-Φ layout - #129

Merged
rollrat merged 4 commits into
masterfrom
claude/fastopt-cnf-grounding-2
Dec 6, 2026
Merged

rollrat merged 4 commits into
masterfrom
claude/fastopt-cnf-grounding-2

Conversation

@rollrat

@rollrat rollrat commented Dec 6, 2026

Copy link
Copy Markdown
Member

Follow-up to #125. The CNF grounding check is now one Lean theorem chain.

  • CnfCompose.lean: proves check_sound (through resolve_sound and families_sound) and no_valuation_of_lrat. The checker was rewritten functionally; its behaviour is unchanged.
  • CnfPhi.lean:
    • decl_hold and early_hold show that PhiSol layouts satisfy the declaration families and the early families.
    • no_phi_layout_of_lrat_wf is the end-to-end theorem: cnf-check ok, plus Inst.wf, plus LRAT.check give no default-mode PhiSol layout within budget b.
  • Remaining assumptions:
    • LateHold: the three Feeds-reading rule families hold for the layout.
    • Vocab: signal classes and the mirror lex-leader.
    • The compiled checker.
    • That dimacsCnf matches parseDimacs (argued).
  • Stricter checks: Report.ok now requires a strict final match, a well-founded meaning table and that dead tuples stay dead.
  • Measured: all 7 dumps still ALL ACCEPTED; 8/8 mutants rejected.

Docs: docs/cnf_grounding_check.md §4 and §7. No sorry or native_decide; 11 Audit guards.

🤖 Generated with Claude Code

rollrat and others added 4 commits December 6, 2026 20:18
Bring in OptCheck, Dimacs, the L2 library and the mirror-trust work before the V-CNF2 commit; conflicts in RedstoneFormal.lean, Audit.lean, lakefile.toml and exact/mod.rs keep both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intent: turn the argued glue of V-CNF (section 4 of cnf_grounding_check.md) into one Lean theorem chain, so a cnf-check verdict plus an LRAT refutation says something about Phi layouts instead of about an unverified imperative loop.

- CnfCheckLib: the checker is rewritten functionally (foldl over families, cardFold/tagAtMost, acceptKey/finalVerdict). Behaviour is the same on the 7 dumps. Report.ok now also requires a strict final match, a well-founded meaning table, dead tuples staying dead and no literal 0. needLit rejects literal 0.
- CnfCompose (new): meaning assignment asg, resolve_sound, the family-loop invariant, check_sound, and no_valuation_of_lrat (check ok + LRAT.check ok => no valuation satisfies the regrounded families).
- CnfPhi (new): the valuation nuOf of a layout and the vocabulary restriction Vocab. decl_hold and early_hold prove that every family that reads no Feeds relation holds for a PhiSol layout within the budget. late_live drops dead tuples safely. no_phi_layout_of_lrat(_wf) is the end-to-end statement in the LRAT-certificate shape.
- Remaining assumptions: LateHold (the Feeds-reading families), Vocab, and the compiled checker.
- cnf-check prints Inst.wf and includes it in its exit verdict.
- Audit guards are added for the new theorems.
- Measured: all 7 dumps are still ALL ACCEPTED at the same times, and 8 of 8 sign-flip mutants are rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	formal/RedstoneFormal.lean
#	formal/RedstoneFormal/Audit.lean
#	formal/lakefile.toml
#	src/transform/place_and_route/local_placer/exact/mod.rs
Intent: keeping both sides of the mod.rs conflict declared the module twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rollrat
rollrat merged commit 4b36e77 into master Dec 6, 2026
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