@@ -77,9 +77,12 @@ namespace lp {
7777 unsigned size () const {return static_cast <unsigned >(m_map.size ());}
7878
7979 void erase_val (unsigned b) {
80- SASSERT (contains (m_rev_map, b) && contains (m_map, m_rev_map[b]));
81- unsigned key = m_rev_map[b];
82- m_rev_map.erase (b);
80+ VERIFY (contains (m_rev_map, b) && contains (m_map, m_rev_map[b]));
81+ auto it = m_rev_map.find (b);
82+ if (it == m_rev_map.end ()) return ;
83+ unsigned key = it->second ;
84+ m_rev_map.erase (it);
85+ VERIFY (has_key (key));
8386 m_map.erase (key);
8487 }
8588 bool has_val (unsigned b) const {
@@ -123,7 +126,7 @@ namespace lp {
123126 }
124127 unsigned operator [](unsigned i) const {
125128 auto it = m_map.find (i);
126- SASSERT (it != m_map.end ());
129+ VERIFY (it != m_map.end ());
127130 return it->second ;
128131 }
129132 };
@@ -151,10 +154,10 @@ namespace lp {
151154 }
152155
153156 void erase_by_second_key (unsigned b) {
154- SASSERT (m_bij.has_val (b));
157+ VERIFY (m_bij.has_val (b));
155158 m_bij.erase_val (b);
156159 auto it = m_data.find (b);
157- SASSERT (it != m_data.end ());
160+ VERIFY (it != m_data.end ());
158161 m_data.erase (it);
159162 }
160163
@@ -169,7 +172,7 @@ namespace lp {
169172 // Get the data by 'b' directly
170173 const T& get_by_val (unsigned b) const {
171174 auto it = m_data.find (b);
172- SASSERT (it != m_data.end ());
175+ VERIFY (it != m_data.end ());
173176 return it->second ;
174177 }
175178 };
@@ -351,7 +354,7 @@ namespace lp {
351354
352355 const mpq& operator [](unsigned j) const {
353356 SASSERT (j >= 0 && j < m_index.size ());
354- SASSERT (m_index[j] >= 0 && m_index[j] < m_data.size ());
357+ SASSERT (m_index[j] >= 0 && m_index[j] < ( int ) m_data.size ());
355358 return m_data[m_index[j]].coeff ();
356359 }
357360
@@ -470,8 +473,8 @@ namespace lp {
470473
471474
472475 unsigned m_conflict_index = -1 ; // the row index of the conflict
473- unsigned m_max_number_of_iterations = 100 ;
474- unsigned m_number_of_iterations ;
476+ unsigned m_max_of_branching_iterations = 0 ;
477+ unsigned m_number_of_branching_calls ;
475478 struct branch {
476479 unsigned m_j = UINT_MAX;
477480 mpq m_rs;
@@ -1084,7 +1087,7 @@ namespace lp {
10841087 m_conflict_index = -1 ;
10851088 m_infeas_explanation.clear ();
10861089 lia.get_term ().clear ();
1087- m_number_of_iterations = 0 ;
1090+ m_number_of_branching_calls = 0 ;
10881091 m_branch_stack.clear ();
10891092 m_lra_level = 0 ;
10901093
@@ -1182,11 +1185,6 @@ namespace lp {
11821185 return true ;
11831186 }
11841187 // c_g is not integral
1185- if (lra.stats ().m_dio_calls %
1186- lra.settings ().dio_branch_from_proof_period () ==
1187- 0 &&
1188- !has_fresh_var (ei))
1189- prepare_lia_branch_report (ei, e, g, c_g);
11901188 return false ;
11911189 }
11921190
@@ -1738,8 +1736,8 @@ namespace lp {
17381736 lia_move branching_on_undef () {
17391737 m_explanation_of_branches.clear ();
17401738 bool need_create_branch = true ;
1741- m_number_of_iterations = 0 ;
1742- while (++m_number_of_iterations < m_max_number_of_iterations ) {
1739+ m_number_of_branching_calls = 0 ;
1740+ while (++m_number_of_branching_calls < m_max_of_branching_iterations ) {
17431741 lra.stats ().m_dio_branch_iterations ++;
17441742 if (need_create_branch) {
17451743 if (!push_branch ()) {
@@ -1954,12 +1952,14 @@ namespace lp {
19541952 if (ret == lia_move::branch || ret == lia_move::conflict)
19551953 return ret;
19561954 SASSERT (ret == lia_move::undef);
1957- ret = branching_on_undef ();
1955+ if (lra.stats ().m_dio_calls % lra.settings ().dio_branching_period () == 0 ) {
1956+ ret = branching_on_undef ();
1957+ }
19581958 if (ret == lia_move::sat || ret == lia_move::conflict) {
19591959 return ret;
19601960 }
19611961 SASSERT (ret == lia_move::undef);
1962- m_max_number_of_iterations = (unsigned )m_max_number_of_iterations /2 ;
1962+ m_max_of_branching_iterations = (unsigned )m_max_of_branching_iterations /2 ;
19631963
19641964 return lia_move::undef;
19651965 }
@@ -1979,8 +1979,7 @@ namespace lp {
19791979 mpq t;
19801980 for (const auto & p : m_e_matrix.m_rows [ei]) {
19811981 t = abs (p.coeff ());
1982- if (first || t < ahk ||
1983- (t == ahk && p.var () < k)) { // the last condition is for debug
1982+ if (first || t < ahk) {
19841983 ahk = t;
19851984 k_sign = p.coeff ().is_pos () ? 1 : -1 ;
19861985 k = p.var ();
@@ -2092,11 +2091,10 @@ namespace lp {
20922091
20932092 mpq coeff = m_e_matrix.get_val (c);
20942093 TRACE (" dioph_eq" , tout << " before pivot entry :" ; print_entry (c.var (), tout) << std::endl;);
2095- unsigned c_row = c.var ();
20962094 m_e_matrix.pivot_term_to_row_given_cell (t, c, j, j_sign);
20972095 TRACE (" dioph_eq" , tout << " after pivoting c_row:" ;
2098- print_entry (c_row , tout););
2099- SASSERT (entry_invariant (c_row ));
2096+ print_entry (c. var () , tout););
2097+ SASSERT (entry_invariant (c. var () ));
21002098 cell_to_process--;
21012099 }
21022100 SASSERT (is_eliminated_from_f (j));
0 commit comments