Complexitylib time classes on CSLib multi-tape machines #
CSLib measures the complexity of a language through its multi-tape machines
(Turing.MultiTapeTM): MultiTapeTM.DecidableInTimeAndSpace L enc t s says
that some machine over the binary alphabet with finitely many states decides
L within time t x and space s x on every input x, emitting the single
bit true on inputs in L and false otherwise. Space counts the work cells
its heads visit. Our languages are sets of binary strings, so they are passed
to CSLib with the identity encoding.
This file shows that our deterministic time classes run on those machines
with a constant-factor overhead. The simulator TM.toMultiTape
(Complexitylib.Interop.Cslib.MultiTape.Defs) executes a machine
tm : TM n step for step on 2n + 3 CSLib work tapes and then reads off the
verdict.
Main results #
Complexity.TM.DecidesInTime.decidableInTimeAndSpace— a decider within timefyields a CSLib decider within time and space(2n + 3) (2 f + 5)Complexity.decidableInTimeAndSpace_of_mem_DTIME—DTIME(T)languages are CSLib-decidable within time and spaceO(T)Complexity.decidableInTimeAndSpace_of_mem_P—Planguages are CSLib-decidable within polynomial time and spaceComplexity.TM.DecidesInTimeSpace.decidableInTimeAndSpace— a decider within timeTand spaceSyields a CSLib decider within time2 T + 4and space(2n + 3) (S + 2)Complexity.decidableInTimeAndSpace_of_mem_DTISP—DTISP(T, S)languages are CSLib-decidable within timeO(T)and spaceO(S + 1)Complexity.TM.ComputesInTime.computableInTimeAndSpace— a machine computingfwithin timeTyields a CSLib machine computingfwithin time3 T + 4and space(2n + 3) (3 T + 5)Complexity.computableInTimeAndSpace_of_mem_FP—FPfunctions are CSLib-computable within polynomial time and space
The converse is Complexitylib.Interop.Cslib.FromMultiTape, and together the
two directions give mem_P_iff_decidableInTimeAndSpace.
A Complexitylib decider runs on CSLib. If tm decides L within time
f, a CSLib multi-tape machine decides L within time and space
(2n + 3) (2 f + 5).
P transfers to CSLib. Every language in P is decided by a CSLib
multi-tape machine within polynomial time and space in the input length.
A space-bounded Complexitylib decider runs on CSLib in the same space.
If tm decides L within time T and space S (TM.DecidesInTimeSpace), a
CSLib multi-tape machine decides L within time 2 T + 4 and space
(2n + 3) (S + 2).
A Complexitylib function computation runs on CSLib. If tm computes
f within time T, a CSLib multi-tape machine computes f (with identity
encodings) within time 3 T + 4 and space (2n + 3) (3 T + 5).
FP transfers to CSLib. Every function in FP is computed by a CSLib
multi-tape machine within polynomial time and space in the input length.