17#include "dlinear/util/OptionValue.hpp"
21#define DLINEAR_PARAMETER(param_name, type, default_value, help) \
24 OptionValue<type> &m_##param_name() { return param_name##_; } \
26 [[nodiscard]] const type ¶m_name() const { return param_name##_.get(); } \
27 static constexpr type default_##param_name{default_value}; \
28 static constexpr const char *const help_##param_name{help}; \
31 OptionValue<type> param_name##_{default_value};
101 static constexpr std::string_view help_onnx_file{
"ONNX file name"};
102 static constexpr std::string_view help_filename{
"Input file name"};
105 [[nodiscard]] std::string
filename()
const {
return filename_.
get(); }
111 [[nodiscard]] std::string
onnx_file()
const {
return onnx_file_.
get(); }
150 OptionValue<std::string> onnx_file_{
""};
153 "The type of bound propagation to apply in the preprocessing phase.\n"
154 "\t\tEach of the options is more complete and expensive than the previous one.\n"
155 "\t\tOne of: auto (1), eq-binomial (2), eq-polynomial (3), bound-polynomial (4)")
157 "How often to run the generic bound propagation preprocessing.\n"
158 "\t\tOne of: auto (1), never (2), on-fixed (3), on-iteration (4), always (5)")
160 "How often to run the bound implication preprocessing.\n"
161 "\t\tOne of: auto (1), never (2), always (3)")
162 DLINEAR_PARAMETER(
complete,
bool, false,
163 "Run the solver in
complete mode.\n"
164 "\t\tThe
precision will be set to 0 and strict inequalities will be taken into account")
166 DLINEAR_PARAMETER(
csv,
bool, false, "Produce CSV output. Must also specify --with-timings to get the time stats")
170 "Disable formula expansion.\n"
171 "\t\tMakes the parser faster, "
172 "but may create issues if an intermediate formula of the input becomes non linear")
175 "Perform a satisfiability check at the end of parsing if the input does not contain a (check-sat) directive")
178 "\t\tOne of: auto (1), smt2 (2), mps (3), vnnlib (4)")
180 "LP mode used by the LP solver.\n"
181 "\t\tOne of: auto (1), pure-
precision-boosting (2), pure-iterative-refinement (3), hybrid (4)")
183 "Underlying LP solver used by the theory solver.\n"
184 "\t\tOne of: soplex (1), qsoptex (2)")
187 DLINEAR_PARAMETER(
precision,
double, 9.999999999999996e-4,
188 "Delta
precision used by the LP solver solver.\n"
189 "\t\tEven when set to 0, a positive infinitesimal value will be considered.\n"
190 "\t\twhile the LP solver will yield an exact solution, strict inequalities will still be relaxed\n"
193 "Produce models, showing a valid assignment.\n"
194 "\t\tOnly applicable if the result is sat or delta-sat")
196 "Set the random seed. 0 means that the seed will be generated on the fly")
197 DLINEAR_PARAMETER(
read_from_stdin,
bool, false, "Read the input from the standard input")
199 "set default initial phase for
SAT solver.\n"
200 "\t\tOne of: false (0), true (1), Jeroslow-Wang (2), random initial phase (3)")
202 "Underlying
SAT solver used by the
SAT solver.\n"
203 "\t\tOne of: cadical (1), picosat (2)")
204 DLINEAR_PARAMETER(
silent,
bool, false, "Silent mode. Nothing will be printed on the standard output")
206 DLINEAR_PARAMETER(
skip_check_sat,
bool, false, "Parse the input, but does not run the solver")
208 DLINEAR_PARAMETER(
verbose_simplex,
int, 0, "Verbosity level for simplex. In the range [0, 5]")
209 DLINEAR_PARAMETER(
verify,
bool, false, "If the input produces a
SAT output,
verify the assignment against the input")
210 DLINEAR_PARAMETER(
with_timings,
bool, false, "Report timings alongside results")
213std::ostream &operator<<(
std::ostream &os, const
Config &config);
224#ifdef DLINEAR_INCLUDE_FMT
225#include "dlinear/util/logging.h"
Simple dataclass used to store the configuration of the program.
const int & verbose_simplex() const
Get read-write access to the verbose_simplex parameter of the configuration.
const PreprocessingRunningFrequency & bound_propagation_frequency() const
Get read-write access to the bound_propagation_frequency parameter of the configuration.
const LPMode & lp_mode() const
Get read-write access to the lp_mode parameter of the configuration.
const bool & continuous_output() const
Get read-write access to the continuous_output parameter of the configuration.
const unsigned int & number_of_jobs() const
Get read-write access to the number_of_jobs parameter of the configuration.
const PreprocessingRunningFrequency & bound_implication_frequency() const
Get read-write access to the bound_implication_frequency parameter of the configuration.
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.
@ 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.
const bool & complete() const
Get read-write access to the complete parameter of the configuration.
BoundPropagationType actual_bound_propagation_type() const
Get read-only access to the actual actual_bound_propagation_type parameter of the configuration.
const bool & optimize() const
Get read-write access to the optimize 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.
const bool & produce_models() const
Get read-write access to the produce_models parameter of the configuration.
OptionValue< std::string > & m_filename()
Get read-write access to the filename extension of the configuration.
const bool & enforce_check_sat() const
Get read-write access to the enforce_check_sat parameter of the configuration.
const bool & csv() const
Get read-write access to the csv parameter of the configuration.
std::string onnx_file() const
Get read-only access to the onnx_file 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.
const BoundPropagationType & bound_propagation_type() const
Get read-write access to the bound_propagation_type parameter of the configuration.
const LPSolver & lp_solver() const
Get read-write access to the lp_solver parameter of the configuration.
const bool & with_timings() const
Get read-write access to the with_timings parameter of the configuration.
const bool & silent() const
Get read-write access to the silent parameter of the configuration.
const bool & debug_scanning() const
Get read-write access to the debug_scanning parameter of the configuration.
const bool & debug_parsing() const
Get read-write access to the debug_parsing 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.
@ ALWAYS
Run this preprocess at every chance it gets. Usually combines ON_FIXED and ON_ITERATION.
const bool & skip_check_sat() const
Get read-write access to the skip_check_sat parameter of the configuration.
PreprocessingRunningFrequency actual_bound_propagation_frequency() const
Get read-only access to the actual bound_propagation_frequency parameter of the configuration.
const bool & read_from_stdin() const
Get read-write access to the read_from_stdin parameter of the configuration.
Config()=default
Construct a new Config object.
const bool & verify() const
Get read-write access to the verify parameter of the configuration.
const unsigned int & random_seed() const
Get read-write access to the random_seed parameter of the configuration.
std::string filename_extension() const
Get read-only access to the filename extension of the configuration.
const int & verbose_dlinear() const
Get read-write access to the verbose_dlinear parameter of the configuration.
const SatDefaultPhase & sat_default_phase() const
Get read-write access to the sat_default_phase parameter of the configuration.
const bool & disable_expansion() const
Get read-write access to the disable_expansion parameter of the configuration.
const int & simplex_sat_phase() const
Get read-write access to the simplex_sat_phase parameter of the configuration.
OptionValue< std::string > & m_onnx_file()
Get read-write access to the onnx_file parameter 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 double & precision() const
Get read-write access to the precision parameter of the configuration.
std::string filename() const
Get read-only access to the filename parameter of the configuration.
const SatSolver & sat_solver() const
Get read-write access to the sat_solver parameter of the configuration.
Represents an optional value in dLinear.
const T & get() const
Get read-only access to the internal stored value of the optional value.
Global namespace for the dlinear library.
@ SAT
The problem is satisfiable.