Skip to content

refactor(MultiTape): build seq and repeatUntilBlank by wiring machines - #46

Merged
barni120400 merged 1 commit into
refactor/multitape-shared-simulationsfrom
refactor/multitape-wire-adapters
Oct 27, 2026
Merged

barni120400 merged 1 commit into
refactor/multitape-shared-simulationsfrom
refactor/multitape-wire-adapters

Conversation

@barni120400

@barni120400 barni120400 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

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.

Depends on #32.

Composed with Claude Code.

@barni120400
barni120400 force-pushed the refactor/multitape-wire-adapters branch 2 times, most recently from 5ebfe8c to 2c4df54 Compare October 27, 2026 23:18
@barni120400 barni120400 changed the title refactor(MultiTape): build seq and repeatUntilBlank by wiring adapted machines refactor(MultiTape): build seq and repeatUntilBlank by wiring machines Oct 27, 2026
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
barni120400 force-pushed the refactor/multitape-wire-adapters branch from 2c4df54 to 6580317 Compare October 27, 2026 23:29
@barni120400
barni120400 merged commit 6580317 into refactor/multitape-shared-simulations Oct 27, 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