Documentation

Complexitylib.Models.RandomAccessMachine.Simulation.RegisterStore.Machine.WordEncode.Internal

Self-delimiting word emission — proof internals #

theorem Complexity.RAM.RegisterStore.Machine.workEmitTM_reachesIn_frame_internal {n : } (idx : Fin n) (mode : WorkEmitMode) (bits emitted : List Bool) (c : Complexity.Cfg n (workEmitTM idx mode).Q) :
c.state = WorkEmitPhase.scan(c.work idx).HasBinarySuffix bitsTM.Parked c.input(∀ (i : Fin n), i idxTM.Parked (c.work i))c.output.HasBinaryPrefix emitted∃ (c' : Complexity.Cfg n (workEmitTM idx mode).Q), (workEmitTM idx mode).reachesIn (workEmitTime bits) c c' (workEmitTM idx mode).halted c' c'.input = c.input (c'.work idx).HasBinarySuffix [] (c'.work idx).cells = (c.work idx).cells (c'.work idx).head = (c.work idx).head + bits.length (∀ (i : Fin n), i idxc'.work i = c.work i) c'.output.HasBinaryPrefix (emitted ++ workEmitBits mode bits)
theorem Complexity.RAM.RegisterStore.Machine.workEmitTM_hoareTime_frame_internal {n : } (idx : Fin n) (mode : WorkEmitMode) (bits emitted : List Bool) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hsource : (work₀ idx).HasBinarySuffix bits) (hinput : TM.Parked inp₀) (hother : ∀ (i : Fin n), i idxTM.Parked (work₀ i)) (houtput : out₀.HasBinaryPrefix emitted) :
(workEmitTM idx mode).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = work₀ out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ (work idx).HasBinarySuffix [] (work idx).cells = (work₀ idx).cells (work idx).head = (work₀ idx).head + bits.length (∀ (i : Fin n), i idxwork i = work₀ i) out.HasBinaryPrefix (emitted ++ workEmitBits mode bits)) (workEmitTime bits)
theorem Complexity.RAM.RegisterStore.Machine.wordEncodeTM_hoareTime_frame_internal {n : } (idx : Fin n) (value : ) (emitted : List Bool) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hvalue : (work₀ idx).HasBinaryNat value) (hinput : TM.Parked inp₀) (hother : ∀ (i : Fin n), i idxTM.Parked (work₀ i)) (houtput : out₀.HasBinaryPrefix emitted) :
(wordEncodeTM idx).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = work₀ out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ (work idx).HasBinarySuffix [] (work idx).cells = (work₀ idx).cells (work idx).head = value.bits.length + 1 (∀ (i : Fin n), i idxwork i = work₀ i) out.HasBinaryPrefix (emitted ++ WordCode.encode value)) (wordEncodeTime value)
theorem Complexity.RAM.RegisterStore.Machine.rewindWordEncodeTM_hoareTime_frame_internal {n : } (idx : Fin n) (value headBound : ) (emitted : List Bool) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hcontent : (work₀ idx).HasBinaryContent value.bits) (hstart : (work₀ idx).cells 0 = Γ.start) (hhead : 1 (work₀ idx).head (work₀ idx).head headBound) (hinput : TM.Parked inp₀) (hother : ∀ (i : Fin n), i idxTM.Parked (work₀ i)) (houtput : out₀.HasBinaryPrefix emitted) :
(rewindWordEncodeTM idx).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ work = work₀ out = out₀) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = inp₀ (work idx).HasBinarySuffix [] (work idx).cells = (work₀ idx).cells (work idx).head = value.bits.length + 1 (∀ (i : Fin n), i idxwork i = work₀ i) out.HasBinaryPrefix (emitted ++ WordCode.encode value)) (rewindWordEncodeTime value headBound)