Symbolic replay with deferred old work-tape symbols
DefinitionSymbolicOldWorkReplaycomplexity-theoryformal-verification
A single-work-head replay keeps one local map per cell from the cut symbol to its current value. It resolves the cut symbol only when possible values induce different control states or head moves.
Definition code
import Mathlib
set_option autoImplicit false
namespace PvsNP.SymbolicOldReads
variable {Symbol State : Type}
/-- The transition separates its observable effect from the written symbol. -/
abbrev Transition (Symbol State : Type) := State → Symbol → (State × ℤ) × Symbol
structure Configuration (Symbol State : Type) where
state : State
head : ℤ
tape : ℤ → Symbol
structure Replay (Symbol State : Type) where
state : State
head : ℤ
maps : ℤ → Symbol → Symbol
requested : Finset ℤ
def concrete (machine : Transition Symbol State)
(config : Configuration Symbol State) : Configuration Symbol State :=
let action := machine config.state (config.tape config.head)
⟨action.1.1, config.head + action.1.2,
Function.update config.tape config.head action.2⟩
noncomputable def symbolic [Inhabited Symbol]
(machine : Transition Symbol State) (initial : ℤ → Symbol)
(config : Replay Symbol State) : Replay Symbol State := by
classical
let action (value : Symbol) := machine config.state (config.maps config.head value)
exact
if ∀ a b, (action a).1 = (action b).1 then
⟨(action default).1.1, config.head + (action default).1.2,
Function.update config.maps config.head (fun value => (action value).2),
config.requested⟩
else
let actual := action (initial config.head)
⟨actual.1.1, config.head + actual.1.2,
Function.update config.maps config.head (fun _ => actual.2),
insert config.head config.requested⟩
def Agrees (initial : ℤ → Symbol) (physical : Configuration Symbol State)
(record : Replay Symbol State) : Prop :=
physical.state = record.state ∧ physical.head = record.head ∧
∀ p, physical.tape p = record.maps p (initial p)
end PvsNP.SymbolicOldReads
Source
Work-tape communication simulation for correlated-block Gap-MCSP.