Skip to content

refactor(MultiTape): simulate machines through adapters - #41

Closed
barni120400 wants to merge 1 commit into
refactor/multitape-single-space-apifrom
refactor/multitape-tape-adapter
Closed

barni120400 wants to merge 1 commit into
refactor/multitape-single-space-apifrom
refactor/multitape-tape-adapter

Conversation

@barni120400

@barni120400 barni120400 commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Lets a machine follow another: it performs each transition of the inner machine through an adapter, which computes what the inner machine reads from the symbols under the outer heads (HeadSymbols) and gives the outer action performing each inner action. adapt runs a machine through an adapter, and Follows.runningStepHom and Follows.stepHom turn a configuration map that agrees with the adapter into a homomorphism of step relations, so it maps run paths.

Defines extendTapes, outputToTape and inputFromTape as tm run through their adapters, so their homomorphisms come from follows_adapt. seq and repeatUntilBlank relabel the actions of their inner machines with Action.mapState and follow them by definition, and prependOutputHom follows the machine itself. This replaces the step lemmas of each simulation and the deterministic stepHom and runningStepHom, and shortens the proofs that use them.

Working version of #32 (upstream leanprover#1151), which stays unchanged until this is ready.

Depends on #31.

Composed with Claude Code.

@barni120400
barni120400 force-pushed the refactor/multitape-tape-adapter branch 6 times, most recently from 9c4f041 to fd3a762 Compare October 24, 2026 19:20
@barni120400 barni120400 changed the title refactor(MultiTape): share tape simulations through a tape adapter refactor(MultiTape): simulate machines through adapters Oct 24, 2026
@barni120400
barni120400 force-pushed the refactor/multitape-tape-adapter branch 2 times, most recently from 93fa123 to b6f0da4 Compare October 24, 2026 20:17
A machine follows another when it performs each of its transitions
through an adapter: what the inner machine reads, computed from the
symbols under the heads of the outer machine (`HeadSymbols`), and the
outer action performing each inner action. `adapt` runs a machine
through an adapter, and `Follows.runningStepHom` and `Follows.stepHom`
turn a configuration map that agrees with the adapter into a
homomorphism of step relations.

`extendTapes`, `outputToTape` and `inputFromTape` run `tm` through their
adapters, so their homomorphisms come from `follows_adapt`. `seq` and
`repeatUntilBlank` relabel the actions of their inner machines with
`Action.mapState` and follow them by definition, and `prependOutputHom`
follows the machine itself. This replaces the step lemmas of each
simulation and the deterministic `stepHom` and `runningStepHom`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@barni120400
barni120400 force-pushed the refactor/multitape-tape-adapter branch from b6f0da4 to 192855e Compare October 24, 2026 20:45
@barni120400

Copy link
Copy Markdown
Owner Author

Moved to #32 (upstream leanprover#1151).

@barni120400
barni120400 deleted the refactor/multitape-tape-adapter branch October 24, 2026 20:51
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