5 #include "MapleCOMSPS_LRB/utils/System.h" 12 SATCNFMethod::SATCNFMethod(
const std::set<std::string> &SpSet,
const std::set<std::string> &SmSet,
const std::set<std::string> &SSet,
const std::set<std::string> &prefixesSet,
const std::set<char> &alphabetSet,
unsigned int n) :
13 Method(SpSet, SmSet, SSet, prefixesSet, alphabetSet, n),
24 m_solver = std::make_unique<SimpSolver>(*mustStop);
27 std::atomic_bool falseBool(
false);
28 m_solver = std::make_unique<SimpSolver>(falseBool);
30 m_solver->verbosity = 0;
36 if (mustStop && *mustStop) {
58 return toDFA(m_solver->model);
63 mustStop = &stopTrigger;
67 return m_solver->newVar();
71 m_solver->addClause(clause);
The namespace of the library.
void addClause(const Minisat::vec< Minisat::Lit > &clause)
Adds a new clause to the SAT solver.
std::unique_ptr< DFA< char > > constructDFA() override
Constructs the DFA induced by the variables according to the method.
virtual void createVariables()=0
Creates all needed variables for the method.
bool hasSolution() const
If solve() has been called and if there exists a solution, return True.
bool solve() override
Solves the SAT/SMT problem induced by the method.
The base class of all passive methods.
virtual std::unique_ptr< DFA< char > > toDFA(const Minisat::vec< Minisat::lbool > &model) const =0
Effectively creates the DFA from the values of the variables in the given model.
virtual void createClauses()=0
Creates all needed clauses for the method.
virtual void setStopTrigger(const std::chrono::seconds &timeLimit, std::atomic_bool &stopTrigger, const bool *stopPointer) override
Sets the stop trigger for this method.
Minisat::Var newVariable()
Creates a new variable in the SAT solver.