Deterministic prefixes of nondeterministic traces #
Many NTM constructions (guess-and-verify, deterministic preprocessing before a nondeterministic phase) run through a deterministic prefix: an initial segment of the computation on which the two transition branches agree. On that segment the trace is independent of the choice bits and follows an ordinary DTM run.
The stepping stone is TM.ReachesInVia, a run whose step sources are
annotated with a predicate. Annotating sources rather than imposing a
step-closed invariant matters: the last prefix step typically exits the
agreeing region (entering the nondeterministic phase), so no step-closed
predicate can describe the prefix. Phase wraps produce annotated runs via
TM.reachesInVia_of_stepCommute, and annotated runs concatenate with
TM.ReachesInVia.trans.
Main results:
NTM.det— project an NTM onto the DTM that always follows branchb.NTM.BranchesAgreeAt,NTM.det_step_congr— pointwise branch agreement, under which the projections take the same step.NTM.trace_succ_det— one non-halted trace step is one step of thedet-projection selected by the current choice bit.NTM.trace_of_det_prefix— the workhorse: adet falserun oftsteps whose sources all satisfyBranchesAgreeAtlets any length-(s + t)trace restart from the run's endpoint with the firsttchoices discarded.
A DTM run of t steps from c to c' all of whose step sources
satisfy A. Unlike a step-closed invariant, this can describe a run
whose final step leaves the region described by A.
- zero {n : ℕ} {tm : TM n} {A : Cfg n tm.Q → Prop} {c : Cfg n tm.Q} : tm.ReachesInVia A 0 c c
- step {n : ℕ} {tm : TM n} {A : Cfg n tm.Q → Prop} {c c'' : Cfg n tm.Q} {t : ℕ} {c' : Cfg n tm.Q} : A c → tm.step c = some c'' → tm.ReachesInVia A t c'' c' → tm.ReachesInVia A (t + 1) c c'
Instances For
A zero-step annotated run goes nowhere. Inversion form of
ReachesInVia.zero, usable when the machine is a compound expression on
which cases cannot abstract the configuration indices.
An annotated run of t + 1 steps factors as one step from an A-source
followed by an annotated run of t steps. Inversion form of
ReachesInVia.step.
Weaken the source annotation of an annotated run.
Concatenate annotated runs.
Annotate a run with a step-closed invariant that implies the annotation.
Transport a run through a step-commuting wrap w, annotating every
source with membership in the image region described by A. This is how
phase embeddings (whose sources all live inside one phase of a composed
machine) produce annotated runs.
Project an NTM onto the deterministic machine that always follows
branch b. The projection shares the NTM's state space, so its
configurations coincide with the NTM's.
Equations
Instances For
The two transition branches of N agree at configuration c (on the
symbols actually under the heads). This is the pointwise hypothesis under
which a trace step is choice-independent.
Equations
Instances For
Deterministic-prefix transport. A det false run of t steps whose
sources all satisfy BranchesAgreeAt is followed identically by the
trace along any choice sequence: a length-(s + t) trace equals the
trace of the remaining s steps from the run's endpoint with the first
t choices discarded.