8#include <triton/config.hpp>
20 #if defined(TRITON_Z3_INTERFACE)
23 #elif defined(TRITON_BITWUZLA_INTERFACE)
44 #ifdef TRITON_Z3_INTERFACE
48 if (this->
solver ==
nullptr)
52 #ifdef TRITON_BITWUZLA_INTERFACE
56 if (this->
solver ==
nullptr)
72 if (customSolver ==
nullptr)
76 this->
solver.reset(customSolver);
92 return std::unordered_map<triton::usize, SolverModel>{};
93 return this->
solver->getModel(node, status, timeout, solvingTime);
99 return std::vector<std::unordered_map<triton::usize, SolverModel>>{};
100 return this->
solver->getModels(node, limit, status, timeout, solvingTime);
107 return this->
solver->isSat(node, status, timeout, solvingTime);
114 return this->
solver->getName();
120 this->
solver->setTimeout(ms);
127 this->
solver->setMemoryLimit(limit);
Solver engine using Bitwuzla.
TRITON_EXPORT std::string getName(void) const
Returns the name of the solver.
TRITON_EXPORT SolverEngine()
Constructor.
TRITON_EXPORT void setSolver(triton::engines::solver::solver_e kind)
Initializes a predefined solver.
TRITON_EXPORT void setCustomSolver(triton::engines::solver::SolverInterface *customSolver)
Initializes a custom solver.
TRITON_EXPORT triton::engines::solver::solver_e getSolver(void) const
Returns the kind of solver as triton::engines::solver::solver_e.
TRITON_EXPORT void setTimeout(triton::uint32 ms)
Defines a solver timeout (in milliseconds).
TRITON_EXPORT std::unordered_map< triton::usize, SolverModel > getModel(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Computes and returns a model from a symbolic constraint. State is returned in the status pointer as w...
TRITON_EXPORT const triton::engines::solver::SolverInterface * getSolverInstance(void) const
Returns the instance of the initialized solver.
triton::engines::solver::solver_e kind
The kind of the current solver used.
std::unique_ptr< triton::engines::solver::SolverInterface > solver
Instance to the real solver class.
TRITON_EXPORT std::vector< std::unordered_map< triton::usize, SolverModel > > getModels(const triton::ast::SharedAbstractNode &node, triton::uint32 limit, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Computes and returns several models from a symbolic constraint. The limit is the max number of models...
TRITON_EXPORT bool isValid(void) const
Returns true if the solver is valid.
TRITON_EXPORT void setMemoryLimit(triton::uint32 mem)
Defines a solver memory consumption limit (in megabytes).
TRITON_EXPORT bool isSat(const triton::ast::SharedAbstractNode &node, triton::engines::solver::status_e *status=nullptr, triton::uint32 timeout=0, triton::uint32 *solvingTime=nullptr) const
Returns true if an expression is satisfiable.
This interface is used to interface with solvers.
The exception class used by the solver engine.
std::shared_ptr< triton::ast::AbstractNode > SharedAbstractNode
Shared Abstract Node.
std::uint32_t uint32
unisgned 32-bits