fix for bug 254, lemmas were propagating at lower levels, and the conflict clauses...
authorDejan Jovanović <dejan.jovanovic@gmail.com>
Tue, 15 Mar 2011 20:48:57 +0000 (20:48 +0000)
committerDejan Jovanović <dejan.jovanovic@gmail.com>
Tue, 15 Mar 2011 20:48:57 +0000 (20:48 +0000)
let's see if i break the build again

src/prop/minisat/core/Solver.cc

index 80d6b116ec4bebcdd5703f4a7af8a080098646bb..3e4c9d8a24ded547082d556088b5641a1e1a9170 100644 (file)
@@ -933,17 +933,23 @@ lbool Solver::search(int nof_conflicts)
 
         CRef confl = propagate(check_type);
         if (confl != CRef_Undef){
-            // CONFLICT
-            conflicts++; conflictC++;
-            if (decisionLevel() == 0) return l_False;
-
-           // Clear the propagated literals
+            // Clear the propagated literals
             lemma_propagated_literals.clear();
             lemma_propagated_reasons.clear();
+
+            // CONFLICT
+            int max_level = 0;
+            do {
+              conflicts++; conflictC++;
+              if (decisionLevel() == 0) return l_False;
                        
-            learnt_clause.clear();
-            int max_level = analyze(confl, learnt_clause, backtrack_level);
-            cancelUntil(backtrack_level);
+              learnt_clause.clear();
+              max_level = std::max(max_level, analyze(confl, learnt_clause, backtrack_level));
+              cancelUntil(backtrack_level);
+
+              // It might have happened that we have repropagated a literal that is actually learnt_clause[0]
+              // so we must go into conflict resolition again
+            } while (value(learnt_clause[0]) != l_Undef);
 
             if (learnt_clause.size() == 1){
                 uncheckedEnqueue(learnt_clause[0]);