Conversation
fynngodau
requested review from
arademaker,
chenson2018,
fmontesi,
kim-em and
sorrachai
as code owners
September 18, 2026 18:53
crei
reviewed
Sep 19, 2026
| /-- `ntm` computes `output` from `input` touching exactly `s` work tape cells. -/ | ||
| def ComputesInExactSpace (ntm : MultiTapeNTM k Symbol State) (input output : List Symbol) (s : ℕ) : | ||
| /-- `ntm` computes `output` from `input`, touching exactly `s` work tape cells. -/ | ||
| def ComputesInSpace (ntm : MultiTapeNTM k Symbol State) (input output : List Symbol) (s : ℕ) : |
Collaborator
There was a problem hiding this comment.
But this is still exact space, isn't it? I think we don't really need exact space, so maybe just change this to \le.
Author
There was a problem hiding this comment.
I would agree with this if we also change the semantics of MultiTapeTM.ComputesInTimeAndSpace.
Author
There was a problem hiding this comment.
Actually, in that case I would like to rename everything to Within so it's consistent with SingleTapeTM.
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.
In
MultiTapeNTM, sinceStepis defined such that a halted configuration steps to itself, we have the surprising situation thatComputesInExactTimeallows one to add arbitrarily many steps, i.e. the following is provable:proof
theorem make_more_steps (h : ComputesInExactTime tm i o k) : ComputesInExactTime tm i o (k+1) := let ⟨p, hh⟩ := h ⟨ { cfgs := p.cfgs.concat p.last last := p.last isChainFromTo := { isChain := by have fact := p.isChainFromTo.isChain rw [List.concat_eq_append] apply List.isChain_append.2 aesop rw [show x = p.last by grind [p.isChainFromTo.getLast_eq]] unfold Step simp [left] ne_nil := by simp head_eq := by grind [p.isChainFromTo.head_eq] getLast_eq := by simp } }, hh.left, hh.right.left, have fact := hh.right.right by simp only [ComputationPath.time,List.concat_eq_append] at fact ⊢ rw [List.length.eq_def] at fact ⊢ have fact2 := p.isChainFromTo.ne_nil generalize eq : p.cfgs = cc rw [eq] at fact match cc with | [] => nomatch (fact2 eq) | hd :: tl => grind ⟩This does not match the intuitive understanding of an "exact" runtime. To resolve this situation, this PR aligns the terminology used in
MultiTapeNTMwith the one used inMultiTapeTM, and thus renames toComputesInTimeetc..For both convenience and clarity, considering the above theorem, the definition wrt. the time bound is also changed from
=to≤.Notes:
SingleTapeTM(andRelationas used therein):SingleTapeTM'sWithinTime=MultiTapeTM'sInTime(both≤, whereasMultiTapeTM's space boundaries are exact=!)MultiTapeTM.Nondeterministicvs.SingleTapeTM.NonDeterministic(capitalization of theD)