A language in P has a polynomial-time verdict function #
⚠️ Unreviewed by Bolton
Complexity.mem_P_of_decisionFn puts a language in P given a verdict function in FP. This
file is the converse: a language in P has such a function. That is what a development needs
whenever a polynomial-time predicate has to be consulted from inside another polynomial-time
computation — the predicate arrives as a machine, and only a function can be composed.
The function is the machine's own run, carried out inside the algebra: Cobham.initFn encodes
the initial configuration, Cobham.stepFn advances it, and after the machine's time bound many
steps Complexity.acceptFlag reads the verdict cell off the resulting code. Halted
configurations are fixed points of the encoded step, so running for exactly the time bound is
safe however early the machine stops.
Main definitions #
Complexity.TM.stepOrStay,Complexity.TM.runTo— the run as a total iterationComplexity.codeStep— the encoded step with its ruler carried alongsideComplexity.pVerdict— the verdict function
Main results #
Complexity.runCode_eq— the encoded run is the code of the real oneComplexity.pVerdict_eq_true_iff— the verdict function decides the languageComplexity.pVerdict_mem_FP— and it is polynomial-timeComplexity.exists_decisionFn_of_mem_P— hence every language inPhas one
The run as a total iteration #
The left-end markers survive any walk.
The encoded run #
The encoded step, carrying its ruler alongside the code.
Equations
Instances For
The encoded run is the code of the real one.
Reading the verdict off a code #
The test decides acceptance, for a deterministic machine.
The verdict function #
The verdict a deterministic machine reaches, computed inside the algebra.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The verdict function decides the language.
The verdict function is polynomial-time #
The width the whole packed state stays inside.
Equations
- Complexity.pStateBound k wp = 2 * (2 * wp + 2) + 2 + Polynomial.C (Complexity.codeBlocks k) * (2 * wp + 2)
Instances For
The verdict function is polynomial-time.
The bridge #
Every language in P has a polynomial-time verdict function. This is the converse of
Complexity.mem_P_of_decisionFn_bool: a polynomial-time predicate can always be consulted from
inside another polynomial-time computation.