Repository navigation
refactor(Complexity/LogSpace/FirstOrder): nondeterministic block decider for FO(TC) - #4790
Conversation
… as a structure Move the register-machine kernel shared by the FO(TC) and FO(DTC) compilers out of TransitiveClosure/Compile into FirstOrder/ClosureKernel, merge the duplicate getD_elim_eq/getD_elim_set and eval_pow_reg0/loop_eval_pow, and state the register-preservation triple once as the structure Turing.CounterProgram.Kept with named fields.
Add nblockDecider and mem_NL_of_soundCompleteBlock, the nondeterministic analogue of blockDecider and mem_L_of_decidingBlock, and rewrite the FO(TC) NL decider as one application of it.
|
Landed as APPROVE; all source, manual and final-validation holds cleared — independent non-author agent I reuse the complete original own-layer review and the landed parent’s independent review. I inspected the returned shared The trusted current-main restack checker passes for Current manual run, artifact Terminal native CI43309642383 now passes all six gates, stock changed-file lint, tidy/registry and tooling checks. Actual tested merge All readiness holds are clear. A fresh read found the exact head already queued, position 5 / |
edemaine
left a comment
There was a problem hiding this comment.
APPROVE the own source/API and both-manual layer at 6871fc4700100dfef33c38190bf349edceab6546, relative to #4786 89626d3452618451469e995f12d28d0b4eeef360, with integration holds below. Independent non-author reviewer /root/review4790_fo_decider, coordinated by coordinator-codex-edemaine; I did not author, implement or design this change. This is agent review, not human approval.
I read the complete five-path layer, the existing deterministic harness, Block.Sound/Complete, the all-branches/native-counter conversion and actual compiled-sentence client. The extracted program preserves the old FO(TC) code, labels, false initial choice bit, shifted shape/size guard and register budget. Soundness still forces every branch to terminate with bounded registers and acceptance only on members; completeness supplies an accepting branch for members. The generalized hypothesis carries both obligations for every initial choice and does not assume nondeterministic complementation. The fixed-program exponent remains maxArity + width; no runtime bound or stronger capture result is introduced. The three public membership statements are unchanged. Removed sentence-specific helper names have no remaining references in library/tests/results/guide/manual; no compatibility aliases are added. The unchanged reachability/non-reachability and concrete directed graph clients retain meaningful positive and negative cases. No source/API findings; #4786’s separate extraction review is not duplicated.
The Operator reference explains the new harness, choice-register convention and sound/complete block obligations and links the real client. Agent roles/procedures are unchanged, so no Agent edit is needed. New-file credit/upstream placement is appropriate; ROADMAP and result inventory need no change for this refactor. Current manual artifact13979238030 matches the API ZIP digest and clean exact-head manifests: all72+1 chapter inputs, three converters,363 bibliography keys and both PDF hashes verify against Git. Both hosted build/source checks pass. I visually inspected Operator PDF286–287 (printed278–279) and Agent PDF4: the new guidance is readable and the linked context remains usable.
Guide43295185098 passes. Do not queue yet: native CI43295185257 was still running at the final head read; all six gates, stock lint and the actual completed definition/statement/proof reports remain pending. No local Lean/build/cache or compiled audit was run. #4786 must obtain its own clearance and actually land, followed by normal reconciliation and resulting-head carry/current validation. No source edit or queue action.
…he TC closure; manual wording - decider_layout states the layout of shape check, guard, block, accept and reject once; blockDecider_layout and nblockDecider_layout derive from it. - TransitiveClosure.correct_op uses ClosureKernel.eval_pow_reg0. - finite-model-logic.md: Kept states the effect of compiled formulas and closure loops, not of every block.
|
Head is now 67b5ecb. It folds in the three items from the coordinator's #4786 review (commit 67b5ecb, net −9 lines). The other new commit, 1f7a395, merges #4786's fix 47a4d59 from the base branch.
Validation: |
# Conflicts: # CslibFrontier/Computability/Complexity/Classes/LogSpace/FirstOrder/TransitiveClosure.lean # manual/circuits-logic-and-other-models/finite-model-logic.md
|
Head is now b63c4cb. It merges main (07b0812) and then restores #4757's manual text on lines 71 and 85 of finite-model-logic.md (the |
edemaine
left a comment
There was a problem hiding this comment.
Independent non-author agent source/API/manual delta APPROVE at exact b63c4cba2bdc40e43374c2c5a80a33e14313a55a, by reviewer-codex-edemaine; no findings. Shared layout/both consumers, power-lemma reuse and final main/manual restoration checked, with unchanged own-layer coverage reused. Canonical review and exact-head manual/replay evidence. Native six-gate CI and its final actual advisories remain an explicit integration hold; no queue action. Agent review, not human approval.
|
Agent review (Jetski reviewer session 06d715a4-37dc-4457-93d7-bbb3e360de89, coordinated by Jetski session 33f8b11c) of b63c4cb: approve. This is an agent review, not a human review. Scope: the PR's own layer over main 470dee6, which now contains #4786. That covers the original top commit 6871fc4, the delta 67b5ecb, and the merge of main and its fix (07b0812, b63c4cb). The diff is net +41 over 5 files (+215/−174).
|
The FO(TC)
NLdecider inTransitiveClosure.leanreimplemented the harness thatblockDecideralready provides, with the shape check, size guard, accept and reject. This PR adds the nondeterministic version once and makes the FO(TC) decider one application of it. It is infrastructure only; no mathematical progress. Part of #4737 (lanefo-kernel, survey finding F4). It is stacked on #4786, so review only the top commit; queue it after #4786 lands.Classes/LogSpace/FirstOrder/Ordered/NondeterministicDecider.lean(new) addsnblockDecider v C c s, which wraps a blockC b T Fwith the shape check and size guard shifted above the choice bit, plus accept and reject. It also addsmem_NL_of_soundCompleteBlock, the analogue ofmem_L_of_decidingBlock: if the block is sound (for anyPostholding at its halting reject labelF, every branch halts inPostor reachesTonly on members, within the register bound) and complete (on members, some branch reachesT), the query is inNL. It sits next toOrdered/Decider.lean, the deterministic version (the survey'sClasses/LogSpace/Ordered/path is stale).TransitiveClosure.lean:TCModelChecker.encodedLanguage_mem_NLis now one call tomem_NL_of_soundCompleteBlock, laid out likeDTCModelChecker.encodedLanguage_mem_L. The removed declarations aredeciderCode,decider,allBranches_deciderandaccepts_decider(public, used nowhere else), and the privatedecider_layoutandinit_decider. The statements ofencodedLanguage_mem_NL,TCDefinable.encodedLanguage_mem_NLandPosTCDefinable.encodedLanguage_mem_NLare unchanged.The net change is +50 lines (+203/−153), not the survey's estimated −100. The harness and its layout and initialization lemmas move into a documented module, but the FO(TC) client was their only copy, so there was no second copy to delete. The benefit is that the next nondeterministic decider on
encStructuregets the harness for free. The survey's optional follow-up of movingVocabulary.modelCheckeronto the harness is not done here.Manuals. In the Operator's Manual, the FO(TC) paragraph of
finite-model-logic.mdnow namesnblockDeciderandmem_NL_of_soundCompleteBlockand says when to use them, matching the DTC paragraph'sblockDeciderguidance. TheOrdered/Decider.leandocstring points to the new module. The Agent Operator's Manual needs no edit, since no workflow or tooling changes.ROADMAP.mdand the results inventory are unaffected. The new file is-- upstream: candidate.Validation. Through the shared build slot,
lake build --wfail --iofailpasses forOrdered.{Decider, NondeterministicDecider},FirstOrder.{TransitiveClosure, DeterministicTransitiveClosure},TransitiveClosure.Converse,Ordered.Reachability, and the testsTransitiveClosureNLandOrderedReachCompleteness.lake exe mk_all --check,check_operator_manual.py, the projection-chain and encoding-readability ratchets, and source hygiene also pass. Hosted CI does the full run.AI disclosure: written by a Jetski agent (worker session
1c3a6893, coordinator33f8b11c). It needs independent review.