
YW
Yuanhong Wang, Juhua Pu, Yuxu Zhou, Yuyi Wang, Ond\v{r}ej Ku\v{z}elka
· 1 min read
ResearcharXiv cs.AI
Solving Combinatorial Counting Problems with Weighted First-Order Model Counting
arXiv:2605.24845v2 Announce Type: replace
Abstract: Combinatorial counting asks how many structures satisfy a specification of dependent choices and constraints, underpinning tasks from assignment counting to probabilistic inference. Manual derivations are fragile when specifications change, and large language models offer no guarantee of correctness, motivating declarative methods that compute exact counts automatically. Weighted first-order model counting (WFOMC), originally developed for statistical relational inference, provides a natural foundation by expressing relational constraints uniformly in first-order logic. Its lifted algorithms exploit exchangeable domain elements to count without full grounding, running in polynomial time in the domain size for fixed sentences in tractable fragments. Bridging high-level specifications to these reusable WFOMC algorithms, however, requires a count-preserving translation handling multiplicities, redundant representations, and dependent choices. We introduce Cofola, a declarative language for combinatorial counting over sets, bags, tuples, sequences, partitions, and compositions, with backend-independent joint counting semantics. We compile Cofola into symbolic WFOMC via relational encodings, polynomial weights, and decoding rules, proving exact count preservation on a supported fragment under exact symbolic computation. For multiset scalability, we introduce an optional exchangeable bag factorization that shares multiplicity symbols across interchangeable entities while provably preserving counts. Across 695 real, synthetic, and growing-domain instances, our WFOMC pipeline solves 675 within a 100-second limit per run, outperforming four alternative counting pipelines. In a controlled ablation, bag factorization raises coverage from 13 to all 32 expanded multi-type bag instances.
Original source
This story was published by arXiv cs.AI and written by Yuanhong Wang, Juhua Pu, Yuxu Zhou, Yuyi Wang, Ond\v{r}ej Ku\v{z}elka. SyncAI.news shows a preview; the complete article is on the publisher's site.
Read the full story on arxiv.org


