Bottom-up nice-tree DP pass and runTreeCSPProg correctness #
This module proves the four structural-induction cases (subtree_leaf, subtree_introduce,
subtree_forget, subtree_join) verifying SubtreeFullSpec for iterate nodeStep, assembles the
top-level Memory.Prog entry point runTreeCSPProg, and proves its exact-basis Word-RAM
realization certificate.
Main definitions #
Cslib.Algorithms.WordRAM.TreeDecomposition.runTreeCSPProg: top-level Word-RAM dynamic program.
Main results #
Cslib.Algorithms.WordRAM.TreeDecomposition.inputFits_encode: input word-width fit lemma.Cslib.Algorithms.WordRAM.TreeDecomposition.runTreeCSPProg_spec: end-to-end validity, output equality withTreeCSPInstance.result, and step-cost boundinst.stepBound.Cslib.Algorithms.WordRAM.TreeDecomposition.runTreeCSPProg_realizes: exact-basis Word-RAM realization certificate.
Top-level exact-basis Word-RAM program solving serialized TreeCSPInstance inputs.
theorem Cslib.Algorithms.WordRAM.TreeDecomposition.inputFits_encode {w : ℕ} (inst : TreeCSPInstance) (hw : WordRAM.Fits w inst.wordBound) :
WordRAM.InputFits w inst.encode
Every word of inst.encode (and its length) fits within w bits when
Fits w inst.wordBound.
theorem Cslib.Algorithms.WordRAM.TreeDecomposition.runTreeCSPProg_spec {w : ℕ} (inst : TreeCSPInstance) (hw : WordRAM.Fits w inst.wordBound) :
have s₀ := DataStructure.Memory.State.init inst.encode;
(DataStructure.Memory.spec w).ValidHistory s₀ ((DataStructure.Memory.spec w).clientHistory s₀ (runTreeCSPProg ())) ∧ (DataStructure.Memory.spec 0).clientResult s₀ (runTreeCSPProg ()) = inst.result ∧ WordRAM.Realization.memoryCost (runTreeCSPProg ()) s₀ ≤ inst.stepBound
Full correctness, history validity, and step-cost bound for runTreeCSPProg.
theorem Cslib.Algorithms.WordRAM.TreeDecomposition.runTreeCSPProg_realizes :
WordRAM.Realization.Realizes WordRAM.Basis.exact runTreeCSPProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : Unit) (s : DataStructure.Memory.State) =>
∃ (inst : TreeCSPInstance), s = DataStructure.Memory.State.init inst.encode ∧ WordRAM.Fits w inst.wordBound)
fun (x : Unit) (x_1 : DataStructure.Memory.State) => 0
Exact-basis Word-RAM realization certificate for runTreeCSPProg.