Documentation

CslibFrontier.Algorithms.WordRAM.TreeDecomposition.CSP.NodeDesc

Node descriptor framing invariants and generic DP table-fill lemma #

This module provides the shared node-descriptor machinery used across all three parallel node handler modules (LeafIntro, Forget, and Join) as well as NodeStep/Pass:

Main definitions #

Main results #

Descriptor writes, framing invariants, and the four nice-tree node handlers #

Register arguments for the 4-word node descriptor writer writeDescProg.

  • dCur : ℕ

    Base address of the 4-word descriptor slot for the current tree node.

  • bagPtr : ℕ

    Base address of the materialized bag slice.

  • bagLen : ℕ

    Length of the materialized bag slice.

  • tblPtr : ℕ

    Base address of the DP table slice.

  • tblLen : ℕ

    Length of the DP table slice (q ^ bagLen).

Instances For

    Write the 4-word descriptor [bagPtr, bagLen, tblPtr, tblLen] at a.dCur.

    Invariant asserting that descriptor slot [d, d + 4) in memory s correctly references the materialized bag and DP table of subtree S, both allocated at or above F_lo.

    theorem Cslib.Algorithms.WordRAM.TreeDecomposition.NodeDescAt.frame {F_lo : ℕ} {counting : Bool} {q : ℕ} {cs : List (ConstraintTable q)} {vars : List ℕ} {S : SimpleGraph.NiceTree ℕ} {d lo hi : ℕ} {s₀ s₁ : DataStructure.Memory.State} (h : NodeDescAt F_lo counting q cs vars S d s₀) (hd : d + 4 ≤ lo ∨ hi ≤ d) (hhi : hi ≤ F_lo) (hf : WordRAM.Realization.FrameOutsideRange lo hi s₀ s₁) :
    NodeDescAt F_lo counting q cs vars S d s₁

    Frame NodeDescAt across writes strictly restricted to [lo, hi) (with hi ≤ F_lo).

    theorem Cslib.Algorithms.WordRAM.TreeDecomposition.NodeDescAt.mono_frontier {F_lo : ℕ} {counting : Bool} {q : ℕ} {cs : List (ConstraintTable q)} {vars : List ℕ} {S : SimpleGraph.NiceTree ℕ} {d : ℕ} {s₀ s₁ : DataStructure.Memory.State} (h : NodeDescAt F_lo counting q cs vars S d s₀) (hp : WordRAM.Realization.PreservesBelow s₀.frontier s₀ s₁) :
    NodeDescAt F_lo counting q cs vars S d s₁

    Lift NodeDescAt monotonically across frontier-preserving allocations/writes.

    theorem Cslib.Algorithms.WordRAM.TreeDecomposition.tableFillProg_spec {α : Type} {w : ℕ} (step : α × ℕ → DataStructure.Memory.Prog ℕ) (a : α) (tblPtr tblLen stepCost : ℕ) (targetTbl : List ℕ) (s : DataStructure.Memory.State) (Inv : DataStructure.Memory.State → Prop) (hinv : Inv s) (htarget_len : targetTbl.length = tblLen) (htbl_hi : tblPtr + tblLen ≤ s.frontier) (hstep : ∀ (k : ℕ) (t : DataStructure.Memory.State) (hk : k < tblLen), let m := tblLen - (k + 1); Inv t → t.frontier = s.frontier → WordRAM.Realization.PreservesBelow tblPtr s t → WordRAM.Realization.HoldsIn tblPtr (List.take m targetTbl) t → have entryVal := targetTbl[m]; have t₁ := { mem := Function.update t.mem (tblPtr + m) entryVal, frontier := t.frontier }; (DataStructure.Memory.spec w).ValidHistory t ((DataStructure.Memory.spec w).clientHistory t (step (a, m))) ∧ (DataStructure.Memory.spec 0).clientState t (step (a, m)) = t₁ ∧ (DataStructure.Memory.spec 0).clientResult t (step (a, m)) = m + 1 ∧ Inv t₁ ∧ WordRAM.Realization.memoryCost (step (a, m)) t ≤ stepCost) :

    Generic invariant-preserving loop specification for filling a contiguous DP table slice [tblPtr, tblPtr + tblLen) in index order 0, 1, ..., tblLen - 1.