/****************************************** Copyright (c) 2016, Mate Soos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***********************************************/ #ifndef SOLVERCONF_H #define SOLVERCONF_H #include #include #include #include #include "gaussconfig.h" using std::string; namespace CMSat { enum class ClauseClean { glue = 0 , activity = 1 }; inline unsigned clean_to_int(ClauseClean t) { switch(t) { case ClauseClean::glue: return 0; case ClauseClean::activity: return 1; } assert(false); } enum class PolarityMode { polarmode_pos , polarmode_neg , polarmode_rnd , polarmode_automatic }; enum class Restart { glue , geom , glue_geom , luby , never }; inline std::string getNameOfRestartType(Restart rest_type) { switch(rest_type) { case Restart::glue : return "glue"; case Restart::geom: return "geometric"; case Restart::glue_geom: return "regularly switch between glue and geometric"; case Restart::luby: return "luby"; case Restart::never: return "never"; default: assert(false && "Unknown clause cleaning type?"); }; } inline std::string getNameOfCleanType(ClauseClean clauseCleaningType) { switch(clauseCleaningType) { case ClauseClean::glue : return "glue"; case ClauseClean::activity: return "activity"; default: assert(false && "Unknown clause cleaning type?"); std::exit(-1); }; } enum class ElimStrategy { heuristic , calculate_exactly }; inline std::string getNameOfElimStrategy(ElimStrategy strategy) { switch(strategy) { case ElimStrategy::heuristic: return "heuristic"; case ElimStrategy::calculate_exactly: return "calculate"; } assert(false && "Unknown elimination strategy type"); } class DLL_PUBLIC SolverConf { public: SolverConf(); std::string print_times( const double time_used , const bool time_out , const double time_remain ) const; std::string print_times( const double time_used , const bool time_out ) const; std::string print_times( const double time_used ) const; //Variable activities double var_inc_start; double var_decay_start; double var_decay_max; double random_var_freq; PolarityMode polarity_mode; //Clause cleaning //if non-zero, we reduce at every X conflicts. //Reduced according to whether it's been used recently //Otherwise, we *never* reduce unsigned every_lev1_reduce; //if non-zero, we reduce at every X conflicts. //Otherwise we geometrically keep around max_temp_lev2_learnt_clauses*(inc**N) unsigned every_lev2_reduce; uint32_t must_touch_lev1_within; unsigned max_temp_lev2_learnt_clauses; double inc_max_temp_lev2_red_cls; unsigned protect_cl_if_improved_glue_below_this_glue_for_one_turn; unsigned glue_put_lev0_if_below_or_eq; unsigned glue_put_lev1_if_below_or_eq; double ratio_keep_clauses[2]; ///< Remove this ratio of clauses at every database reduction round double clause_decay; unsigned min_time_in_db_before_eligible_for_cleaning; //If too many (in percentage) low glues after min_num_confl_adjust_glue_cutoff, adjust glue lower double adjust_glue_if_too_many_low; uint64_t min_num_confl_adjust_glue_cutoff; int guess_cl_effectiveness; //For restarting unsigned restart_first; ///* independent_vars; //Timeouts double orig_global_timeout_multiplier; double global_timeout_multiplier; double global_timeout_multiplier_multiplier; double global_multiplier_multiplier_max; //Misc unsigned origSeed; unsigned long long sync_every_confl; unsigned reconfigure_val; unsigned reconfigure_at; unsigned preprocess; std::string simplified_cnf; std::string solution_file; std::string saved_state_file; }; } //end namespace #endif //SOLVERCONF_H