Computing LPMLN Using ASP and MLN Solvers

Joohyung Lee, Samidh Talsania, Yi Wang · DOI

Abstract

LPMLN is a recent addition to probabilistic logic programming languages. Its main idea is to overcome the rigid nature of the stable model semantics by assigning a weight to each rule in a way similar to Markov Logic is defined. We present two implementations of LPMLN, $\text{LPMLN2ASP}$ and $\text{LPMLN2MLN}$. System $\text{LPMLN2ASP}$ translates LPMLN programs into the input language of answer set solver $\text{CLINGO}$, and using weak constraints and stable model enumeration, it can compute most probable stable models as well as exact conditional and marginal probabilities. System $\text{LPMLN2MLN}$ translates LPMLN programs into the input language of Markov Logic solvers, such as $\text{ALCHEMY}$, $\text{TUFFY}$, and $\text{ROCKIT}$, and allows for performing approximate probabilistic inference on LPMLN programs. We also demonstrate the usefulness of the LPMLN systems for computing other languages, such as ProbLog and Pearl's Causal Models, that are shown to be translatable into LPMLN.

Introduction

Logic and probability are often viewed as distinct domains. Answer Set Programming (ASP) excels at handling complex, discrete constraints but is inherently "rigid"—the failure of a single rule can cause an entire model to collapse. Conversely, Markov Logic Networks (MLN) manage uncertainty effectively but often struggle with the recursive structures common in logic programming.

This research explores $LP^{MLN}$, a language designed to bridge these two paradigms by incorporating weights into ASP rules. Rather than building a solver from scratch, the authors introduce two systems, LPMLN2ASP and LPMLN2MLN, which translate $LP^{MLN}$ programs into formats compatible with mature, high-performance solvers like CLINGO and TUFFY.

The LPMLN2ASP System

The LPMLN2ASP system utilizes a "penalty-based" approach. Instead of treating weights as rewards for satisfied rules, the semantics are reformulated such that unsatisfied rules incur a penalty. This allows $LP^{MLN}$ programs to be translated into ASP with weak constraints.

Architecture of the LPMLN2ASP system, illustrating the translation from weighted programs to ASP with weak constraints and the subsequent solver pipeline.

In this architecture, MAP (Maximum A Posteriori) inference—finding the most probable model—is transformed into an optimization problem that CLINGO handles natively by minimizing total penalties. For exact probability calculations, a Python wrapper facilitates the enumeration of stable models to determine marginal and conditional probabilities.

The LPMLN2MLN System

For "tight" programs (those lacking circular dependencies), the authors provide LPMLN2MLN. This system translates $LP^{MLN}$ into MLN using Clark’s completion. To prevent the exponential growth typically associated with conversion to Conjunctive Normal Form (CNF), the system employs the Tseytin transformation, keeping the resulting formulas computationally manageable for solvers like ALCHEMY or TUFFY.

Experimental Evaluation and Results

The systems were evaluated across several benchmarks, including synthetic graph problems (Relaxed Clique, Probabilistic Reachability) and real-world datasets like the Biomine Network (biological link prediction) and the Social Influence (Smokers) model.

Key findings include:

  • Scalability in MAP Inference: In the Biomine experiment, LPMLN2ASP significantly outperformed ProbLog2. While ProbLog2 timed out on graphs exceeding 1,600 nodes, LPMLN2ASP returned results within a few hundred seconds.
  • Efficiency of ASP Solvers: Surprisingly, ASP solvers—despite not being purpose-built for probability—often outperformed dedicated MLN solvers in MAP inference due to their highly optimized grounding and search algorithms.
  • Universal Encoding: The authors demonstrated that $LP^{MLN}$ can serve as a "lingua franca," successfully encoding ProbLog, Pearl’s Causal Models, and Bayesian Networks.

Limitations and Future Outlook

While powerful, the current implementations have constraints. LPMLN2MLN is restricted to tight programs, as recursive structures would require the addition of complex loop formulas. Furthermore, exact probability calculation in LPMLN2ASP is limited by the need to enumerate all stable models, which becomes a bottleneck in very large domains.

Future work points toward a "native" $LP^{MLN}$ solver that integrates the efficient grounding of ASP with the approximate sampling techniques found in MLN solvers to handle large-scale, recursive probabilistic logic problems.

Summary updated

Abstract

LPMLN is a recent addition to probabilistic logic programming languages. Its main idea is to overcome the rigid nature of the stable model semantics by assigning a weight to each rule in a way similar to Markov Logic is defined. We present two implementations of LPMLN, $\text{LPMLN2ASP}$ and $\text{LPMLN2MLN}$. System $\text{LPMLN2ASP}$ translates LPMLN programs into the input language of answer set solver $\text{CLINGO}$, and using weak constraints and stable model enumeration, it can compute most probable stable models as well as exact conditional and marginal probabilities. System $\text{LPMLN2MLN}$ translates LPMLN programs into the input language of Markov Logic solvers, such as $\text{ALCHEMY}$, $\text{TUFFY}$, and $\text{ROCKIT}$, and allows for performing approximate probabilistic inference on LPMLN programs. We also demonstrate the usefulness of the LPMLN systems for computing other languages, such as ProbLog and Pearl's Causal Models, that are shown to be translatable into LPMLN. (Under consideration for acceptance in TPLP)
BibTeX
@misc{lee2017computing,
  author = {Joohyung Lee and Samidh Talsania and Yi Wang},
  title = {{Computing LPMLN Using ASP and MLN Solvers}},
  year = {2017},
  eprint = {1707.06325},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.06325},
}
Figure