3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-09 01:11:55 +00:00

follow the smalles branch

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

correction in the sign of gomory_cut

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix in the gomory cut sign

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

try using lemmas of cut_solver as cuts

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

add find_cube() proposed by Nikolaj

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

restore m_int_branch_cut_solver to 8

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

accept empty lar_terms in theory_lra and also do not create empty lar_terms/lemmas

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

qflia_tactic

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

call find_feasible solution to recover for a failure in find_cube

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

do not tighten unused terms

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

get rid of inf_int_set

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix a bug with an accidental solution in cube

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

get rid of inf_int_set

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

bug fix with has_int_var() for lar_solver

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

fix in find_inf_int_base_column

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-03-22 20:35:13 -07:00
parent 2bb94ed4fe
commit 7e82ab595e
13 changed files with 314 additions and 182 deletions

View file

@ -39,7 +39,6 @@ Revision History:
#include "util/lp/stacked_unordered_set.h"
#include "util/lp/implied_bound.h"
#include "util/lp/bound_analyzer_on_row.h"
#include "util/lp/quick_xplain.h"
#include "util/lp/conversion_helper.h"
#include "util/lp/int_solver.h"
#include "util/lp/nra_solver.h"
@ -117,17 +116,19 @@ private:
vector<lar_term*> m_terms;
const var_index m_terms_start_index;
indexed_vector<mpq> m_column_buffer;
public:
lar_core_solver m_mpq_lar_core_solver;
private:
int_solver * m_int_solver;
bool m_has_int_var;
public :
unsigned terms_start_index() const { return m_terms_start_index; }
const vector<lar_term*> terms() const { return m_terms; }
const vector<lar_base_constraint*>& constraints() const {
return m_constraints;
}
lar_core_solver m_mpq_lar_core_solver;
private:
std::function<void (unsigned)> m_tracker_of_x_change;
int_solver * m_int_solver;
public:
void set_int_solver(int_solver * int_slv) {
m_int_solver = int_slv;
}
@ -136,7 +137,6 @@ public:
}
unsigned constraint_count() const;
const lar_base_constraint& get_constraint(unsigned ci) const;
int_set m_inf_int_set;
////////////////// methods ////////////////////////////////
static_matrix<mpq, numeric_pair<mpq>> & A_r();
static_matrix<mpq, numeric_pair<mpq>> const & A_r() const;
@ -551,43 +551,32 @@ public:
}
}
bool inf_int_set_is_correct_for_column(unsigned j) const {
if (m_inf_int_set.contains(j) != (column_is_int(j) && (!column_value_is_integer(j)))) {
TRACE("arith_int",
tout << "j= " << j <<
" inf_int_set().contains(j) = " << m_inf_int_set.contains(j) <<
", column_is_int(j) = " << column_is_int(j) <<
"\n column_value_is_integer(j) = " << column_value_is_integer(j) <<
", val = " << get_column_value(j) << std::endl;);
return false;
}
return true;
}
bool inf_int_set_is_correct() const {
if (!has_int_var())
return true;
for (unsigned j = 0; j < A_r().column_count(); j++) {
if (inf_int_set_is_correct_for_column(j) == false)
return false;
}
return true;
}
bool has_int_var() const;
void call_assignment_tracker(unsigned j) {
if (!var_is_int(j)) {
lp_assert(m_inf_int_set.contains(j) == false);
return;
bool has_inf_int() const {
for (unsigned j = 0; j < column_count(); j++) {
if (column_is_int(j) && ! column_value_is_int(j))
return true;
}
if (m_mpq_lar_core_solver.m_r_x[j].is_int())
m_inf_int_set.erase(j);
else
m_inf_int_set.insert(j);
return false;
}
bool r_basis_has_inf_int() const {
for (unsigned j : r_basis()) {
if (column_is_int(j) && ! column_value_is_int(j))
return true;
}
return false;
}
lar_core_solver & get_core_solver() { return m_mpq_lar_core_solver; }
bool column_corresponds_to_term(unsigned) const;
void catch_up_in_updating_int_solver();
var_index to_var_index(unsigned ext_j) const;
bool tighten_term_bounds_by_delta(unsigned, const mpq&);
void round_to_integer_solution();
void update_delta_for_terms(const impq & delta, unsigned j, const vector<unsigned>&);
void fill_vars_to_terms(vector<vector<unsigned>> & vars_to_terms);
unsigned column_count() const { return A_r().column_count(); }
const vector<unsigned> & r_basis() const { return m_mpq_lar_core_solver.r_basis(); }
};
}