src/probagate.cpp
// Finally note that adding clauses changes the watches of the probagated
// literal and thus we can not use standard iterators during probing but
// need to fall back to indices.  One watch for the hyper binary resolvent
// clause is added at the end of the currently propagated watches, but its
// watch is a binary watch and will be skipped during propagating long
// clauses anyhow.
Finally note that adding clauses changes the watches of the probagated
literal and thus we can not use standard iterators during probing but
need to fall back to indices.  One watch for the hyper binary resolvent
clause is added at the end of the currently propagated watches, but its
watch is a binary watch and will be skipped during propagating long
clauses anyhow.
Finally note that adding clauses changes the watches of the probagated literal and thus we can not use standard iterators during probing but need to fall back to indices . One watch for the hyper binary resolvent clause is added at the end of the currently propagated watches but its watch is a binary watch and will be skipped during propagating long clauses anyhow .
inline int Internal::hyper_binary_resolve (Clause * reason) {
  assert (level == 1);
  assert (reason->size > 2);
  const const_literal_iterator end = reason->end ();
  const int * lits = reason->literals;
  const_literal_iterator k;
#ifndef NDEBUG
  assert (!val (lits[0]));
  for (k = lits + 1; k != end; k++) assert (val (*k) < 0);
  assert (var (lits[1]).level == 1);
#endif
  LOG (reason, "hyper binary resolving");
  stats.hbrs++;
  stats.hbrsizes += reason->size;
  const int lit = lits[1];
  int dom = -lit, non_root_level_literals = 0;
  for (k = lits + 2; k != end; k++) {
    const int other = -*k;
    assert (val (other) > 0);
    if (!var (other).level) continue;
    dom = probe_dominator (dom, other);
    non_root_level_literals++;
  }
  if (non_root_level_literals && opts.hbr) { 
    bool contained = false;
    for (k = lits + 1; !contained && k != end; k++)
      contained = (*k == -dom);
    const bool red = !contained || reason->redundant;
    if (red) stats.hbreds++;
    LOG ("new %s hyper binary resolvent %d %d",
      (red ? "redundant" : "irredundant"), -dom, lits[0]);
    assert (clause.empty ());
    clause.push_back (-dom);
    clause.push_back (lits[0]);
    external->check_learned_clause ();
    Clause * c = new_hyper_binary_resolved_clause (red, 2);
    if (red) c->hbr = true;
    clause.clear ();
    if (contained) {
      stats.hbrsubs++;
      LOG (reason, "subsumed original");
      mark_garbage (reason);
    }
  }
  return dom;
}
inline int Internal :: hyper_binary_resolve ( Clause * reason ) { assert ( level == 1 ) ; assert ( reason -> size > 2 ) ; const const_literal_iterator end = reason -> end ( ) ; const int * lits = reason -> literals ; const_literal_iterator k ; #ifndef NDEBUG assert ( ! val ( lits [ 0 ] ) ) ; for ( k = lits + 1 ; k != end ; k ++ ) assert ( val ( * k ) < 0 ) ; assert ( var ( lits [ 1 ] ) . level == 1 ) ; #endif LOG ( reason , " " ) ; stats . hbrs ++ ; stats . hbrsizes += reason -> size ; const int lit = lits [ 1 ] ; int dom = - lit , non_root_level_literals = 0 ; for ( k = lits + 2 ; k != end ; k ++ ) { const int other = - * k ; assert ( val ( other ) > 0 ) ; if ( ! var ( other ) . level ) continue ; dom = probe_dominator ( dom , other ) ; non_root_level_literals ++ ; } if ( non_root_level_literals && opts . hbr ) { bool contained = false ; for ( k = lits + 1 ; ! contained && k != end ; k ++ ) contained = ( * k == - dom ) ; const bool red = ! contained || reason -> redundant ; if ( red ) stats . hbreds ++ ; LOG ( " " , ( red ? " " : " " ) , - dom , lits [ 0 ] ) ; assert ( clause . empty ( ) ) ; clause . push_back ( - dom ) ; clause . push_back ( lits [ 0 ] ) ; external -> check_learned_clause ( ) ; Clause * c = new_hyper_binary_resolved_clause ( red , 2 ) ; if ( red ) c -> hbr = true ; clause . clear ( ) ; if ( contained ) { stats . hbrsubs ++ ; LOG ( reason , " " ) ; mark_garbage ( reason ) ; } } return dom ; }
Finally note that adding clauses changes the watches of the probagated
literal and thus we can not use standard iterators during probing but
need to fall back to indices.
Finally note that adding clauses changes the watches of the probagated literal and thus we can not use standard iterators during probing but need to fall back to indices .
// First literal unassigned, all others false. // !(A)