mirror of
https://github.com/Z3Prover/z3
synced 2025-07-23 20:58:54 +00:00
clean up int_solver
Signed-off-by: Lev Nachmanson <levnach@hotmail.com> add a diagnostic method Signed-off-by: Lev Nachmanson <levnach@hotmail.com> white space change Signed-off-by: Lev Nachmanson <levnach@microsoft.com> cleanup in int_solver Signed-off-by: Lev Nachmanson <levnach@hotmail.com> some cleanup Signed-off-by: Lev Nachmanson <levnach@microsoft.com> remove m_became_zeros Signed-off-by: Lev Nachmanson <levnach@microsoft.com> start cut_solver, work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> start cut_solver, work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> workin on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> working on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> working on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> working on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs in disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs in gisjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs in gisjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs in disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs in disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> fix bugs is disjoint intervals Signed-off-by: Lev Nachmanson <levnach@microsoft.com> bug fixes in disjoint_intervals Signed-off-by: Lev Nachmanson <levnach@hotmail.com> disjoint_intervals passes the test Signed-off-by: Lev Nachmanson <levnach@hotmail.com> test disjoint_intervals push(), pop() Signed-off-by: Lev Nachmanson <levnach@hotmail.com> cut_solver Signed-off-by: Lev Nachmanson <levnach@hotmail.com> work on cut_solver Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
db8f01894f
commit
58ca4518e5
28 changed files with 2469 additions and 1307 deletions
|
@ -8,6 +8,9 @@
|
|||
#include "util/lp/iterator_on_row.h"
|
||||
#include "util/lp/int_set.h"
|
||||
#include "util/lp/lar_term.h"
|
||||
#include "util/lp/cut_solver.h"
|
||||
#include "util/lp/lar_constraints.h"
|
||||
|
||||
namespace lp {
|
||||
class lar_solver;
|
||||
template <typename T, typename X>
|
||||
|
@ -42,6 +45,8 @@ public:
|
|||
// main function to check that solution provided by lar_solver is valid for integral values,
|
||||
// or provide a way of how it can be adjusted.
|
||||
lia_move check(lar_term& t, mpq& k, explanation& ex);
|
||||
bool move_non_basic_column_to_bounds(unsigned j);
|
||||
lia_move check_wrapper(lar_term& t, mpq& k, explanation& ex);
|
||||
private:
|
||||
|
||||
// how to tighten bounds for integer variables.
|
||||
|
@ -73,8 +78,8 @@ private:
|
|||
explanation & ex);
|
||||
void fill_explanation_from_fixed_columns(iterator_on_row<mpq> & it, explanation &);
|
||||
void add_to_explanation_from_fixed_or_boxed_column(unsigned j, explanation &);
|
||||
void remove_fixed_vars_from_base();
|
||||
void patch_int_infeasible_columns();
|
||||
void patch_int_infeasible_non_basic_column(unsigned j);
|
||||
void patch_int_infeasible_nbasic_columns();
|
||||
bool get_freedom_interval_for_column(unsigned j, bool & inf_l, impq & l, bool & inf_u, impq & u, mpq & m);
|
||||
linear_combination_iterator<mpq> * get_column_iterator(unsigned j);
|
||||
const impq & low_bound(unsigned j) const;
|
||||
|
@ -88,7 +93,7 @@ private:
|
|||
bool value_is_int(unsigned j) const;
|
||||
void set_value_for_nbasic_column(unsigned j, const impq & new_val);
|
||||
void set_value_for_nbasic_column_ignore_old_values(unsigned j, const impq & new_val);
|
||||
void fix_non_base_columns();
|
||||
bool non_basic_columns_are_at_bounds() const;
|
||||
void failed();
|
||||
bool is_feasible() const;
|
||||
const impq & get_value(unsigned j) const;
|
||||
|
@ -100,14 +105,14 @@ private:
|
|||
int find_inf_int_base_column();
|
||||
int find_inf_int_boxed_base_column_with_smallest_range();
|
||||
lp_settings& settings();
|
||||
bool move_non_base_vars_to_bounds();
|
||||
bool move_non_basic_columns_to_bounds();
|
||||
void branch_infeasible_int_var(unsigned);
|
||||
lia_move mk_gomory_cut(lar_term& t, mpq& k,explanation & ex, unsigned inf_col, linear_combination_iterator<mpq>& iter);
|
||||
lia_move report_conflict_from_gomory_cut(mpq & k);
|
||||
void adjust_term_and_k_for_some_ints_case_gomory(lar_term& t, mpq& k, mpq& lcm_den);
|
||||
void init_check_data();
|
||||
bool constrain_free_vars(linear_combination_iterator<mpq> * r);
|
||||
lia_move proceed_with_gomory_cut(lar_term& t, mpq& k, explanation& ex, unsigned j, linear_combination_iterator<mpq>& iter);
|
||||
lia_move proceed_with_gomory_cut(lar_term& t, mpq& k, explanation& ex, unsigned j);
|
||||
int find_free_var_in_gomory_row(linear_combination_iterator<mpq>& iter);
|
||||
bool is_gomory_cut_target(linear_combination_iterator<mpq> &iter);
|
||||
bool at_bound(unsigned j) const;
|
||||
|
@ -136,8 +141,16 @@ public:
|
|||
bool shift_var(unsigned j, unsigned range);
|
||||
private:
|
||||
unsigned random();
|
||||
bool non_basic_columns_are_at_bounds() const;
|
||||
bool has_inf_int() const;
|
||||
lia_move create_branch_on_column(int j, lar_term& t, mpq& k) const;
|
||||
lia_move create_branch_on_column(int j, lar_term& t, mpq& k, bool free_column) const;
|
||||
public:
|
||||
void display_inf_or_int_inf_columns(std::ostream & out) const;
|
||||
template <typename T>
|
||||
void fill_cut_solver(cut_solver<T> & cs);
|
||||
template <typename T>
|
||||
void fill_cut_solver_for_constraint(const lar_base_constraint*, cut_solver<T>& );
|
||||
template <typename T>
|
||||
void get_int_coeffs_from_constraint(const lar_base_constraint* c, vector<std::pair<T, var_index>>& coeff, T & rs);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue