Halting within the number of reachable views #
A nondeterministic machine whose computation paths all halt, and whose computation prefixes all
stay within space s, halts within as many steps as it has reachable views: at most
2 ^ (2 * coreLengthBound k State n s + 1) on an input of length n
(Turing.MultiTapeNTM.runsInTime_of_runsInSpace). Under a logarithmic space bound this is
polynomial in n: halting within Turing.polyClock d n = 2 * (2 * (n + 1)) ^ d steps for an
exponent d depending only on the machine and the space constant
(Turing.MultiTapeNTM.exists_runsInTime_polynomial_of_runsInSpace_log). So for logarithmic-space
machines "every branch halts" already gives a polynomial clock.
The argument is the classical one Sipser, Section 8.4: the views along a
computation path form a walk of views (Turing.MultiTapeNTM.ViewRep.step); a running path longer
than the number of reachable views repeats a running view, and repeating the cycle gives running
walks of every length, which lift back to computation paths of the same length
(Turing.MultiTapeNTM.ViewRep), contradicting that every path halts.
Main results #
Turing.MultiTapeNTM.runsInTime_of_runsInSpace: halting on every path within some time implies halting within the number of reachable views.Turing.MultiTapeNTM.exists_runsInTime_polynomial_of_runsInSpace_log: under a logarithmic space bound, halting on every path implies halting within a polynomial time bound.
References #
Views along a computation path. A computation path has a chain of views from the initial view, one view per configuration, each representing its configuration.
Counted view walks lift to computation paths of the same length.
Halting within the number of reachable views. If every computation path stays within
space s and every computation path halts within some time t, then every computation path
halts within 2 ^ (2 * coreLengthBound k State n s + 1) steps, the bound on the number of
reachable views.
Logarithmic space gives a polynomial clock. For every space constant c there is an
exponent d such that on every input of length n, if every computation path stays within space
c * (log₂ n + 1) and every computation path halts within some time, then every computation path
halts within polyClock d n steps.