9#ifndef DLINEAR_ENABLED_CADICAL
10#error CaDiCaL is not enabled. Please enable it by adding "--//tools:enable_cadical" to the bazel command.
13#include <cadical/cadical.hpp>
18#include "dlinear/solver/SatSolver.h"
19#include "dlinear/symbolic/PredicateAbstractor.h"
20#include "dlinear/symbolic/literal.h"
21#include "dlinear/symbolic/symbolic.h"
36 const std::string &class_name =
"CadicalSatSolver");
45 std::optional<Model>
CheckSat()
override;
SAT solver based on CaDiCal.
std::optional< Model > CheckSat() override
Check the satisfiability of the current configuration.
CaDiCaL::Solver sat_
SAT solver.
void AddLearnedClause(const LiteralSet &literals) override
Given a clause = {f₁, ..., fₙ}, adds a clause (¬f₁ ∨ ... ∨ ¬ fₙ) to the solver.
void AddClauseToSat(const Formula &f) override
Add a clause f to the internal SAT solver.
void Assume(const Literal &l) override
Assumption a literals to be fixed for the next iteration.
LiteralSet FixedTheoryLiterals()
Get the theory literals that are fixed in the current configuration.
std::set< int > GetMainActiveLiterals() override
Get a set of the currently active literals in the clauses, ignoring those required by learned clauses...
void MakeSatVar(const Variable &var) override
Add a variable to the internal SAT solver.
void AddLiteral(const Literal &l, bool learned) override
Add a literal l to the SAT solver.
int next_var_id_
Next variable id.
Predicate abstraction is a method to convert a first-order logic formula into a Boolean formula.
Base class for SAT solvers.
const PredicateAbstractor & predicate_abstractor() const
Get read-only access to the predicate abstractor of the SAT solver.
LiteralSet FixedTheoryLiterals()
Get the theory literals that are fixed in the current configuration.
void Assume(const LiteralSet &literals)
Assumption a set of literals to be fixed for the next iteration.
Represents a symbolic variable.
Global namespace for the dlinear library.
std::set< Literal > LiteralSet
A set of literals.
A literal is a variable with an associated truth value, indicating whether it is true or false.