IPASIR-UP: User Propagators for CDCL

Katalin Fazekas, Aina Niemetz, Mathias Preiner, Markus Kirchweger, Stefan Szeider, Armin BiereSAT 2023

TL;DR

This paper introduces IPASIR-UP, a novel interface that extends the standard IPASIR interface for SAT solvers. IPASIR-UP allows external applications to not only interact with a SAT solver during its search but also to influence its internal decision-making process, enabling more sophisticated integrations for complex reasoning tasks.

What Problem Does This Paper Address?

Modern SAT solvers are increasingly used as building blocks in larger systems, such as Satisfiability Modulo Theories (SMT) solvers, combinatorial optimization tools, and model enumeration engines. While the standard IPASIR interface provides a way to integrate SAT solvers as black boxes, it offers limited interaction capabilities. Specifically, it doesn't allow for fine-grained control or inspection of the solver's internal state while it's actively searching. This limitation hinders applications that could benefit from dynamically guiding the SAT solver's search based on external knowledge or theory-specific information. For instance, SMT solvers need to communicate with the SAT solver during its search to guide it with theory-specific constraints, and combinatorial optimization problems might require adding clauses on the fly to prune the search space. Existing workarounds often involve complex modifications to the SAT solver itself, making it difficult to swap solvers or leverage new advancements.

Methods

The core contribution is the IPASIR-UP interface, an extension of the existing IPASIR interface. IPASIR-UP refines the "Solving" state of a CDCL (Conflict-Driven Clause Learning) SAT solver into five more granular states, allowing for callbacks at various stages of the search. Key new functionalities include:

  • Notifications: The external propagator (the application interacting with the SAT solver) is notified about changes to the solver's internal "trail" (assignments and decision levels) via notify_assignment and notify_new_decision_level. It's also informed about backtracking via notify_backtrack.
  • Callbacks for Influence: The external propagator can influence the solver's behavior through several callback functions:
  • cb_decide: To suggest specific variable decisions and their phases.
  • cb_propagate: To provide additional literals for propagation during unit propagation.
  • cb_add_reason_clause_lit: To provide explanations for user-propagated literals during conflict analysis.
  • cb_check_found_model: To validate a found SAT model against external constraints and potentially add new clauses.
  • cb_has_external_clause and cb_add_external_clause_lit: To dynamically add new clauses to the solver's problem during the search.

The authors implemented IPASIR-UP by extending CaDiCaL, a state-of-the-art incremental SAT solver.

Datasets

Not discussed in the paper. The evaluation uses standard SMT-LIB benchmarks and specific graph generation tasks for the SMS framework.

Key Insights and Ideas

  • Bridging the Gap: IPASIR-UP effectively bridges the gap between black-box SAT solver integration and deep, intrusive modifications. It offers a standardized way to achieve fine-grained control.
  • Dynamic Clause Addition: The ability to add clauses during the search (not just between solve() calls) is crucial for many advanced applications, avoiding the need to restart the search and lose valuable learned information.
  • Lazy Explanation: The cb_add_reason_clause_lit callback enables "lazy explanation," where the SAT solver requests reasons for user propagations only when they are relevant to a conflict, leading to more concise learned clauses.
  • Enabling New Applications: The interface is designed to simplify and improve use cases like SAT Modulo Symmetries (SMS) and CDCL(T) SMT solvers, where dynamic interaction is essential.

Key Results

The paper presents empirical evaluations on two main use cases:

  • SAT Modulo Symmetries (SMS): When used to generate isomorph-free graphs, CaDiCaL with IPASIR-UP showed performance improvements over the standard IPASIR interface, particularly by preserving the solver's trail across models. In some cases, it enabled solving problems beyond the reach of the previously used ASP solver (clingo).
  • SMT Solvers (cvc5): Integrating CaDiCaL with IPASIR-UP as the core SAT engine for the cvc5 SMT solver resulted in solving more benchmarks from the SMT-LIB 2022 release and a significant speedup (1.16x on commonly solved benchmarks) compared to cvc5's original, custom SAT engine. This demonstrates the benefit of using a modern, well-maintained SAT solver through a standardized interface.

Limitations and Future Work

  • Inprocessing Restrictions: For inprocessing (adding clauses during search), current implementations require observed variables to be "frozen," meaning they cannot be directly influenced by external decisions or propagations.
  • Proof Production: Proof production is noted as experimental and requires further extension for IPASIR-UP.
  • Future Directions: The authors suggest several avenues for future work:
  • Evaluating and extending proof production capabilities.
  • Supporting distinction between redundant and irredundant external clauses.
  • Exploring extensions for more direct control, such as deciding when to restart or backtrack.
  • Investigating the interface's applicability in other domains like MaxSAT, knowledge compilation, and QBF reasoning.

Summary updated

BibTeX
@inproceedings{fazekas2023ipasir,
  author = {Katalin Fazekas and Aina Niemetz and Mathias Preiner and Markus Kirchweger and Stefan Szeider and Armin Biere},
  title = {{IPASIR-UP: User Propagators for CDCL}},
  booktitle = {SAT},
  year = {2023},
  doi = {10.4230/lipics.sat.2023.8},
}
Figure