mirror of
https://github.com/Z3Prover/z3
synced 2025-07-22 20:32:05 +00:00
fix #7550
This commit is contained in:
parent
83ee21cd22
commit
b784b748d4
5 changed files with 83 additions and 53 deletions
|
@ -105,7 +105,7 @@ class lar_solver : public column_namer {
|
|||
indexed_vector<mpq> m_column_buffer;
|
||||
std::unordered_map<lar_term, std::pair<mpq, unsigned>, term_hasher, term_comparer>
|
||||
m_normalized_terms_to_columns;
|
||||
vector<impq> m_backup_x;
|
||||
|
||||
stacked_vector<unsigned> m_usage_in_terms;
|
||||
// ((x[j], is_int(j))->j) for fixed j, used in equalities propagation
|
||||
// maps values to integral fixed vars
|
||||
|
@ -139,6 +139,8 @@ class lar_solver : public column_namer {
|
|||
bool compare_values(impq const& lhs, lconstraint_kind k, const mpq& rhs);
|
||||
|
||||
inline void clear_columns_with_changed_bounds() { m_columns_with_changed_bounds.reset(); }
|
||||
|
||||
struct scoped_backup;
|
||||
public:
|
||||
const auto& columns_with_changed_bounds() const { return m_columns_with_changed_bounds; }
|
||||
void insert_to_columns_with_changed_bounds(unsigned j);
|
||||
|
@ -305,9 +307,7 @@ public:
|
|||
|
||||
void get_infeasibility_explanation(explanation&) const;
|
||||
|
||||
inline void backup_x() { m_backup_x = m_mpq_lar_core_solver.m_r_x; }
|
||||
|
||||
inline void restore_x() { m_mpq_lar_core_solver.m_r_x = m_backup_x; }
|
||||
|
||||
std::function<void(lpvar)> m_fixed_var_eh;
|
||||
template <typename T>
|
||||
|
@ -454,7 +454,7 @@ public:
|
|||
const impq& new_val,
|
||||
const ChangeReport& after) {
|
||||
lp_assert(!is_base(j));
|
||||
auto& x = m_mpq_lar_core_solver.m_r_x[j];
|
||||
auto& x = m_mpq_lar_core_solver.r_x(j);
|
||||
auto delta = new_val - x;
|
||||
x = new_val;
|
||||
after(j);
|
||||
|
@ -540,6 +540,9 @@ public:
|
|||
lp_settings const& settings() const;
|
||||
statistics& stats();
|
||||
|
||||
void backup_x() { m_mpq_lar_core_solver.backup_x(); }
|
||||
void restore_x() { m_mpq_lar_core_solver.restore_x(); }
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
column_type get_column_type(unsigned j) const { return m_mpq_lar_core_solver.m_column_types()[j]; }
|
||||
const vector<column_type>& get_column_types() const { return m_mpq_lar_core_solver.m_column_types(); }
|
||||
|
@ -693,13 +696,13 @@ public:
|
|||
void track_touched_rows(bool v);
|
||||
bool touched_rows_are_tracked() const;
|
||||
~lar_solver() override;
|
||||
const vector<impq>& r_x() const { return m_mpq_lar_core_solver.m_r_x; }
|
||||
const vector<impq>& r_x() const { return m_mpq_lar_core_solver.r_x(); }
|
||||
bool column_is_int(unsigned j) const;
|
||||
inline bool column_value_is_int(unsigned j) const { return m_mpq_lar_core_solver.m_r_x[j].is_int(); }
|
||||
inline bool column_value_is_int(unsigned j) const { return m_mpq_lar_core_solver.r_x(j).is_int(); }
|
||||
inline static_matrix<mpq, impq>& A_r() { return m_mpq_lar_core_solver.m_r_A; }
|
||||
inline const static_matrix<mpq, impq>& A_r() const { return m_mpq_lar_core_solver.m_r_A; }
|
||||
// columns
|
||||
const impq& get_column_value(lpvar j) const { return m_mpq_lar_core_solver.m_r_x[j]; }
|
||||
const impq& get_column_value(lpvar j) const { return m_mpq_lar_core_solver.r_x(j); }
|
||||
inline lpvar external_to_local(unsigned j) const {
|
||||
lpvar local_j;
|
||||
if (m_var_register.external_is_used(j, local_j)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue