Space-aware Hoare specifications #
TM.HoareSpace states the all-reachable auxiliary-space invariant required by
TM.ComputesInSpace; TM.HoareTimeSpace pairs it with a terminating
time-bounded Hoare triple.
The public API includes structural rules, sequential composition, transducer
closure, and a fresh-start computation bridge.
Main results #
TM.HoareTimeSpace.consequence— weaken/strengthen every contract component.TM.HoareSpace.weaken_pre,TM.HoareSpace.mono— structural space rules.Cfg.WithinAuxSpace.reachesIn— bound head growth along a concrete run.TM.HoareTime.and_hoareSpace— pair existing endpoint and safety proofs.TM.HoareTime.toHoareTimeSpace— derive all-reachable space from time and an initial head bound.TM.seqTM_hoareTimeSpace— compose two phases at one space budget.TM.IsTransducer.seqTM— sequential composition remains append-only.TM.computesInSpace_of_hoareTimeSpace— package per-input contracts.
Enlarging the logical input region and work-space budget preserves an auxiliary-space bound.
The standard combinator phase transition moves input and work heads by at most one, so one additional auxiliary-space cell covers the seam.
A time-step run can increase every charged head position by at most
time, so adding that many cells preserves the auxiliary-space bound.
Strengthening the precondition preserves an all-reachable space contract.
Enlarging the logical input region and auxiliary-space budget preserves a space contract.
Pair an existing terminating Hoare proof with an all-reachable space proof. This is the main entry point for upgrading established subroutine contracts without reproving their endpoint behavior.
Upgrade a terminating time-bounded Hoare triple to an all-reachable
time-and-space contract. If every starting configuration fits in
initialSpace, then at most one additional cell per machine step gives the
uniform bound initialSpace + time.
A time-and-space contract exposes its ordinary time-bounded Hoare triple.
A time-and-space contract exposes its all-reachable space component.
Consequence rule: strengthen the precondition, weaken the postcondition, and enlarge any of the three numerical bounds.
Sequentially composing one-way-output machines preserves the transducer discipline.
Sequential composition of time-and-space Hoare contracts.
Per-input fresh-start time-and-space contracts package a total function
transducer satisfying TM.ComputesInSpace.