d_emptyClauseId(-1),
d_nullId(-2),
d_temp_clauseId(),
- d_temp_idClause()
+ d_temp_idClause(),
+ d_unitConflictId(),
+ d_storedUnitConflict(false)
{
d_proxy = new ProofProxy(this);
}
d_inputClauses.insert(newId);
}
}
+ Debug("proof:sat:detailed") <<"registerClause " << d_clauseId[clause] << " " <<isInput << "\n";
return d_clauseId[clause];
}
d_inputClauses.insert(newId);
}
}
+ Debug("proof:sat:detailed") <<"registerUnitClause " << d_unitId[toInt(lit)] << " " << isInput <<"\n";
return d_unitId[toInt(lit)];
}
Unimplemented("native proof printing not supported yet");
}
+void SatProof::storeUnitConflict(::Minisat::Lit conflict_lit) {
+ Assert (!d_storedUnitConflict);
+ d_unitConflictId = registerUnitClause(conflict_lit);
+ d_storedUnitConflict = true;
+ Debug("proof:sat:detailed") <<"storeUnitConflict " << d_unitConflictId << "\n";
+}
+
void SatProof::finalizeProof(::Minisat::CRef conflict_ref) {
Assert(d_resStack.size() == 0);
- //ClauseId conflict_id = getClauseId(conflict_ref);
- ClauseId conflict_id = registerClause(conflict_ref); //FIXME
+ Assert (conflict_ref != ::Minisat::CRef_Undef);
+ ClauseId conflict_id;
+ if (conflict_ref == ::Minisat::CRef_Lazy) {
+ Assert (d_storedUnitConflict);
+ conflict_id = d_unitConflictId;
+ } else {
+ Assert (!d_storedUnitConflict);
+ conflict_id = registerClause(conflict_ref); //FIXME
+ }
+
Debug("proof:sat") << "proof::finalizeProof Final Conflict ";
print(conflict_id);
d_seenLemmas.insert(id);
}
+ Assert (d_resChains.find(id) != d_resChains.end());
ResChain* res = d_resChains[id];
ClauseId start = res->getStart();
collectLemmas(start);
void LFSCSatProof::printInputClause(ClauseId id) {
+ if (isUnit(id)) {
+ ::Minisat::Lit lit = getUnit(id);
+ d_clauseSS << "(% " << clauseName(id) << " (holds (clc ";
+ d_clauseSS << varName(lit) << "cln ))";
+ d_paren << ")";
+ return;
+ }
+
ostringstream os;
CRef ref = getClauseRef(id);
Assert (ref != CRef_Undef);
// temporary map for updating CRefs
ClauseIdMap d_temp_clauseId;
- IdClauseMap d_temp_idClause;
+ IdClauseMap d_temp_idClause;
+
+ // unit conflict
+ ClauseId d_unitConflictId;
+ bool d_storedUnitConflict;
public:
SatProof(::Minisat::Solver* solver, bool checkRes = false);
protected:
/// clause registration methods
ClauseId registerClause(const ::Minisat::CRef clause, bool isInput = false);
ClauseId registerUnitClause(const ::Minisat::Lit lit, bool isInput = false);
+
+ void storeUnitConflict(::Minisat::Lit lit);
+
/**
* Marks the deleted clauses as deleted. Note we may still use them in the final
* resolution.
// Construct the reason
CRef real_reason = ca.alloc(explLevel, explanation, true);
+ PROOF (ProofManager::getSatProof()->registerClause(real_reason, true); );
vardata[x] = VarData(real_reason, level(x), user_level(x), intro_level(x), trail_index(x));
clauses_removable.push(real_reason);
attachClause(real_reason);
continue;
}
// If a literals is false at 0 level (both sat and user level) we also ignore it
- if (value(ps[i]) == l_False) {
+ if (value(ps[i]) == l_False && !PROOF_ON() ) {
if (level(var(ps[i])) == 0 && user_level(var(ps[i])) == 0) {
continue;
} else {
// If there are lemmas (or conflicts) update them
if (lemmas.size() > 0) {
recheck = true;
- return updateLemmas();
+ confl = updateLemmas();
+ return confl;
} else {
recheck = proxy->theoryNeedCheck();
return confl;
do {
// Propagate on the clauses
confl = propagateBool();
-
// If no conflict, do the theory check
if (confl == CRef_Undef && type != CHECK_WITHOUTH_THEORY) {
// Do the theory check
}
}
} while (confl == CRef_Undef && qhead < trail.size());
-
return confl;
}
vec<Lit>& lemma = lemmas[i];
// If it's an empty lemma, we have a conflict at zero level
if (lemma.size() == 0) {
+ Assert (! PROOF_ON());
conflict = CRef_Lazy;
backtrackLevel = 0;
Debug("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl;
}
lemma_ref = ca.alloc(clauseLevel, lemma, removable);
+ PROOF (ProofManager::getSatProof()->registerClause(lemma_ref, true); );
if (removable) {
clauses_removable.push(lemma_ref);
} else {
} else {
Debug("minisat::lemmas") << "Solver::updateLemmas(): unit conflict or empty clause" << std::endl;
conflict = CRef_Lazy;
+ PROOF(ProofManager::getSatProof()->storeUnitConflict(lemma[0]););
}
} else {
Debug("minisat::lemmas") << "lemma size is " << lemma.size() << std::endl;