Solving Combinatorial Counting Problems with Weighted First-Order Model Counting
School of Artificial Intelligence, Jilin University, Changchun, China;State Key Laboratory of Complex \& Critical Software Environment, Beihang University, China;National Research Center for Educational Materials, China;Tengen Intelligence Institute, China;Czech Technical University in Prague, Prague, Czech Republic
Combinatorial counting problems pervade artificial intelligence, statistics, and discrete mathematics. Whether the task is enumerating subsets, multisets, permutations, partitions, or compositions under structural and arithmetic constraints, solving it remains a stubbornly manual exercise. Closed-form derivations are powerful but brittle, while naive encodings to propositional model counting or constraint satisfaction destroy the exchangeability that makes counting tractable in the first place. We present Cofola (COmbinatorial counting LAnguage with First-Order logic), a typed declarative language whose primitives are the combinatorial objects that recur in everyday counting questions, including sets, bags, tuples, sequences, circles, partitions, and compositions, together with natural relational and arithmetic constraints over them. A denotational semantics maps every Cofola program to a well-defined combinatorial counting problem, and a three-phase compilation pipeline (preprocessing, decomposition, and symmetry-preserving encoding) reduces this problem to a weighted first-order model counting (WFOMC) instance augmented with coefficient-extraction constraints. To stay inside known domain-liftable fragments whenever possible, the encoding groups indistinguishable entities, breaks the symmetry of unordered groupings lexicographically, and encodes sequences and circles via order axioms. On a suite of representative combinatorial counting problems, ranging from textbook math problems to multi-object scenarios that the closest prior framework cannot express, Cofola produces concise specifications and a uniform solving pipeline that is practical end-to-end.
CombEval: A Framework for Evaluating Combinatorial Counting in Large Language Models
School of Artificial Intelligence, Jilin University(吉林大学人工智能学院);Czech Technical University in Prague(捷克布拉格理工大学);CRRC Zhuzhou Institute(中车株洲研究所);Tengen Intelligence Institute(天元智能研究院);International Center of Future Science, Jilin University(吉林大学未来科学国际合作中心);Engineering Research Center of Knowledge-Driven Human-Machine Intelligence, MOE(教育部知识驱动人机智能工程研究中心)
On the Approximability of Weighted Model Integration on DNF Structures
University of Oxford(牛津大学)
加权模型计数(Weighted Model Counting,WMC)是计算一个命题公式的所有满足赋值的加权和。WMC是众所周知的是精确求解的#P-困难,但承认一个完全多项式随机逼近方案(FPRAS)时,限制到DNF结构。在这项工作中,我们研究加权模型集成,加权模型计数的推广,其中涉及到真实的变量,除了命题变量,并提出以下问题:是否加权模型集成DNF结构承认FPRAS?基于近似体积计算和近似加权模型计数的经典结果,我们证明了DNF结构上的加权模型积分确实可以近似为一类权重函数。我们的近似算法基于三个子程序,每个子程序都可以是弱(即,近似的),或强的(即,精确)Oracle,并且在所有情况下都有准确性保证。我们通过实验验证了我们的方法在不同大小的随机生成的DNF实例,并表明我们的算法可扩展到大型问题实例,涉及多达1 K个变量,这是目前现有的通用加权模型集成求解器无法达到的。