11#include "dlinear/util/exception.h"
12#include "dlinear/util/filesystem.h"
21 if (disable_expansion_.
get())
return false;
26 switch (lp_mode_.
get()) {
30 return lp_mode_.
get();
34 switch (format_.
get()) {
43 DLINEAR_RUNTIME_ERROR(
"Cannot determine format from stdin or unknown file extension");
49 switch (bound_propagation_type_.
get()) {
59 DLINEAR_UNREACHABLE();
62 return bound_propagation_type_.
get();
66 switch (bound_propagation_frequency_.
get()) {
76 DLINEAR_UNREACHABLE();
79 return bound_propagation_frequency_.
get();
83 switch (bound_implication_frequency_.
get()) {
92 DLINEAR_UNREACHABLE();
95 return bound_implication_frequency_.
get();
100 switch (sat_default_phase) {
102 return os <<
"False";
106 return os <<
"Jeroslow-Wang";
108 return os <<
"Random Initial Phase";
110 DLINEAR_UNREACHABLE();
114std::ostream &operator<<(std::ostream &os,
const Config::LPSolver &lp_solver) {
117 return os <<
"qsoptex";
119 return os <<
"soplex";
121 DLINEAR_UNREACHABLE();
126 switch (sat_solver) {
128 return os <<
"cadical";
130 return os <<
"picosat";
132 DLINEAR_UNREACHABLE();
136std::ostream &operator<<(std::ostream &os,
const Config::Format &format) {
145 return os <<
"vnnlib";
147 DLINEAR_UNREACHABLE();
151std::ostream &operator<<(std::ostream &os,
const Config::LPMode &mode) {
162 DLINEAR_UNREACHABLE();
171 return os <<
"eq-binomial";
173 return os <<
"eq-polynomial";
175 return os <<
"bound-polynomial";
177 DLINEAR_UNREACHABLE();
186 return os <<
"never";
188 return os <<
"on-fixed";
190 return os <<
"on-iteration";
192 return os <<
"always";
194 DLINEAR_UNREACHABLE();
198std::ostream &operator<<(std::ostream &os,
const Config &config) {
199 return os <<
"Config {\n"
200 <<
"bound_implication_frequency = " << config.bound_implication_frequency() <<
",\n"
201 <<
"bound_propagation_frequency = " << config.bound_propagation_frequency() <<
",\n"
202 <<
"bound_propagation_type = " << config.bound_propagation_type() <<
",\n"
203 <<
"csv = " << config.csv() <<
",\n"
204 <<
"complete = " << config.complete() <<
",\n"
205 <<
"continuous_output = " << config.continuous_output() <<
",\n"
206 <<
"debug_parsing = " << config.debug_parsing() <<
",\n"
207 <<
"debug_scanning = " << config.debug_scanning() <<
",\n"
208 <<
"disable_expansion = " << config.disable_expansion() <<
",\n"
209 <<
"enforce_check_sat = " << config.enforce_check_sat() <<
",\n"
210 <<
"filename = '" << config.filename() <<
"',\n"
211 <<
"format = '" << config.format() <<
"',\n"
212 <<
"lp_mode = '" << config.lp_mode() <<
"',\n"
213 <<
"lp_solver = " << config.lp_solver() <<
",\n"
214 <<
"number_of_jobs = " << config.number_of_jobs() <<
",\n"
215 <<
"onnx_file = '" << config.onnx_file() <<
",\n"
216 <<
"optimize = '" << config.optimize() <<
"',\n"
217 <<
"precision = " << config.precision() <<
",\n"
218 <<
"produce_model = " << config.produce_models() <<
",\n"
219 <<
"random_seed = " << config.random_seed() <<
",\n"
220 <<
"read_from_stdin = " << config.read_from_stdin() <<
",\n"
221 <<
"sat_default_phase = " << config.sat_default_phase() <<
",\n"
222 <<
"sat_solver = " << config.sat_solver() <<
",\n"
223 <<
"silent = " << config.silent() <<
",\n"
224 <<
"simplex_sat_phase = " << config.simplex_sat_phase() <<
",\n"
225 <<
"skip_check_sat = " << config.skip_check_sat() <<
",\n"
226 <<
"verbose_dlinear = " << config.verbose_dlinear() <<
",\n"
227 <<
"verbose_simplex = " << config.verbose_simplex() <<
",\n"
228 <<
"verify = " << config.verify() <<
",\n"
229 <<
"with_timings = " << config.with_timings() <<
",\n"
SatSolver
Underlying SAT solver used by the abstract SAT solver.
@ CADICAL
Cadical Solver. Default option.
LPMode
LP mode used by the LP solver.
@ HYBRID
Use both modes, if available.
@ PURE_PRECISION_BOOSTING
Use the precision boosting mode, if available.
@ AUTO
Let the LP solver choose the mode. Default option.
@ PURE_ITERATIVE_REFINEMENT
Use the iterative refinement mode, if available.
Format
Format of the input file.
@ AUTO
Automatically detect the input format based on the file extension. Default option.
BoundPropagationType actual_bound_propagation_type() const
Get read-only access to the actual actual_bound_propagation_type parameter of the configuration.
BoundPropagationType
Types of bound propagation supported by the bound propagator.
@ EQ_POLYNOMIAL
Only propagate bound in theory formulae in the form .
@ EQ_BINOMIAL
Only propagate bounds in theory formulas in the form .
@ BOUND_POLYNOMIAL
Propagate all possible constraints.
@ AUTO
Automatically select the best configuration based on expected performance. Default option.
PreprocessingRunningFrequency actual_bound_implication_frequency() const
Get read-only access to the actual bound_implication_frequency parameter of the configuration.
LPSolver
Underlying LP solver used by the theory solver.
@ SOPLEX
Soplex Solver. Default option.
Format actual_format() const
Get read-only access to the actual format parameter of the configuration.
const Format & format() const
Get read-write access to the format parameter of the configuration.
PreprocessingRunningFrequency
Frequency at which the preprocessors will run.
@ ON_ITERATION
Run this preprocess only at every iteration.
@ NEVER
Never run this preprocess, effectively disabling it.
@ ON_FIXED
Run this preprocess only once, on fixed literals, before all iterations.
@ AUTO
Automatically select the best configuration based on expected performance. Default option.
@ ALWAYS
Run this preprocess at every chance it gets. Usually combines ON_FIXED and ON_ITERATION.
PreprocessingRunningFrequency actual_bound_propagation_frequency() const
Get read-only access to the actual bound_propagation_frequency parameter of the configuration.
Config()=default
Construct a new Config object.
std::string filename_extension() const
Get read-only access to the filename extension of the configuration.
SatDefaultPhase
Phase for the SAT solver.
@ RandomInitialPhase
Randomly assign a value to non fixed decision literals.
@ JeroslowWang
Default option.
@ True
Assign true to non fixed decision literals.
@ False
Assign false to non fixed decision literals.
LPMode actual_lp_mode() const
Get read-only access to the actual lp_mode parameter of the configuration.
bool needs_expansion() const
const T & get() const
Get read-only access to the internal stored value of the optional value.
Global namespace for the dlinear library.
std::string GetExtension(const std::string &name)
Get the extension of the file.