diff --git a/src/cnfizers/Cnfizer.cc b/src/cnfizers/Cnfizer.cc index 8afde6c5b..77316d604 100644 --- a/src/cnfizers/Cnfizer.cc +++ b/src/cnfizers/Cnfizer.cc @@ -430,8 +430,7 @@ bool Cnfizer::addClause(const vec & c_in) } #endif - opensmt::pair iorefs{CRef_Undef, CRef_Undef}; - bool res = solver.addOriginalSMTClause(c, iorefs); + bool res = solver.addOriginalSMTClause(c); return res; } // diff --git a/src/smtsolvers/CoreSMTSolver.cc b/src/smtsolvers/CoreSMTSolver.cc index 270ccdacd..3ce2b7a7c 100644 --- a/src/smtsolvers/CoreSMTSolver.cc +++ b/src/smtsolvers/CoreSMTSolver.cc @@ -269,17 +269,9 @@ Var CoreSMTSolver::newVar(bool sign, bool dvar) return v; } - bool CoreSMTSolver::addOriginalClause_(const vec & _ps) -{ - opensmt::pair fake; - return addOriginalClause_(_ps, fake); -} - -bool CoreSMTSolver::addOriginalClause_(const vec & _ps, opensmt::pair & inOutCRefs) { assert(decisionLevel() == 0); - inOutCRefs = {CRef_Undef, CRef_Undef}; if (!isOK()) { return false; } bool logsProofForInterpolation = this->logsProofForInterpolation(); vec ps; @@ -307,6 +299,7 @@ bool CoreSMTSolver::addOriginalClause_(const vec & _ps, opensmt::pair original; ps.copyTo(original); @@ -314,9 +307,8 @@ bool CoreSMTSolver::addOriginalClause_(const vec & _ps, opensmt::pairnewOriginalClause(inputClause); if (!resolvedUnits.empty()) { proof->beginChain( inputClause ); @@ -325,7 +317,7 @@ bool CoreSMTSolver::addOriginalClause_(const vec & _ps, opensmt::pairaddResolutionStep(reason(v), v); } - proof->endChain(outputClause); + proof->endChain(clauseToInsert); } } if (ps.size() == 0) { @@ -334,7 +326,7 @@ bool CoreSMTSolver::addOriginalClause_(const vec & _ps, opensmt::pair & _ps, opensmt::pair & _ps); // Add a clause to the solver - bool addOriginalClause_(const vec & _ps, opensmt::pair & inOutCRefs); // Add a clause to the solver without making superflous internal copy. Will change the passed vector 'ps'. Write the new clause to cr public: // Solving: // diff --git a/src/smtsolvers/SimpSMTSolver.cc b/src/smtsolvers/SimpSMTSolver.cc index 4eb15fdf2..0112906a2 100644 --- a/src/smtsolvers/SimpSMTSolver.cc +++ b/src/smtsolvers/SimpSMTSolver.cc @@ -184,9 +184,8 @@ lbool SimpSMTSolver::solve_(bool do_simp, bool turn_off_simp) //================================================================================================= // Added code -bool SimpSMTSolver::addOriginalSMTClause(const vec & smt_clause, opensmt::pair & inOutCRefs) +bool SimpSMTSolver::addOriginalSMTClause(const vec & smt_clause) { - inOutCRefs = {CRef_Undef, CRef_Undef}; assert( config.sat_preprocess_theory == 0 ); // Check that the variables exist in the solver @@ -213,7 +212,7 @@ bool SimpSMTSolver::addOriginalSMTClause(const vec & smt_clause, opensmt::p cerr << "XXX skipped handling of unary theory literal?" << endl; } int nclauses = clauses.size(); - if (!CoreSMTSolver::addOriginalClause_(smt_clause, inOutCRefs)) + if (!CoreSMTSolver::addOriginalClause_(smt_clause)) return false; if (use_simplification && clauses.size() == nclauses + 1) @@ -622,8 +621,7 @@ bool SimpSMTSolver::eliminateVar(Var v) vec& resolvent = add_tmp; for (int i = 0; i < pos.size(); i++) { for (int j = 0; j < neg.size(); j++) { - opensmt::pair dummy {CRef_Undef, CRef_Undef}; - if (merge(ca[pos[i]], ca[neg[j]], v, resolvent) && !addOriginalSMTClause(resolvent, dummy)) + if (merge(ca[pos[i]], ca[neg[j]], v, resolvent) && !addOriginalSMTClause(resolvent)) return false; } } @@ -665,8 +663,7 @@ bool SimpSMTSolver::substitute(Var v, Lit x) removeClause(cls[i]); - opensmt::pair dummy {CRef_Undef, CRef_Undef}; - if (!addOriginalSMTClause(subst_clause, dummy)) + if (!addOriginalSMTClause(subst_clause)) return ok = false; } diff --git a/src/smtsolvers/SimpSMTSolver.h b/src/smtsolvers/SimpSMTSolver.h index 430699542..78ec5f392 100644 --- a/src/smtsolvers/SimpSMTSolver.h +++ b/src/smtsolvers/SimpSMTSolver.h @@ -63,7 +63,7 @@ class SimpSMTSolver : public CoreSMTSolver // Var newVar (bool polarity = true, bool dvar = true) override; - bool addOriginalSMTClause(const vec & smt_clause, opensmt::pair & inOutCRefs); + bool addOriginalSMTClause(const vec & smt_clause); public: bool substitute(Var v, Lit x); // Replace all occurences of v with x (may cause a contradiction).