@@ -892,7 +892,10 @@ namespace lp {
892
892
TRACE (" dio_br" ,
893
893
tout << " fixed j:" << j <<" , was substited by " ; print_entry (m_k2s[j], tout););
894
894
if (check_fixing (j) == lia_move::conflict) {
895
- m_conflict_index = m_k2s[j];
895
+ auto & ep = m_entries[m_k2s[j]];
896
+ for (auto ci : lra.flatten (explain_fixed_in_meta_term (ep.m_l ))) {
897
+ m_explanation_of_branches.push_back (ci);
898
+ }
896
899
return lia_move::conflict;
897
900
}
898
901
}
@@ -917,15 +920,18 @@ namespace lp {
917
920
return true ;
918
921
}
919
922
920
- lia_move add_var_bound_for_branch (const branch* b) {
921
- if (b->m_left ) {
922
- lra.add_var_bound (b->m_j , lconstraint_kind::LE, b->m_rs );
923
- } else {
924
- lra.add_var_bound (b->m_j , lconstraint_kind::GE, b->m_rs + mpq (1 ));
925
- }
926
- if (lra.column_is_fixed (b->m_j )) {
927
- if (fix_var (lar_solver_to_local (b->m_j )) == lia_move::conflict)
923
+ lia_move add_var_bound_for_branch (const branch& b) {
924
+ if (b.m_left ) {
925
+ lra.add_var_bound (b.m_j , lconstraint_kind::LE, b.m_rs );
926
+ } else {
927
+ lra.add_var_bound (b.m_j , lconstraint_kind::GE, b.m_rs + mpq (1 ));
928
+ }
929
+ TRACE (" dio_br" , lra.print_column_info (b.m_j , tout) <<" add bound" << std::endl;);
930
+ if (lra.column_is_fixed (b.m_j )) {
931
+ if (fix_var (lar_solver_to_local (b.m_j )) == lia_move::conflict) {
932
+ TRACE (" dio_br" , tout << " conflict in fix_var" << std::endl;) ;
928
933
return lia_move::conflict;
934
+ }
929
935
}
930
936
return lia_move::undef;
931
937
}
@@ -955,7 +961,6 @@ namespace lp {
955
961
956
962
lia_move branching_on_undef () {
957
963
m_explanation_of_branches.clear ();
958
- branch* b;
959
964
bool need_create_branch = true ;
960
965
m_number_of_iterations = 0 ;
961
966
while (++m_number_of_iterations < m_max_number_of_iterations) {
@@ -967,25 +972,23 @@ namespace lp {
967
972
return lia_move::sat;
968
973
}
969
974
need_create_branch = false ;
970
- b = &m_branch_stack.back ();
971
975
}
972
976
lra_push (); // exploring a new branch
973
977
974
- if (add_var_bound_for_branch (b) == lia_move::conflict) {
975
- collect_evidence ();
978
+ if (add_var_bound_for_branch (m_branch_stack.back ()) == lia_move::conflict) {
976
979
undo_explored_branches ();
977
980
if (m_branch_stack.size () == 0 ) {
978
981
lra.stats ().m_dio_branching_infeasibles ++;
979
982
transfer_explanations_from_closed_branches ();
980
983
return lia_move::conflict;
981
984
}
982
- TRACE (" dio_br" , tout << lp_status_to_string (lra.get_status ()) << std::endl;
983
- tout << " explanation:\n " ; lra.print_expl (tout, m_infeas_explanation););
984
985
need_create_branch = false ;
985
986
m_branch_stack.back ().flip ();
987
+ lra_pop ();
986
988
continue ;
987
989
}
988
990
auto st = lra.find_feasible_solution ();
991
+ TRACE (" dio_br" , tout << " st:" << lp_status_to_string (st) << std::endl;);
989
992
if ((int )st >= (int )(lp_status::FEASIBLE)) {
990
993
// have a feasible solution
991
994
unsigned n_of_ii = get_number_of_int_inf ();
@@ -996,7 +999,7 @@ namespace lp {
996
999
return lia_move::sat;
997
1000
}
998
1001
// got to create a new branch
999
- update_branch_stats (*b , n_of_ii);
1002
+ update_branch_stats (m_branch_stack. back () , n_of_ii);
1000
1003
need_create_branch = true ;
1001
1004
} else {
1002
1005
if (st == lp_status::CANCELLED) return lia_move::undef;
@@ -1089,15 +1092,19 @@ namespace lp {
1089
1092
1090
1093
public:
1091
1094
lia_move check () {
1095
+ ++glb;
1096
+ TRACE (" dioph_eq" , tout << " glb:" << glb << std::endl; );
1092
1097
lra.stats ().m_dio_calls ++;
1093
1098
init ();
1094
1099
lia_move ret = process_f_and_tighten_terms ();
1095
1100
if (ret == lia_move::branch || ret == lia_move::conflict)
1096
1101
return ret;
1097
1102
SASSERT (ret == lia_move::undef);
1098
1103
ret = branching_on_undef ();
1099
- if (ret == lia_move::sat || ret == lia_move::conflict)
1100
- return ret;
1104
+ if (ret == lia_move::sat || ret == lia_move::conflict) {
1105
+ SASSERT (lra.settings ().get_cancel_flag () == false );
1106
+ return ret;
1107
+ }
1101
1108
SASSERT (ret == lia_move::undef);
1102
1109
return lia_move::undef;
1103
1110
}
0 commit comments