Savitch's decider for space-bounded nondeterministic machines #
A nondeterministic machine with finitely many states, all of whose computation paths on an input
of length n visit at most c * (n + 1) ^ d work cells, is decided by the deterministic
Turing.MultiTapeNTM.savitchDecide: Savitch's midpoint recursion with an explicit stack
(Cslib.Reachability.savitch) on the codes of the finite views of the machine, asking whether
the accepting code is reachable from the code of the initial view.
Every view reachable from the initial view has an encoding of length at most
Turing.MultiTapeNTM.viewLengthBound, linear in n and the space bound, whatever the length of
the path reaching it (Turing.MultiTapeNTM.length_encFiniteCfg_le), so the codes have a width W
polynomial in n. Acceptance is reachability of the accepting code along the edges between codes
of 2 * W + 2 bits (Turing.MultiTapeNTM.accepts_iff_reflTransGen_codeStep). There are
2 ^ (2 * W + 2) such words, so it is reachability within as many steps, which the recursion
decides at depth 2 * W + 2. The edge test, the codes and the width are polynomial-time, so the
decider runs in space polynomial in n, charging the stack of frames, the counters and the edge
test (Cslib.Reachability.exists_polyBounded_space_savitch); its time is exponential.
The decider retains the whole input, so this is the polynomial-space consequence of Savitch's
theorem. The quadratic bound NSPACE(s) ⊆ DSPACE(s ^ 2), including sublinear s, is
Turing.MultiTapeNTM.exists_decidableInTimeAndSpace_sq, which never copies the input.
Main definitions #
Turing.MultiTapeNTM.codeWidth: the width of the codes of the views.Turing.MultiTapeNTM.viewCodeWidth: the bit-length2 * codeWidth + 2of the codes of the views.Turing.MultiTapeNTM.savitchDecide: the deterministic decider of acceptance.
Main results #
Turing.MultiTapeNTM.savitchDecide_eq_true_iff: the decider decides acceptance.Turing.MultiTapeNTM.computableInPolyTime_codeWidth: the width of the codes is polynomial-time.Turing.MultiTapeNTM.computableInPolyTime_viewCodeWidth: the bit-length of the codes of the views is polynomial-time.Turing.MultiTapeNTM.exists_polyBounded_space_savitchDecide: it runs in polynomial space.
References #
The width of the codes of the views on input, under the space bound
c * (input.length + 1) ^ d: the length of the encoding of the initial view plus the bound
Turing.MultiTapeNTM.viewLengthBound on the encodings of all reachable views.
Instances For
The bit-length 2 * ntm.codeWidth c d input + 2 of the codes (Turing.MultiTapeNTM.viewCode
and Turing.MultiTapeNTM.acceptCode) of the views on input, under the space bound
c * (input.length + 1) ^ d.
Instances For
Savitch's decider: whether the accepting code is reachable from the code of the initial
view, by Savitch's midpoint recursion on words of ntm.viewCodeWidth c d input bits at depth
ntm.viewCodeWidth c d input.
Instances For
Savitch's decider decides acceptance of a machine whose computation paths on input
visit at most c * (input.length + 1) ^ d work cells.
The width of the codes is polynomial-time, in unary.
The bit-length of the codes of the views is polynomial-time, in unary.
Savitch's decider runs in polynomial space: within some time and within space polynomially bounded in the length of the encoded instance.