mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
initialize
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
43ddad0ecd
commit
54f145b364
|
@ -20,6 +20,7 @@
|
|||
#include "sat_local_search.h"
|
||||
#include "sat_solver.h"
|
||||
#include "card_extension.h"
|
||||
#include "sat_params.hpp"
|
||||
|
||||
namespace sat {
|
||||
|
||||
|
@ -42,6 +43,7 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
}
|
||||
set_parameters();
|
||||
}
|
||||
|
||||
void local_search::reinit() {
|
||||
|
@ -285,6 +287,8 @@ namespace sat {
|
|||
}
|
||||
|
||||
lbool local_search::operator()() {
|
||||
sat_params params;
|
||||
std::cout << "my parameter value: " << params.cliff() << "\n";
|
||||
init();
|
||||
bool reach_cutoff_time = false;
|
||||
bool reach_known_best_value = false;
|
||||
|
@ -294,7 +298,7 @@ namespace sat {
|
|||
srand(0); // TBD, use random facility and parameters to set random seed.
|
||||
set_parameters();
|
||||
// ################## start ######################
|
||||
//cout << "Start initialize and local search, restart in every " << max_steps << " steps" << endl;
|
||||
std::cout << "Start initialize and local search, restart in every " << max_steps << " steps\n";
|
||||
for (unsigned tries = 0; ; ++tries) {
|
||||
reinit();
|
||||
for (int step = 1; step <= max_steps; ++step) {
|
||||
|
|
|
@ -27,4 +27,5 @@ def_module_params('sat',
|
|||
('drat.file', SYMBOL, '', 'file to dump DRAT proofs'),
|
||||
('drat.check', BOOL, False, 'build up internal proof and check'),
|
||||
('cardinality.solver', BOOL, False, 'use cardinality/xor solver'),
|
||||
('cliff', UINT, 0, 'my favorite parameter'),
|
||||
))
|
||||
|
|
|
@ -65,7 +65,7 @@ static bool build_instance(char const * filename, sat::solver& s, sat::local_sea
|
|||
}
|
||||
|
||||
void tst_sat_local_search(char ** argv, int argc, int& i) {
|
||||
if (argc != i + 2) {
|
||||
if (argc < i + 2) {
|
||||
std::cout << "require dimacs file name\n";
|
||||
return;
|
||||
}
|
||||
|
@ -75,6 +75,11 @@ void tst_sat_local_search(char ** argv, int argc, int& i) {
|
|||
sat::local_search local_search(solver);
|
||||
char const* file_name = argv[i + 1];
|
||||
++i;
|
||||
while (i + 1 < argc) {
|
||||
// set other ad hoc parameters.
|
||||
std::cout << argv[i + 1] << "\n";
|
||||
++i;
|
||||
}
|
||||
|
||||
if (!build_instance(file_name, solver, local_search)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue