#include <vector>
#include "context/cdhashmap.h"
+#include "context/cdmaybe.h"
#include "expr/expr.h"
#include "proof/clause_id.h"
#include "proof/proof_manager.h"
IdCRefMap d_temp_idClause;
// unit conflict
- ClauseId d_unitConflictId;
- bool d_storedUnitConflict;
+ context::CDMaybe<ClauseId> d_unitConflictId;
ClauseId d_trueLit;
ClauseId d_falseLit;
d_nullId(-2),
d_temp_clauseId(),
d_temp_idClause(),
- d_unitConflictId(),
- d_storedUnitConflict(false),
+ d_unitConflictId(context),
d_trueLit(ClauseIdUndef),
d_falseLit(ClauseIdUndef),
d_name(name),
ClauseId TSatProof<Solver>::storeUnitConflict(
typename Solver::TLit conflict_lit, ClauseKind kind) {
Debug("cores") << "STORE UNIT CONFLICT" << std::endl;
- Assert(!d_storedUnitConflict);
- d_unitConflictId = registerUnitClause(conflict_lit, kind);
- d_storedUnitConflict = true;
- Debug("proof:sat:detailed") << "storeUnitConflict " << d_unitConflictId
+ Assert(!d_unitConflictId.isSet());
+ d_unitConflictId.set(registerUnitClause(conflict_lit, kind));
+ Debug("proof:sat:detailed") << "storeUnitConflict " << d_unitConflictId.get()
<< "\n";
- return d_unitConflictId;
+ return d_unitConflictId.get();
}
template <class Solver>
Assert(conflict_ref != Solver::TCRef_Undef);
ClauseId conflict_id;
if (conflict_ref == Solver::TCRef_Lazy) {
- Assert(d_storedUnitConflict);
- conflict_id = d_unitConflictId;
+ Assert(d_unitConflictId.isSet());
+ conflict_id = d_unitConflictId.get();
ResChain<Solver>* res = new ResChain<Solver>(conflict_id);
typename Solver::TLit lit = d_idUnit[conflict_id];
return;
} else {
- Assert(!d_storedUnitConflict);
+ Assert(!d_unitConflictId.isSet());
conflict_id = registerClause(conflict_ref, LEARNT); // FIXME
}