Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.BlockComputation.ScheduleReadSearch

Streaming the last earlier provider interval #

The search retains the binary schedule, target interval and port, a binary cursor and at most one previous matching index. It visits earlier intervals in increasing order, replacing the saved index on a match. Window membership is computed by streamed digit counts. No list of indices or runtime power is allocated.

@[reducible, inline]

Actual schedule number, target interval and target port.

@[reducible, inline]

Retained search arguments, next candidate interval and last matching interval.

Check one candidate and advance the binary cursor, retaining the original arguments.

Search the earlier intervals without materializing their indices.

Every iteration retains the original schedule and target.

The search cursor equals the number of completed iterations.

theorem Turing.MultiTapePTM.BlockComputation.ScheduleRead.searchIterate_spec (k c σ i δ j : ℕ) :
match ((searchStep k c)^[j] ((σ, i, δ), 0, none)).2.2 with | none => ∀ n < j, inWindow k c (σ, i, δ, n) = false | some n => n < j ∧ inWindow k c (σ, i, δ, n) = true ∧ ∀ m < j, inWindow k c (σ, i, δ, m) = true → m ≤ n

The retained option is absent exactly before any match, and otherwise records a greatest matching candidate among the intervals already visited.

A retained predecessor is always smaller than the number of visited intervals.

Streaming search computes the existing numeric last-provider operation.

theorem Turing.MultiTapePTM.BlockComputation.ScheduleRead.search_eq_lastBefore {k q : ℕ} (σ : ℕ) (i : Fin q) (h : Fin k) (δ : Fin 3) :
search k (↑h + 1) (σ, ↑i, ↑δ) = Option.map Fin.val (lastBefore (InWindow (scheduleOfNat k q σ) h (portBlock (scheduleOfNat k q σ) i h δ)) i)

The native reader finds exactly the functional schedule's last earlier provider.