Native space for streamed predecessor search #
The search retains its binary schedule and target, one binary cursor and the latest matching interval. Each membership test reuses the streamed digit-count reader. Thus even a very large binary target does not allocate an interval list or a power with runtime exponent.
noncomputable def Turing.MultiTapePTM.BlockComputation.ScheduleRead.encSearchArgs :
Binary schedule, target interval and target port.
noncomputable def Turing.MultiTapePTM.BlockComputation.ScheduleRead.encSearchState :
Immutable search arguments, binary cursor and optional last matching interval.
theorem Turing.MultiTapePTM.BlockComputation.ScheduleRead.searchStep_inSpace (k c : ℕ) :
MultiTapeTM.ComputableInSpace (searchStep k c) encSearchState encSearchState fun (a : SearchState) =>
(encSearchState a).length
A search step uses native space linear in its actual encoded state.
theorem Turing.MultiTapePTM.BlockComputation.ScheduleRead.search_inSpace (k c : ℕ) :
MultiTapeTM.ComputableInSpace (search k c) encSearchArgs (MultiTapeTM.encOption MultiTapeTM.encNat)
fun (a : SearchArgs) => (encSearchArgs a).length
A predecessor search stores only binary counters and the latest witness, with native space linear in the actual schedule/target/port encoding.