6#include "SmtSolverOutput.h"
12#include "dlinear/util/exception.h"
29 DLINEAR_UNREACHABLE();
48 DLINEAR_UNREACHABLE();
53 return std::nextafter(
actual_precision.get_d(), std::numeric_limits<double>::infinity());
82 return result == expectation;
98 DLINEAR_UNREACHABLE();
102std::ostream& operator<<(std::ostream& os,
const SmtResult& bound) {
105 return os <<
"unsat";
107 return os <<
"skip-sat";
109 return os <<
"unsolved";
113 return os <<
"delta-sat";
115 return os <<
"unknown";
117 return os <<
"error";
119 return os <<
"optimal";
121 return os <<
"delta-optimal";
123 return os <<
"unbounded";
125 return os <<
"infeasible";
127 DLINEAR_UNREACHABLE();
131std::ostream& operator<<(std::ostream& os,
const SmtSolverOutput& s) {
134 return os <<
"unsolved";
136 return os <<
"unknown";
138 return os <<
"error";
143 os <<
"delta-sat with delta = " << s.precision_upper_bound() <<
" ( > " << s.actual_precision <<
" )";
149 os <<
"optimal with delta = 0, range = [" << s.lower_bound <<
", " << s.upper_bound <<
"]";
152 mpq_class diff = s.upper_bound - s.lower_bound;
153 os <<
"delta-optimal with delta = " << diff.get_d() <<
" ( = " << diff <<
"), range = [" << s.lower_bound <<
", "
154 << s.upper_bound <<
"]";
163 os <<
"No satisfiability check was performed\n"
164 "To use the SAT solver, remove the option --skip-check-sat\n"
168 DLINEAR_UNREACHABLE();
170 if (s.with_timings) {
171 os <<
" after " << s.smt_solver_timer.seconds() <<
" seconds\n"
172 << s.parser_stats <<
"\n"
173 << s.ite_stats <<
"\n"
174 << s.cnfizer_stats <<
"\n"
175 << s.predicate_abstractor_stats <<
"\n"
176 << s.preprocessor_stats <<
"\n"
177 << s.sat_stats <<
"\n"
180 if (!s.model.empty() && s.produce_models) {
181 os <<
"\n" << s.model;
Global namespace for the dlinear library.
SatResult
Result of running the theory solver over the literals decided by the SAT solver.
@ SAT_NO_RESULT
No result has been obtained yet.
@ SAT_SATISFIABLE
The problem is satisfiable.
@ SAT_UNSATISFIABLE
The problem is unsatisfiable.
@ SAT_UNSOLVED
The problem has not been solved. An error may have occurred.
@ SAT_DELTA_SATISFIABLE
The problem is satisfiable, but with a delta >= 0.
SmtResult
SmtSolver Result based on the result of the solver.
@ UNSAT
The problem is unsatisfiable.
@ SAT
The problem is satisfiable.
@ UNKNOWN
Could not determine satisfiability.
@ INFEASIBLE
The problem is infeasible.
@ DELTA_OPTIMAL
The optimization problem is delta-optimal.
@ UNBOUNDED
The problem is unbounded.
@ ERROR
An error occurred.
@ SKIP_SAT
The user asked to skip the satisfiability check.
@ DELTA_SAT
The problem is delta-satisfiable.
@ OPTIMAL
The optimization problem is optimal.
@ UNSOLVED
The solver has not yet been run.
LpResult
Result of running the LP solver over the input problem.
@ LP_INFEASIBLE
The problem is infeasible.
@ LP_NO_RESULT
No result has been obtained yet.
@ LP_UNBOUNDED
The problem is unbounded.
@ LP_UNSOLVED
The problem has not been solved. An error may have occurred.
@ LP_DELTA_OPTIMAL
The problem has been solved optimally, but with a delta.
@ LP_OPTIMAL
The problem has been solved optimally.
mpq_class actual_precision
Actual precision of the computation. Always <= than precision.
int exit_code() const
Exit code of the solver to return to the user.
double precision_upper_bound() const
Return the precision upper bound.
SmtResult result
Result of the computation.
bool matches_expectation(SmtResult expectation) const
Check if the result of the computation matches the expectation.