Documentation

CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet.ParentPass

In-place parent-table accumulation pass (parentPassProg) #

This module certifies parentPassProg, which iterates over all 2 ^ |LP| parent masks curS, computes restrictMask LB LP curS via restrictMaskProg, and adds best[rKey] in-place into tblP[curS], with no dependency on MWISInstance, IndepScan, WeightScan, or ChildPass.

Main definitions #

Main results #

Prefix-updated list representation of parentPass #

List state of tblP after updating the first k parent masks in-place.

parentPassPrefix preserves the length of oldL.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.getD_parentPassPrefix (LB LP oldL bestL : List ℕ) {k s : ℕ} (hs_len : s < oldL.length) (hs_k : s < k) :
(parentPassPrefix LB LP oldL bestL k).getD s 0 = oldL[s] + bestL.getD (Lean.TreeDecomposition.restrictMask LB LP s) 0

Pointwise lookup on parentPassPrefix at index s < oldL.length with s < k.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.getD_parentPass_raw (LB LP : List ℕ) (old best : Array ℕ) {c s : ℕ} (hs : s < c) :

Pointwise formula for (parentPass LB LP old best c).getD s 0 without requiring LP.Nodup.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.mem_parentPassPrefix_le {LB LP oldL bestL : List ℕ} {capO capB k : ℕ} (hold : ∀ x ∈ oldL, x ≤ capO) (hbest : ∀ x ∈ bestL, x ≤ capB) (x : ℕ) :
x ∈ parentPassPrefix LB LP oldL bestL k → x ≤ capO + capB

Every entry of parentPassPrefix is bounded by capO + capB.

Word-RAM parent pass (parentPassProg) #

Register arguments for parentPassProg.

  • bagBPtr : ℕ

    Base memory address of child bag LB.

  • bagBLen : ℕ

    Length of child bag LB.

  • bagPPtr : ℕ

    Base memory address of parent bag LP.

  • bagPLen : ℕ

    Length of parent bag LP.

  • tblPPtr : ℕ

    Base memory address of parent DP table tblP.

  • tblPLen : ℕ

    Length 2 ^ |LP| of parent DP table tblP.

  • bestPtr : ℕ

    Base memory address of the scratch best array of length 2 ^ |LP|.

Instances For

    Accumulate best[restrictMask LB LP s] into tblP[s] in-place across 0 .. tblPLen - 1.

    theorem Cslib.Algorithms.WordRAM.TreeDecomposition.parentPassProg_spec {w : ℕ} (args : ParentPassArgs) {LB LP oldL bestL : List ℕ} {capO capB : ℕ} {s : DataStructure.Memory.State} (hLB : WordRAM.Realization.HoldsIn args.bagBPtr LB s) (hlenB : LB.length = args.bagBLen) (hLB_disj : args.bagBPtr + args.bagBLen ≤ args.tblPPtr) (hLP : WordRAM.Realization.HoldsIn args.bagPPtr LP s) (hlenP : LP.length = args.bagPLen) (hLP_disj : args.bagPPtr + args.bagPLen ≤ args.tblPPtr) (hold : WordRAM.Realization.HoldsIn args.tblPPtr oldL s) (hold_len : oldL.length = args.tblPLen) (htblP_pow : args.tblPLen = 2 ^ LP.length) (hbest_disj : args.tblPPtr + args.tblPLen ≤ args.bestPtr) (hbest : WordRAM.Realization.HoldsIn args.bestPtr bestL s) (hbest_len : bestL.length = 2 ^ LP.length) (hold_le : ∀ x ∈ oldL, x ≤ capO) (hbest_le : ∀ x ∈ bestL, x ≤ capB) (hfit_sum : WordRAM.Fits w (capO + capB)) :

    Correctness, outside-table framing, and memory-cost bound for parentPassProg.