dlinear
0.0.1
Delta-complete SMT solver for linear programming
|
This class provides an easy interface for using the underling solver. More...
#include <SmtSolver.h>
Public Member Functions | |
SmtSolver (Config config=Config{}) | |
Construct a new SmtSolver object with the given config . | |
SmtSolver (const std::string &filename) | |
Construct a new SmtSolver object with a default configuration ready to parse the filename . | |
void | Assert (const Formula &f) |
Assert a formula to the current context. | |
const SmtSolverOutput & | Parse () |
Parse the problem from the input indicated in the configuration. | |
const SmtSolverOutput & | Parse (const std::string &filename) |
Parse the problem from a file or standard input, overriding the configuration. | |
const SmtSolverOutput & | CheckSat () |
Check the satisfiability of the current context. | |
bool | Verify (const Box &model) const |
Check whether the model satisfies all the assertions loaded in the context. | |
Private Member Functions | |
bool | ParseInput () |
Parse the problem from the input indicated in the configuration. | |
Private Attributes | |
Config | config_ |
Configuration of the solver. | |
SmtSolverOutput | output_ |
Output of the solver. | |
Context | context_ |
Context obtained from the input file and passed to the SAT and SMT solvers. | |
This class provides an easy interface for using the underling solver.
Once the correct configuration is set, and the assertions loaded, the user can simply call CheckSat to get the result. It can handle the parsing of the input file or stream
or the user can assert the constraints manually
Definition at line 41 of file SmtSolver.h.
Construct a new SmtSolver object with the given config
.
config | configuration of the solver |
Definition at line 42 of file SmtSolver.cpp.
|
explicit |
Construct a new SmtSolver object with a default configuration ready to parse the filename
.
filename | name of the file to parse |
Definition at line 41 of file SmtSolver.cpp.
void dlinear::SmtSolver::Assert | ( | const Formula & | f | ) |
Assert a formula to the current context.
The formula will be added to the context and will be checked by the solver in the next call to CheckSat.
f | formula to assert |
std::runtime_error | if the formula is not in the correct format |
Definition at line 94 of file SmtSolver.cpp.
const SmtSolverOutput & dlinear::SmtSolver::CheckSat | ( | ) |
Check the satisfiability of the current context.
Definition at line 44 of file SmtSolver.cpp.
const SmtSolverOutput & dlinear::SmtSolver::Parse | ( | ) |
Parse the problem from the input indicated in the configuration.
All the variables and assertions will be added to the context. If the input contains the (check-sat) command, a satisfiability check will be performed.
std::runtime_error | if the input is not in the correct format or the files contains an unsupported command |
std::out_of_range | if the file try to access undeclared variables |
Definition at line 73 of file SmtSolver.cpp.
const SmtSolverOutput & dlinear::SmtSolver::Parse | ( | const std::string & | filename | ) |
Parse the problem from a file or standard input, overriding the configuration.
All the variables and assertions will be added to the context. If the input contains the (check-sat) command, a satisfiability check will be performed.
filename | name of the file to parse or an empty string for standard input |
std::runtime_error | if the input is not in the correct format or the files contains an unsupported command |
std::out_of_range | if the file try to access undeclared variables |
Definition at line 68 of file SmtSolver.cpp.
|
private |
Parse the problem from the input indicated in the configuration.
All the variables and assertions will be added to the context. If the input contains the (check-sat) command, a satisfiability check will be performed.
std::runtime_error | if the input is not in the correct format or the files contains an unsupported command |
std::out_of_range | if the file try to access undeclared variables |
Definition at line 101 of file SmtSolver.cpp.
|
nodiscard |
Check whether the model
satisfies all the assertions loaded in the context.
In other words, verifies if it is a SAT assignment for the input variables.
model | assignment to check |
model
satisfies all assignments model
Definition at line 66 of file SmtSolver.cpp.