Skip to content

Commit deac00a

Browse files
committed
persist dio handler
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 2c8a6f8 commit deac00a

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/math/lp/dioph_eq.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,8 @@ namespace lp {
236236
std_vector<unsigned> m_fresh_definitions; // seems only needed in the debug
237237
// version in remove_fresh_vars
238238

239-
unsigned m_conflict_index =
240-
-1; // m_entries[m_conflict_index] gives the conflict
241-
unsigned m_max_number_of_iterations = 1000;
239+
unsigned m_conflict_index = -1; // m_entries[m_conflict_index] gives the conflict
240+
unsigned m_max_number_of_iterations = 100;
242241
unsigned m_number_of_iterations;
243242
struct branch {
244243
unsigned m_j = UINT_MAX;
@@ -355,6 +354,8 @@ namespace lp {
355354
m_entries.clear();
356355
m_var_register.clear();
357356
m_number_of_iterations = 0;
357+
m_branch_stack.clear();
358+
m_lra_level = 0;
358359
for (unsigned j = 0; j < lra.column_count(); j++) {
359360
if (!lra.column_is_int(j) || !lra.column_has_term(j))
360361
continue;
@@ -1102,7 +1103,9 @@ namespace lp {
11021103
if (ret == lia_move::sat || ret == lia_move::conflict) {
11031104
return ret;
11041105
}
1105-
SASSERT(ret == lia_move::undef);
1106+
SASSERT(ret == lia_move::undef);
1107+
m_max_number_of_iterations = std::max((unsigned)5, (unsigned)m_max_number_of_iterations/2);
1108+
11061109
return lia_move::undef;
11071110
}
11081111

src/math/lp/int_solver.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace lp {
3434
int_solver& lia;
3535
lar_solver& lra;
3636
lar_core_solver& lrac;
37+
dioph_eq m_dio;
3738
unsigned m_number_of_calls = 0;
3839
lar_term m_t; // the term to return in the cut
3940
bool m_upper; // cut is an upper bound
@@ -48,7 +49,7 @@ namespace lp {
4849
return lra.column_is_int(j) && (!lia.value_is_int(j));
4950
}
5051

51-
imp(int_solver& lia): lia(lia), lra(lia.lra), lrac(lia.lrac), m_hnf_cutter(lia), m_gcd(lia) {
52+
imp(int_solver& lia): lia(lia), lra(lia.lra), lrac(lia.lrac), m_hnf_cutter(lia), m_gcd(lia), m_dio(lia) {
5253
m_hnf_cut_period = settings().hnf_cut_period();
5354
m_dioph_eq_period = settings().m_dioph_eq_period;
5455
}
@@ -169,18 +170,17 @@ namespace lp {
169170
}
170171

171172
lia_move solve_dioph_eq() {
172-
dioph_eq de(lia);
173-
lia_move r = de.check();
173+
lia_move r = m_dio.check();
174174

175175
if (r == lia_move::conflict) {
176-
de.explain(*this->m_ex);
176+
m_dio.explain(*this->m_ex);
177177
m_dioph_eq_period = settings().m_dioph_eq_period;
178178
return lia_move::conflict;
179179
} else if (r == lia_move::branch) {
180180
m_dioph_eq_period = settings().m_dioph_eq_period;
181181
return lia_move::branch;
182182
}
183-
return r;
183+
return r;
184184
}
185185

186186
lp_settings& settings() { return lra.settings(); }

0 commit comments

Comments
 (0)