src/probe.cpp
// This a specialized instance of 'analyze'.
This a specialized instance of 'analyze'.
This a specialized instance of ' analyze ' .
void Internal::failed_literal (int failed) {
  LOG ("analyzing failed literal probe %d", failed);
  stats.failed++;
  assert (!unsat);
  assert (conflict);
  assert (level == 1);
  assert (analyzed.empty ());
  START (analyze);
  LOG (conflict, "analyzing failed literal conflict");
  const const_literal_iterator end = conflict->end ();
  const_literal_iterator i;
  int uip = 0;
  for (i = conflict->begin (); i != end; i++) {
    const int other = -*i;
    if (!var (other).level) continue;
    uip = uip ? probe_dominator (uip, other) : other;
  }
  LOG ("found probing UIP %d", uip);
  assert (uip);
  vector<int> parents;
  int parent = uip;
  while (parent != failed) {
    int next = var (parent).parent;
    if (parent < 0) next = -next;
    parent = next;
    assert (parent);
    parents.push_back (parent);
  }
  packtrack (failed);
  clear_seen ();
  conflict = 0;
  assert (!val (uip));
  probe_assign_unit (-uip);
  if (!probagate ()) learn_empty_clause ();
  while (!unsat && !parents.empty ()) {
    const int parent = parents.back ();
    parents.pop_back ();
    const int tmp = val (parent);
    if (tmp < 0) continue;
    if (tmp > 0) {
      LOG ("clashing failed parent %d", parent);
      learn_empty_clause ();
    } else {
      LOG ("found unassigned failed parent %d", parent);
      probe_assign_unit (-parent);
      if (!probagate ()) learn_empty_clause ();
    }
  }
  erase_vector (parents);
  STOP (analyze);
  assert (unsat || val (failed) < 0);
}
void Internal :: failed_literal ( int failed ) { LOG ( " " , failed ) ; stats . failed ++ ; assert ( ! unsat ) ; assert ( conflict ) ; assert ( level == 1 ) ; assert ( analyzed . empty ( ) ) ; START ( analyze ) ; LOG ( conflict , " " ) ; const const_literal_iterator end = conflict -> end ( ) ; const_literal_iterator i ; int uip = 0 ; for ( i = conflict -> begin ( ) ; i != end ; i ++ ) { const int other = - * i ; if ( ! var ( other ) . level ) continue ; uip = uip ? probe_dominator ( uip , other ) : other ; } LOG ( " " , uip ) ; assert ( uip ) ; vector < int > parents ; int parent = uip ; while ( parent != failed ) { int next = var ( parent ) . parent ; if ( parent < 0 ) next = - next ; parent = next ; assert ( parent ) ; parents . push_back ( parent ) ; } packtrack ( failed ) ; clear_seen ( ) ; conflict = 0 ; assert ( ! val ( uip ) ) ; probe_assign_unit ( - uip ) ; if ( ! probagate ( ) ) learn_empty_clause ( ) ; while ( ! unsat && ! parents . empty ( ) ) { const int parent = parents . back ( ) ; parents . pop_back ( ) ; const int tmp = val ( parent ) ; if ( tmp < 0 ) continue ; if ( tmp > 0 ) { LOG ( " " , parent ) ; learn_empty_clause ( ) ; } else { LOG ( " " , parent ) ; probe_assign_unit ( - parent ) ; if ( ! probagate ( ) ) learn_empty_clause ( ) ; } } erase_vector ( parents ) ; STOP ( analyze ) ; assert ( unsat || val ( failed ) < 0 ) ; }
This a specialized instance of 'analyze'.
This a specialized instance of ' analyze ' .