@@ -771,6 +771,7 @@ namespace lp {
771
771
if ((int )st >= (int )lp::lp_status::FEASIBLE) {
772
772
return false ;
773
773
}
774
+ if (st == lp_status::CANCELLED) return false ;
774
775
lra.get_infeasibility_explanation (m_infeas_explanation);
775
776
return true ;
776
777
}
@@ -846,7 +847,6 @@ namespace lp {
846
847
847
848
// returns true if the left and the right branches were explored
848
849
bool undo_last_branch () {
849
- unsigned h = m_branch_stack.size () - 1 ;
850
850
if (m_branch_stack.back ().m_fully_explored ) {
851
851
TRACE (" dio_br" , tout << " pop fully explored, m_branch_stack.size():" << m_branch_stack.size () << std::endl;);
852
852
m_branch_stack.pop_back ();
@@ -905,7 +905,7 @@ namespace lp {
905
905
lra.pop ();
906
906
}
907
907
lra.find_feasible_solution ();
908
- SASSERT (lra.is_feasible ());
908
+ SASSERT (lra.get_status () == lp_status::CANCELLED || lra. is_feasible ());
909
909
}
910
910
// Returns true if a branch is created, and false if not.
911
911
// The latter case can happen if we have a sat.
@@ -940,7 +940,7 @@ namespace lp {
940
940
m_lra_level--;
941
941
lra.pop ();
942
942
lra.find_feasible_solution ();
943
- SASSERT (lra.is_feasible ());
943
+ SASSERT (lra.get_status () == lp_status::CANCELLED || lra. is_feasible ());
944
944
}
945
945
946
946
lia_move process_undef () {
@@ -970,8 +970,8 @@ namespace lp {
970
970
lra_pop ();
971
971
continue ;
972
972
}
973
- int st = static_cast < int >( lra.find_feasible_solution () );
974
- if (st >= static_cast < int > (lp_status::FEASIBLE)) {
973
+ auto st = lra.find_feasible_solution ();
974
+ if (( int ) st >= ( int ) (lp_status::FEASIBLE)) {
975
975
// have a feasible solution
976
976
unsigned n_of_ii = get_number_of_int_inf ();
977
977
TRACE (" dio_br" , tout << " n_of_ii:" << n_of_ii << " \n " ;);
@@ -982,7 +982,8 @@ namespace lp {
982
982
// got to create a new branch
983
983
update_branch_stats (*b, n_of_ii);
984
984
need_create_branch = true ;
985
- } else { // got a conflict
985
+ } else {
986
+ if (st == lp_status::CANCELLED) return lia_move::undef;
986
987
collect_evidence ();
987
988
if (m_branch_stack.size () == 0 )
988
989
return lia_move::conflict;
@@ -1023,6 +1024,7 @@ namespace lp {
1023
1024
m_branch_stats[b.m_j ].m_ii_after_right .push_back (n_of_ii);
1024
1025
}
1025
1026
}
1027
+
1026
1028
1027
1029
branch create_branch () {
1028
1030
unsigned bj = UINT_MAX;
@@ -1040,17 +1042,18 @@ namespace lp {
1040
1042
}
1041
1043
}
1042
1044
branch br;
1043
- if (bj == UINT_MAX) { // it a the case when we cannot create a branch
1044
- SASSERT (lra.is_feasible () &&
1045
- [&]() {
1046
- for (unsigned j = 0 ; j < lra.column_count (); ++j) {
1047
- if (lia.column_is_int_inf (j)) {
1048
- return false ;
1049
- }
1050
- }
1051
- return true ;
1052
- }());
1053
- return br; // to signal that we have no ii variables
1045
+ if (bj == UINT_MAX) { // it the case when we cannot create a branch
1046
+ SASSERT (
1047
+ lra.settings ().get_cancel_flag () ||
1048
+ (lra.is_feasible () && [&]() {
1049
+ for (unsigned j = 0 ; j < lra.column_count (); ++j) {
1050
+ if (lia.column_is_int_inf (j)) {
1051
+ return false ;
1052
+ }
1053
+ }
1054
+ return true ;
1055
+ }()));
1056
+ return br; // to signal that we have no ii variables
1054
1057
}
1055
1058
1056
1059
br.m_j = bj;
0 commit comments