Documentation

CslibFrontier.Computability.Complexity.FineGrained.SearchStep

Resources of one step of a stack search with a leaf oracle #

The fine-grained branching algorithms run a stack search, one step at a time: when the stack is empty the state is kept; when the node on top is a leaf, an oracle g is called on it and its answer is recorded in the state; otherwise the node is expanded in place. If everything except the oracle call is polynomial-time, one step takes polynomial time and space in the encoded state, plus the time (respectively space) of the oracle on the node, plus a polynomial in the encoded state and answer, the last two charged only on leaf steps.

Main results #

theorem Cslib.Complexity.exists_computableInO_searchStep {σ ν γ : Type} {encS : σ ↪ List Bool} {encN : ν ↪ List Bool} {encG : γ ↪ List Bool} {done isLeaf : σ → Bool} {top : σ → ν} {expand : σ → σ} {record : σ × γ → σ} {g : ν → γ} {t s : ν → ℕ} (hdone : Turing.MultiTapeTM.ComputableInPolyTime done encS Turing.MultiTapeTM.encBool) (hleaf : Turing.MultiTapeTM.ComputableInPolyTime isLeaf encS Turing.MultiTapeTM.encBool) (htop : Turing.MultiTapeTM.ComputableInPolyTime top encS encN) (hexpand : Turing.MultiTapeTM.ComputableInPolyTime expand encS encS) (hrecord : Turing.MultiTapeTM.ComputableInPolyTime record (Turing.MultiTapeTM.encPair encS encG) encS) (hg : Turing.MultiTapeTM.ComputableInO g encN encG t s) :
∃ (d : ℕ), Turing.MultiTapeTM.ComputableInO (fun (x : σ) => if done x = true then x else if isLeaf x = true then record (x, g (top x)) else expand x) encS encS (fun (x : σ) => ((encS x).length + 1) ^ d + if done x = false ∧ isLeaf x = true then t (top x) + ((encS x).length + (encG (g (top x))).length + 1) ^ d else 0) fun (x : σ) => ((encS x).length + 1) ^ d + if done x = false ∧ isLeaf x = true then s (top x) + ((encS x).length + (encG (g (top x))).length + 1) ^ d else 0

The time and space of one search step. A step that keeps a finished state (done), records the oracle's answer g (top x) on a leaf (isLeaf) and otherwise expands the state (expand) runs within a polynomial in the encoded state, plus, on leaf steps only, the time (respectively space) of g on top x and a polynomial in the encoded state and answer.