9#ifndef DLINEAR_ENABLED_PICOSAT
10#error PicoSAT is not enabled. Please enable it by adding "--//tools:enable_picosat" to the bazel command.
13#include <picosat/picosat.h>
19#include "dlinear/solver/SatSolver.h"
20#include "dlinear/symbolic/PredicateAbstractor.h"
21#include "dlinear/symbolic/literal.h"
22#include "dlinear/symbolic/symbolic.h"
37 const std::string &class_name =
"PicosatSatSolver");
47 std::optional<Model>
CheckSat()
override;
62 PicoSAT *
const sat_{};
64 bool has_picosat_pop_used_;
PicoSAT is a SAT solver written in C.
std::optional< Model > CheckSat() override
Check the satisfiability of the current configuration.
void MakeSatVar(const Variable &var) override
Add a variable to the internal SAT solver.
void AddLearnedClause(const LiteralSet &literals) override
Given a clause = {f₁, ..., fₙ}, adds a clause (¬f₁ ∨ ... ∨ ¬ fₙ) to the 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.
void AddLiteral(const Literal &l, bool learned) override
Add a literal l to the SAT solver.
void AddClauseToSat(const Formula &f) override
Add a clause f to the internal SAT solver.
std::set< int > GetMainActiveLiterals() override
Get a set of the currently active literals in the clauses, ignoring those required by learned clauses...
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.