Abstract
It was recently shown that the symmetric weighted first-order model counting problem (WFOMC) for sentences of two-variable logic $FO^2$ is in polynomial time, while it is #P$_1$-complete for some $FO^3$-sentences. This paper extends the tractability result for $FO^2$ in two independent directions: to sentences of the form $\phi \land \forall x \exists^{=1} y \psi(x, y)$ where $\phi, \psi \in FO^2$, and to sentences formulated in the uniform one-dimensional fragment of $FO$ ($U_1$). The former generalizes the extension of $FO^2$ with a functional relation symbol. Additionally, we provide a complete classification of first-order prefix classes, establishing that WFOMC is in polynomial time if the prefix length is less than three, and #P$_1$-complete otherwise.
Introduction
First-order model counting (FOMC) is a fundamental problem in computational logic and artificial intelligence. Given a logical sentence and a domain size $n$, the goal is to determine the number of distinct mathematical structures (models) that satisfy the sentence. In its weighted variant (WFOMC), weights are assigned to relations, and the task is to compute the total weight of all valid models. This process serves as the computational engine for modern probabilistic reasoning frameworks, including Markov Logic Networks and probabilistic programming.
For years, the "tractability frontier" for WFOMC has been defined by two-variable logic ($FO^2$). While $FO^2$ is expressive enough to model many real-world constraints, it is limited by its inability to handle functional relations (e.g., "every person has exactly one biological father") or relations involving more than two objects. Conversely, moving to three-variable logic ($FO^3$) typically renders the problem #P-complete. This research identifies new fragments of logic that bridge this gap, offering greater expressivity while maintaining polynomial-time (PTIME) complexity.
Expanding the Tractable Fragments
Functionality in Two-Variable Logic
A significant contribution of this work is the extension of $FO^2$ to include functionality axioms. Specifically, the authors prove that WFOMC remains in PTIME for sentences that combine $FO^2$ with a requirement of the form $\forall x \exists^{=1} y \psi(x, y)$.
To achieve this, the authors developed a sophisticated combinatorial counting method. By partitioning the domain into "blocks" and "cells," they track "witnesses"—the unique elements that satisfy the functional requirement. This allows for the derivation of complex arithmetic formulas using multinomial coefficients and double factorials, enabling the counting of valid configurations without the need for explicit model construction.
The Uniform One-Dimensional Fragment ($U_1$)
The research also explores the uniform one-dimensional fragment ($U_1$), a recently introduced extension of $FO^2$ that allows for relation symbols of any arity. Usually, increasing the arity of relations leads to exponential complexity. However, $U_1$ restricts quantifiers such that they are "one-dimensional," leaving only one variable free at a time.
The authors demonstrate that any $U_1$ sentence can be transformed into a Boolean combination of sentences in a more restricted fragment, $SU_1$ (Surjective $U_1$), through a "surjective completion" method. They successfully prove that WFOMC for $SU_1$ is solvable in PTIME, thereby extending tractability to relations of arbitrary arity within this fragment.
The "Rule of Three" in Prefix Classes
Beyond identifying specific tractable fragments, the paper provides a definitive classification of first-order prefix classes. The complexity of WFOMC is shown to depend not on the specific arrangement of quantifiers (e.g., $\forall \exists \forall$ vs. $\exists \forall \forall$), but strictly on the number of quantifiers.
- Prefix length < 3: WFOMC is in PTIME.
- Prefix length ≥ 3: WFOMC is #P$_1$-complete.
This "Rule of Three" establishes a sharp boundary for the complexity of first-order logic prefixes. To prove this, the authors utilized a generalized Skolemization procedure, showing that any known "hard" formula can be embedded within a three-quantifier prefix to maintain its computational hardness.
Conclusion and Future Work
This work significantly pushes the boundaries of what is considered computationally feasible in probabilistic logic. By proving that functionality and higher-arity relations (within $U_1$) do not necessarily break tractability, it opens new doors for more expressive probabilistic databases and knowledge representation.
However, limitations remain. These results apply specifically to symmetric WFOMC, where weights depend only on the relation symbol rather than specific domain elements. Furthermore, the current proof for functionality only supports a single functionality axiom; handling multiple, interacting functional relations remains an open challenge. Future research may also explore extending these techniques to $C^2$ (two-variable logic with counting quantifiers), potentially further expanding the reach of efficient weighted model counting.
Summary updated