The binary method with a CNF SAT solver.
More...
#include <BinaryCNFMethod.h>
|
| typedef std::map< std::pair< std::string, unsigned int >, Gate * > | m_mapType |
| |
|
| | BinaryCNFMethod (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) |
| |
| virtual void | createVariables () |
| |
| virtual Gate * | createFormula () |
| |
| Gate * | equal (const std::string &u, const std::string &v) |
| |
| Gate * | phi_different (const std::string &u, const std::string &v) |
| |
| Gate * | phi_not_q_i (const std::string &u, unsigned int i) |
| |
| unsigned int | toState (const std::string &u) const |
| |
| std::unique_ptr< DFA< char > > | toDFA () const |
| |
| | Method (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) |
| | Creates the method. More...
|
| |
|
| static bool | s_registered |
| | Useful to make sure the template is correctly used by the compiler. More...
|
| |
The binary method with a CNF SAT solver.
Since we need to use a tool to translate the boolean formula in CNF, this implementation is different from the other methods relying on CNF Solvers.
Definition at line 22 of file BinaryCNFMethod.h.
◆ m_mapType
◆ BinaryCNFMethod() [1/2]
| gsjj::passive::CNF::BinaryCNFMethod::BinaryCNFMethod |
( |
| ) |
|
|
delete |
◆ ~BinaryCNFMethod()
| gsjj::passive::CNF::BinaryCNFMethod::~BinaryCNFMethod |
( |
| ) |
|
|
virtual |
◆ BinaryCNFMethod() [2/2]
| gsjj::passive::CNF::BinaryCNFMethod::BinaryCNFMethod |
( |
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 |
|
) |
| |
|
protected |
◆ constructDFA()
| std::unique_ptr< DFA< char > > gsjj::passive::CNF::BinaryCNFMethod::constructDFA |
( |
| ) |
|
|
overridevirtual |
Constructs the DFA induced by the variables according to the method.
If the SAT/SMT problem has not yet been solved, the function automatically solves it. If the SAT/SMT problem is unsolvable, returns a null pointer.
- Returns
- An unique_ptr to the constructed DFA or an empty pointer if the problem is not solvable
Implements gsjj::passive::Method.
Definition at line 67 of file BinaryCNFMethod.cpp.
◆ createFormula()
| Gate * gsjj::passive::CNF::BinaryCNFMethod::createFormula |
( |
| ) |
|
|
protectedvirtual |
◆ createVariables()
| void gsjj::passive::CNF::BinaryCNFMethod::createVariables |
( |
| ) |
|
|
protectedvirtual |
◆ equal()
| Gate * gsjj::passive::CNF::BinaryCNFMethod::equal |
( |
const std::string & |
u, |
|
|
const std::string & |
v |
|
) |
| |
|
protected |
◆ getFactoryName()
| std::string gsjj::passive::CNF::BinaryCNFMethod::getFactoryName |
( |
| ) |
|
|
static |
◆ phi_different()
| Gate * gsjj::passive::CNF::BinaryCNFMethod::phi_different |
( |
const std::string & |
u, |
|
|
const std::string & |
v |
|
) |
| |
|
protected |
◆ phi_not_q_i()
| Gate * gsjj::passive::CNF::BinaryCNFMethod::phi_not_q_i |
( |
const std::string & |
u, |
|
|
unsigned int |
i |
|
) |
| |
|
protected |
◆ setStopTrigger()
| void gsjj::passive::CNF::BinaryCNFMethod::setStopTrigger |
( |
const std::chrono::seconds & |
timeLimit, |
|
|
std::atomic_bool & |
stopTrigger, |
|
|
const bool * |
stopPointer |
|
) |
| |
|
overridevirtual |
Sets the stop trigger for this method.
Since we use three different solvers and each has its own way to stop (CVC4 uses a function to set a time limit, Maple is in C++ so we can use an atomic variable and Limboole is in C and we must use a pointer), we must provide each possibility
- Parameters
-
| timeLimit | The time in seconds the method can take. It's used by SMT methods. |
| stopTrigger | The atomic_bool variable. Once set to true, the method will stop. It's used by CNF methods. |
| stopPointer | The pointer variable. Once the value is set to true, the method will stop. It's used by NonCNF methods. |
Implements gsjj::passive::Method.
Definition at line 97 of file BinaryCNFMethod.cpp.
◆ solve()
| bool gsjj::passive::CNF::BinaryCNFMethod::solve |
( |
| ) |
|
|
overridevirtual |
Solves the SAT/SMT problem induced by the method.
Il also creates every variable and clause needed
- Returns
- True iff the problem is solvable
Implements gsjj::passive::Method.
Definition at line 44 of file BinaryCNFMethod.cpp.
◆ toDFA()
| std::unique_ptr< DFA< char > > gsjj::passive::CNF::BinaryCNFMethod::toDFA |
( |
| ) |
const |
|
protected |
◆ toState()
| unsigned int gsjj::passive::CNF::BinaryCNFMethod::toState |
( |
const std::string & |
u | ) |
const |
|
protected |
◆ m_binarySize
| unsigned int gsjj::passive::CNF::BinaryCNFMethod::m_binarySize |
|
protected |
◆ m_simplify_opts
| SimplifyOptions gsjj::passive::CNF::BinaryCNFMethod::m_simplify_opts |
|
protected |
◆ m_solver
| std::unique_ptr<BC> gsjj::passive::CNF::BinaryCNFMethod::m_solver |
|
protected |
◆ m_stateToVar
| m_mapType gsjj::passive::CNF::BinaryCNFMethod::m_stateToVar |
|
protected |
The documentation for this class was generated from the following files: