mirror of
https://github.com/Z3Prover/z3
synced 2025-08-04 18:30:24 +00:00
transfer propagate monomial bounds to nla_solver
This commit is contained in:
parent
536930b4a1
commit
e31cecf5db
7 changed files with 243 additions and 183 deletions
|
@ -103,7 +103,10 @@ class core {
|
|||
emonics m_emons;
|
||||
svector<lpvar> m_add_buffer;
|
||||
mutable indexed_uint_set m_active_var_set;
|
||||
|
||||
// these maps map a column index to the corresponding index in ibounds
|
||||
u_map<unsigned> m_improved_lower_bounds;
|
||||
u_map<unsigned> m_improved_upper_bounds;
|
||||
const vector<lp::column_type>* m_column_types;
|
||||
reslimit m_nra_lim;
|
||||
|
||||
bool m_use_nra_model = false;
|
||||
|
@ -114,12 +117,13 @@ class core {
|
|||
|
||||
void check_weighted(unsigned sz, std::pair<unsigned, std::function<void(void)>>* checks);
|
||||
void add_bounds();
|
||||
std_vector<lp::implied_bound> & m_implied_bounds;
|
||||
// try to improve bounds for variables in monomials.
|
||||
bool improve_bounds();
|
||||
|
||||
public:
|
||||
// constructor
|
||||
core(lp::lar_solver& s, params_ref const& p, reslimit&);
|
||||
core(lp::lar_solver& s, params_ref const& p, reslimit&, std_vector<lp::implied_bound> & implied_bounds);
|
||||
const auto& monics_with_changed_bounds() const { return m_monics_with_changed_bounds; }
|
||||
void reset_monics_with_changed_bounds() { m_monics_with_changed_bounds.reset(); }
|
||||
void insert_to_refine(lpvar j);
|
||||
|
@ -431,15 +435,23 @@ public:
|
|||
void set_use_nra_model(bool m);
|
||||
bool use_nra_model() const { return m_use_nra_model; }
|
||||
void collect_statistics(::statistics&);
|
||||
bool is_linear(const svector<lpvar>& m, lpvar& zero_var, lpvar& non_fixed);
|
||||
void add_bounds_for_zero_var(lpvar monic_var, lpvar zero_var);
|
||||
void propagate_monic_with_non_fixed(lpvar monic_var, const svector<lpvar>& vars, lpvar non_fixed, const rational& k);
|
||||
void propagate_monic_with_all_fixed(lpvar monic_var, const svector<lpvar>& vars, const rational& k);
|
||||
void add_lower_bound_monic(lpvar j, const lp::mpq& v, bool is_strict, std::function<u_dependency*()> explain_dep);
|
||||
void add_upper_bound_monic(lpvar j, const lp::mpq& v, bool is_strict, std::function<u_dependency*()> explain_dep);
|
||||
bool upper_bound_is_available(unsigned j) const;
|
||||
bool lower_bound_is_available(unsigned j) const;
|
||||
private:
|
||||
void restore_patched_values();
|
||||
lp::column_type get_column_type(unsigned j) const { return (*m_column_types)[j]; }
|
||||
void constrain_nl_in_tableau();
|
||||
bool solve_tableau();
|
||||
void restore_tableau();
|
||||
void save_tableau();
|
||||
bool integrality_holds();
|
||||
|
||||
|
||||
void calculate_implied_bounds_for_monic(lp::lpvar v);
|
||||
void init_bound_propagation();
|
||||
}; // end of core
|
||||
|
||||
struct pp_mon {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue