Repository navigation
refactor(MultiTape): build seq and repeatUntilBlank by wiring machines - #46
Merged
barni120400 merged 1 commit intoOct 27, 2026
Conversation
barni120400
force-pushed
the
refactor/multitape-wire-adapters
branch
2 times, most recently
from
October 27, 2026 23:18
5ebfe8c to
2c4df54
Compare
seq and repeatUntilBlank by wiring adapted machinesseq and repeatUntilBlank by wiring machines
Adds `wire`, which runs two machines on the same tapes in one, in the states `State₀ ⊕ State₁`, and takes two wires, `next₀` and `next₁`, saying where the steps of each machine lead: within the same machine, to the other one, or to halting. Each half follows its machine through the adapter relabeling its next states (`Wire.follows_left`, `Wire.follows_right`), and the adapted transition `adaptedTr` is shared with `adapt`, whose `follows_adapt` becomes `Adapt.follows`. Defines `seq` as the wiring of its two machines, and `repeatUntilBlank` as the wiring of `tm` with `blankTest`, a one-state machine that halts on a blank cell and otherwise hands back to `tm`. The loop's first phase is that of `seq`: `Sequential.leftState` and `leftCfg` now take the state handed over to, so the loop reuses them in place of its own `runState`. The loop's states become `State ⊕ Unit`, replacing `RepeatUntilBlankState`, and the hand-written `Follows` proofs of both combinators are removed, as is `Action.mapState`, now used only to define `Adapter.mapState`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
barni120400
force-pushed
the
refactor/multitape-wire-adapters
branch
from
October 27, 2026 23:29
2c4df54 to
6580317
Compare
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.
Adds
wire, which runs two machines on the same tapes in one, in the statesState₀ ⊕ State₁, and takes two wires,next₀andnext₁, saying where the steps of each machine lead: within the same machine, to the other one, or to halting. Each half follows its machine through the adapter relabeling its next states (Wire.follows_left,Wire.follows_right), and the adapted transitionadaptedTris shared withadapt, whosefollows_adaptbecomesAdapt.follows.Defines
seqas the wiring of its two machines, andrepeatUntilBlankas the wiring oftmwithblankTest, a one-state machine that halts on a blank cell and otherwise hands back totm. The loop's first phase is that ofseq:Sequential.leftStateandleftCfgnow take the state handed over to, so the loop reuses them in place of its ownrunState. The loop's states becomeState ⊕ Unit, replacingRepeatUntilBlankState, and the hand-writtenFollowsproofs of both combinators are removed, as isAction.mapState, now used only to defineAdapter.mapState.Depends on #32.
Composed with Claude Code.