Skip to content

feat(MultiTapeTM): compose machines using tape transformations - #874

Open
SamuelSchlesinger wants to merge 2 commits into
samschles/tm-04-rewindfrom
samschles/tm-05-composition
Open

feat(MultiTapeTM): compose machines using tape transformations#874
SamuelSchlesinger wants to merge 2 commits into
samschles/tm-04-rewindfrom
samschles/tm-05-composition

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Construct machine composition from output redirection, work-tape rewind, and input substitution using the sequential combinator. Prove that the composite halts with the second machine's output on the first machine's result.

Part 5/6 of the TM composition stack. Depends on #873. Next: #875.

Validation: strict build, import checks, full tests, and linters.

This PR was composed with Astra via Codex.

@crei crei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't read all of this PR yet, but I'm a bit surprised that there is still so much code to it. Maybe the plumbing is not abstract enough or does not have enough lemmas?

- `InputFromWorkTape` simulates the native input on a work tape, preserving boundary clamping.
- `Rewind` shares one controller between native-input and work-tape rewinding. Work-tape rewind
starts immediately after contiguous contents and finishes at their first cell, including when empty.
- `Composition` assembles output redirection, work-tape rewind, and input substitution with `seq`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to first explain what it does and then how it does it. It reads like we already know where this is going.

/-- Composition returns the second machine's output on the first machine's result.
The first halting time must be minimal; the second may be padded. -/
theorem comp_haltsWithOutput
{input out₀ out₁ : List Symbol} {u v : ℕ}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{input out₀ out₁ : List Symbol} {u v : ℕ}
{input out₀ out₁ : List Symbol} {t\0 t\1 : ℕ}

/-!
# Correctness of multi-tape composition

`comp_haltsWithOutput` proves that the composite machine returns the second machine's output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be a bit more stand-alone. What is "the composite machine"?

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.

2 participants