Public ElimInstance Bundle and Serialization #
Defines the word-list factor serializer encodeFactor and the public ElimInstance bundle
(including initState, result, maxEntry, encode, wordBound, stepBound, ofCSP, and
result_ofCSP) for bucket elimination on the exact-basis Word-RAM. Kept free of Realization and
Tactic.Realize dependencies so pure clients stay lightweight.
Main definitions #
Cslib.Algorithms.WordRAM.VariableElimination.encodeFactor: word-array serialization of aFactorTable ℕ ℕ.Cslib.Algorithms.WordRAM.VariableElimination.ElimInstance: input bundle (domain,declared,order,factors) together with its encoding, word-width bound, and step-bound functions.
Main results #
Cslib.Algorithms.WordRAM.VariableElimination.ElimInstance.result_ofCSP: connectsElimInstance.ofCSPtoCSP.partitionFunctionOn.
Word-array serialization of a factor table: [f.scope.length, f.entries.size] ++ f.scope ++ f.entries.toList.
Word-RAM input bundle for bucket (variable) elimination over explicit ℕ-valued radix-indexed
factor tables at finite domain size domain.
Initial pure elimination state ElimState.ofFactors inst.factors inst.declared.
Maximum entry across all initial factor tables (0 if all tables are empty).
Word-array serialization of inst:
[inst.domain, inst.declared.length, inst.order.length, inst.factors.length] ++ inst.declared ++ inst.order ++ inst.factors.flatMap encodeFactor.
Word-value upper bound covering literal constants, peak memory frontier across the entire
elimination run, radix powers (max 1 domain) ^ max S W, and intermediate/final weighted sums
(max 1 domain) ^ order.length * (max 1 maxEntry) ^ factors.length.
Upper bound on the oracle memory cost (memoryCost) of bucket elimination along inst.order,
exponential only in W = maxJointScopeLen ((max 1 domain) ^ W) with amortized M + T bucket
factor evaluations.
Compile a ℕ-weighted CSP Rel ℕ over finite domain D ≃ Fin d with declared variable list
declared and elimination order order into an ElimInstance.
ElimInstance.ofCSP evaluates to F.partitionFunctionOn wt declared.toFinset whenever
declared contains all occurring variables of F and order covers declared.