Bag assignments indexed in radix q #
For dynamic programming over a tree decomposition of a constraint satisfaction problem over a finite
domain of size q > 0, tables at a bag listed by L : List V are indexed by natural numbers
m < q ^ L.length in mixed-arity base q.
ofRadix q L m: decodesminto an assignmentV → ℕtaking values< qonLand0outsideL.ofRadixFin q hq L m: decodesminto aFin q-valued assignment alongL.toRadix q L α: encodes an assignmentα : V → ℕrestricted toLas a number inFinset.range (q ^ L.length).
Machine-level running-time bounds for radix lookup, bag projection, and constraint evaluation live
in CslibFrontier.Algorithms.WordRAM.TreeDecomposition.CSP.
Main definitions #
Cslib.Algorithms.Lean.TreeDecomposition.ofRadixCslib.Algorithms.Lean.TreeDecomposition.ofRadixFinCslib.Algorithms.Lean.TreeDecomposition.toRadix
Main results #
Cslib.Algorithms.Lean.TreeDecomposition.toRadix_ofRadix: whenL.Nodupandm < q ^ L.length,toRadix q L (ofRadix q L m) = m.Cslib.Algorithms.Lean.TreeDecomposition.ofRadix_toRadix: when∀ v ∈ L, α v < q,ofRadix q L (toRadix q L α)agrees withαonL.
Decode m in base q into an assignment along the variable list L, defaulting to 0 off
L.
def Cslib.Algorithms.Lean.TreeDecomposition.ofRadixFin {V : Type u_1} [DecidableEq V] (q : ℕ) (hq : 0 < q) (L : List V) (m : ℕ) (x : V) :
Fin q
Decode m in base q into a Fin q-valued assignment along L.
theorem Cslib.Algorithms.Lean.TreeDecomposition.ofRadix_lt {V : Type u_1} [DecidableEq V] {q : ℕ} (hq : 0 < q) (L : List V) (m : ℕ) (x : V) :
theorem Cslib.Algorithms.Lean.TreeDecomposition.ofRadix_eq_zero_of_notMem {V : Type u_1} [DecidableEq V] {q : ℕ} (L : List V) (m : ℕ) {x : V} (hx : x ∉ L) :