Cofola language compiles combinatorial counting into weighted first-order model counting
A research team introduces Cofola, a declarative language whose specifications compile into symbolic WFOMC, with a proof of exact count preservation and strong results on 695 test instances.
In plain words
Counting how many structures satisfy a set of rules, such as valid assignments, is slow and error-prone to do by hand. Cofola lets users write such counting problems declaratively and automatically translates them into an exact counting method called weighted first-order model counting. The authors prove the translation preserves counts and report it solved most of their test cases quickly.
What was announced
The paper, announced on arXiv, addresses a weakness in current practice: manual counting derivations break when specifications change, and large language models give no correctness guarantee. Cofola supports counting over sets, bags, tuples, sequences, partitions, and compositions with a backend-independent joint semantics. The compiler maps programs to symbolic WFOMC using relational encodings, polynomial weights, and decoding rules, and the authors prove exact count preservation for a supported fragment under exact symbolic computation.
For scalability, an optional exchangeable bag factorization shares multiplicity symbols across interchangeable entities while provably preserving counts. In an evaluation across 695 real, synthetic, and growing-domain instances, the pipeline solved 675 within 100 seconds per run, which the authors report outperforms four alternative counting pipelines. In a controlled ablation, bag factorization raised coverage from 13 to all 32 expanded multi-type bag instances. The results come from the authors' own benchmarks and have not been independently confirmed.
What it does not show
- The source is the paper abstract only; full technical details, proofs, and experimental setup are not covered.
Sources
Source-support review completed 3 Dec 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.
Coverage: arXiv: abstract.
Updates and corrections
No corrections so far.
First published 3 Dec 2026
New to the subject? AI from the Ground Up starts from the beginning.