@@ -504,9 +504,9 @@ namespace lp {
504
504
std::unordered_map<unsigned , std_vector<unsigned >> m_row2fresh_defs;
505
505
506
506
indexed_uint_set m_changed_rows;
507
- // m_changed_columns are the columns that just became fixed, or those that just stopped being fixed.
507
+ // m_changed_f_columns are the columns that just became fixed, or those that just stopped being fixed.
508
508
// If such a column appears in an entry it has to be recalculated.
509
- indexed_uint_set m_changed_columns ;
509
+ indexed_uint_set m_changed_f_columns ;
510
510
indexed_uint_set m_changed_terms; // represented by term columns
511
511
indexed_uint_set m_terms_to_tighten; // represented by term columns
512
512
// m_column_to_terms[j] is the set of all k such lra.get_term(k) depends on j
@@ -776,7 +776,7 @@ namespace lp {
776
776
777
777
void add_changed_column (unsigned j) {
778
778
TRACE (" dio" , lra.print_column_info (j, tout););
779
- m_changed_columns .insert (j);
779
+ m_changed_f_columns .insert (j);
780
780
}
781
781
std_vector<const lar_term*> m_added_terms;
782
782
std::unordered_set<const lar_term*> m_active_terms;
@@ -833,7 +833,7 @@ namespace lp {
833
833
if (ignore_big_nums () && lra.get_lower_bound (j).x .is_big ())
834
834
return ;
835
835
TRACE (" dio" , tout << " j:" << j << " \n " ; lra.print_column_info (j, tout););
836
- m_changed_columns .insert (j);
836
+ m_changed_f_columns .insert (j);
837
837
lra.trail ().push (undo_fixed_column (*this , j));
838
838
}
839
839
@@ -1014,7 +1014,7 @@ namespace lp {
1014
1014
}
1015
1015
1016
1016
void find_changed_terms_and_more_changed_rows () {
1017
- for (unsigned j : m_changed_columns ) {
1017
+ for (unsigned j : m_changed_f_columns ) {
1018
1018
const auto it = m_columns_to_terms.find (j);
1019
1019
if (it != m_columns_to_terms.end ())
1020
1020
for (unsigned k : it->second ) {
@@ -1114,7 +1114,7 @@ namespace lp {
1114
1114
remove_irrelevant_fresh_defs ();
1115
1115
1116
1116
eliminate_substituted_in_changed_rows ();
1117
- m_changed_columns .reset ();
1117
+ m_changed_f_columns .reset ();
1118
1118
m_changed_rows.reset ();
1119
1119
m_changed_terms.reset ();
1120
1120
SASSERT (entries_are_ok ());
@@ -1630,7 +1630,7 @@ namespace lp {
1630
1630
auto r = tighten_bounds_for_non_trivial_gcd (g, j, true );
1631
1631
if (r == lia_move::undef)
1632
1632
r = tighten_bounds_for_non_trivial_gcd (g, j, false );
1633
- if (r == lia_move::undef && m_changed_columns .contains (j))
1633
+ if (r == lia_move::undef && m_changed_f_columns .contains (j))
1634
1634
r = lia_move::continue_with_check;
1635
1635
return r;
1636
1636
}
@@ -1801,30 +1801,23 @@ namespace lp {
1801
1801
mpq rs;
1802
1802
bool is_strict = false ;
1803
1803
u_dependency* b_dep = nullptr ;
1804
- SASSERT (!g.is_zero ());
1804
+ SASSERT (!g.is_zero () && !g. is_one () );
1805
1805
1806
1806
if (lra.has_bound_of_type (j, b_dep, rs, is_strict, is_upper)) {
1807
- TRACE (" dio" ,
1808
- tout << " current " << (is_upper? " upper" :" lower" ) << " bound for x" << j << " :"
1809
- << rs << std::endl;);
1807
+ TRACE (" dio" , tout << " x" << j << (is_upper? " <= " :" >= " ) << rs << std::endl;);
1810
1808
mpq rs_g = (rs - m_c) % g;
1811
- if (rs_g.is_neg ()) {
1809
+ if (rs_g.is_neg ())
1812
1810
rs_g += g;
1813
- }
1814
- if (! (!rs_g.is_neg () && rs_g.is_int ())) {
1815
- std::cout << " rs:" << rs << " \n " ;
1816
- std::cout << " m_c:" << m_c << " \n " ;
1817
- std::cout << " g:" << g << " \n " ;
1818
- std::cout << " rs_g:" << rs_g << " \n " ;
1819
- }
1820
- SASSERT (rs_g.is_int ());
1811
+
1812
+ SASSERT (rs_g.is_int () && !rs_g.is_neg ());
1813
+
1821
1814
TRACE (" dio" , tout << " (rs - m_c) % g:" << rs_g << std::endl;);
1822
1815
if (!rs_g.is_zero ()) {
1823
1816
if (tighten_bound_kind (g, j, rs, rs_g, is_upper))
1824
1817
return lia_move::conflict;
1825
- } else {
1826
- TRACE (" dio" , tout << " no improvement in the bound\n " ;);
1827
1818
}
1819
+ else
1820
+ TRACE (" dio" , tout << " rs_g is zero: no improvement in the bound\n " ;);
1828
1821
}
1829
1822
return lia_move::undef;
1830
1823
}
@@ -1887,10 +1880,7 @@ namespace lp {
1887
1880
for (const auto & p: fixed_part_of_the_term) {
1888
1881
SASSERT (is_fixed (p.var ()));
1889
1882
if (p.coeff ().is_int () && (p.coeff () % g).is_zero ()) {
1890
- // we can skip this dependency
1891
- // because the monomial p.coeff()*p.var() is 0 modulo g, and it does not matter that p.var() is fixed.
1892
- // We could have added p.coeff()*p.var() to g*t_, substructed the value of p.coeff()*p.var() from m_c and
1893
- // still get the same result.
1883
+ // we can skip this dependency as explained above
1894
1884
TRACE (" dio" , tout << " skipped dep:\n " ; print_deps (tout, lra.get_bound_constraint_witnesses_for_column (p.var ())););
1895
1885
continue ;
1896
1886
}
@@ -1966,7 +1956,7 @@ namespace lp {
1966
1956
return lia_move::undef;
1967
1957
if (r == lia_move::conflict || r == lia_move::undef)
1968
1958
break ;
1969
- SASSERT (m_changed_columns .size () == 0 );
1959
+ SASSERT (m_changed_f_columns .size () == 0 );
1970
1960
}
1971
1961
while (f_vector.size ());
1972
1962
0 commit comments