class LFSCBitVectorProof;
class LFSCRewriterProof;
-template <class Solver> class ProofProxy;
-typedef ProofProxy< CVC4::Minisat::Solver> CoreProofProxy;
-typedef ProofProxy< CVC4::BVMinisat::Solver> BVProofProxy;
-
namespace prop {
typedef uint64_t SatVariable;
class SatLiteral;
// Forward declarations.
namespace CVC4 {
class CnfProof;
-template <class Solver>
-class ProofProxy;
} /* namespace CVC4 */
namespace CVC4 {
*/
void storeUnitResolution(typename Solver::TLit lit);
- ProofProxy<Solver>* getProxy() { return d_proxy; }
/**
* Constructs the SAT proof for the given clause,
* by collecting the needed clauses in the d_seen
const ClauseId d_emptyClauseId;
const ClauseId d_nullId;
- // proxy class to break circular dependencies
- ProofProxy<Solver>* d_proxy;
// temporary map for updating CRefs
ClauseIdMap d_temp_clauseId;
Statistics d_statistics;
}; /* class TSatProof */
-template <class S>
-class ProofProxy {
- private:
- TSatProof<S>* d_proof;
-
- public:
- ProofProxy(TSatProof<S>* pf);
- void updateCRef(typename S::TCRef oldref, typename S::TCRef newref);
-}; /* class ProofProxy */
-
template <class SatSolver>
class LFSCSatProof : public TSatProof<SatSolver> {
private:
}
}
-/// ProxyProof
-template <class Solver>
-ProofProxy<Solver>::ProofProxy(TSatProof<Solver>* proof) : d_proof(proof) {}
-
-template <class Solver>
-void ProofProxy<Solver>::updateCRef(typename Solver::TCRef oldref,
- typename Solver::TCRef newref) {
- d_proof->updateCRef(oldref, newref);
-}
-
/// SatProof
template <class Solver>
TSatProof<Solver>::TSatProof(Solver* solver, context::Context* context,
d_seenLemmas(),
d_satProofConstructed(false),
d_statistics(name) {
- d_proxy = new ProofProxy<Solver>(this);
}
template <class Solver>
TSatProof<Solver>::~TSatProof() {
- delete d_proxy;
-
// FIXME: double free if deleted clause also appears in d_seenLemmas?
IdToSatClause::const_iterator it = d_deletedTheoryLemmas.begin();
IdToSatClause::const_iterator end = d_deletedTheoryLemmas.end();
// printf(" >>> RELOCING: %s%d\n", sign(p)?"-":"", var(p)+1);
vec<Watcher>& ws = watches[p];
for (int j = 0; j < ws.size(); j++)
- ca.reloc(ws[j].cref, to, d_bvp ? d_bvp->getSatProof()->getProxy() : NULL);
+ ca.reloc(ws[j].cref, to, d_bvp ? d_bvp->getSatProof() : NULL);
}
// All reasons:
Var v = var(trail[i]);
if (reason(v) != CRef_Undef && (ca[reason(v)].reloced() || locked(ca[reason(v)])))
- ca.reloc(vardata[v].reason, to, d_bvp ? d_bvp->getSatProof()->getProxy() : NULL);
+ ca.reloc(vardata[v].reason, to, d_bvp ? d_bvp->getSatProof() : NULL);
}
// All learnt:
//
for (int i = 0; i < learnts.size(); i++)
- ca.reloc(learnts[i], to, d_bvp ? d_bvp->getSatProof()->getProxy() : NULL);
+ ca.reloc(learnts[i], to, d_bvp ? d_bvp->getSatProof() : NULL);
// All original:
//
for (int i = 0; i < clauses.size(); i++)
- ca.reloc(clauses[i], to, d_bvp ? d_bvp->getSatProof()->getProxy() : NULL);
-
+ ca.reloc(clauses[i], to, d_bvp ? d_bvp->getSatProof() : NULL);
+
if(d_bvp){ d_bvp->getSatProof()->finishUpdateCRef(); }
}
to.moveTo(ca);
}
-void ClauseAllocator::reloc(CRef& cr, ClauseAllocator& to, CVC4::BVProofProxy* proxy)
+void ClauseAllocator::reloc(CRef& cr,
+ ClauseAllocator& to,
+ CVC4::TSatProof<Solver>* proof)
{
CRef old = cr; // save the old reference
cr = to.alloc(c, c.learnt());
c.relocate(cr);
- if (proxy) {
- proxy->updateCRef(old, cr);
+ if (proof)
+ {
+ proof->updateCRef(old, cr);
}
// Copy extra data-fields:
namespace BVMinisat {
class Solver;
}
-template <class Solver> class ProofProxy;
-typedef ProofProxy<BVMinisat::Solver> BVProofProxy;
+template <class Solver>
+class TSatProof;
}
namespace CVC4 {
RegionAllocator<uint32_t>::free(clauseWord32Size(c.size(), c.has_extra()));
}
- void reloc(CRef& cr, ClauseAllocator& to, CVC4::BVProofProxy* proxy = NULL);
+ void reloc(CRef& cr,
+ ClauseAllocator& to,
+ CVC4::TSatProof<Solver>* proof = NULL);
};
#include "options/prop_options.h"
#include "proof/clause_id.h"
#include "proof/proof_manager.h"
-#include "proof/sat_proof_implementation.h"
#include "proof/sat_proof.h"
+#include "proof/sat_proof_implementation.h"
#include "prop/minisat/minisat.h"
#include "prop/minisat/mtl/Sort.h"
#include "prop/theory_proxy.h"
// printf(" >>> RELOCING: %s%d\n", sign(p)?"-":"", var(p)+1);
vec<Watcher>& ws = watches[p];
for (int j = 0; j < ws.size(); j++)
- ca.reloc(ws[j].cref, to, NULLPROOF( ProofManager::getSatProof()->getProxy() ));
+ ca.reloc(ws[j].cref, to, NULLPROOF(ProofManager::getSatProof()));
}
// All reasons:
Var v = var(trail[i]);
if (hasReasonClause(v) && (ca[reason(v)].reloced() || locked(ca[reason(v)])))
- ca.reloc(vardata[v].reason, to, NULLPROOF( ProofManager::getSatProof()->getProxy() ));
+ ca.reloc(
+ vardata[v].reason, to, NULLPROOF(ProofManager::getSatProof()));
}
// All learnt:
//
for (int i = 0; i < clauses_removable.size(); i++)
- ca.reloc(clauses_removable[i], to, NULLPROOF( ProofManager::getSatProof()->getProxy() ));
+ ca.reloc(
+ clauses_removable[i], to, NULLPROOF(ProofManager::getSatProof()));
// All original:
//
for (int i = 0; i < clauses_persistent.size(); i++)
- ca.reloc(clauses_persistent[i], to, NULLPROOF( ProofManager::getSatProof()->getProxy() ));
+ ca.reloc(
+ clauses_persistent[i], to, NULLPROOF(ProofManager::getSatProof()));
- PROOF( ProofManager::getSatProof()->finishUpdateCRef(); )
+ PROOF(ProofManager::getSatProof()->finishUpdateCRef();)
}
return conflict;
}
-void ClauseAllocator::reloc(CRef& cr, ClauseAllocator& to, CVC4::CoreProofProxy* proxy)
+void ClauseAllocator::reloc(CRef& cr,
+ ClauseAllocator& to,
+ CVC4::TSatProof<Solver>* proof)
{
// FIXME what is this CRef_lazy
cr = to.alloc(c.level(), c, c.removable());
c.relocate(cr);
- if (proxy) {
- proxy->updateCRef(old, cr);
+ if (proof)
+ {
+ proof->updateCRef(old, cr);
}
// Copy extra data-fields:
// (This could be cleaned-up. Generalize Clause-constructor to be applicable here instead?)
#include "prop/minisat/mtl/Map.h"
#include "prop/minisat/mtl/Alloc.h"
+namespace CVC4 {
+namespace Minisat {
+class Solver;
+}
+template <class Solver>
+class TSatProof;
+} // namespace CVC4
+
namespace CVC4 {
namespace Minisat {
return out;
}
-
-class Solver;
-
-class ProofProxyAbstract {
-public:
- virtual ~ProofProxyAbstract() {}
- virtual void updateCRef(Minisat::CRef oldref, Minisat::CRef newref) = 0;
-};
-
} /* namespace CVC4::Minisat */
} /* namespace CVC4 */
-namespace CVC4 {
-template <class Solver> class ProofProxy;
-typedef ProofProxy<CVC4::Minisat::Solver> CoreProofProxy;
-}
-
namespace CVC4 {
namespace Minisat{
RegionAllocator<uint32_t>::free(clauseWord32Size(c.size(), c.has_extra()));
}
- void reloc(CRef& cr, ClauseAllocator& to, CVC4::CoreProofProxy* proxy = NULL);
- // Implementation moved to Solver.cc.
+ void reloc(CRef& cr,
+ ClauseAllocator& to,
+ CVC4::TSatProof<Solver>* proof = NULL);
+ // Implementation moved to Solver.cc.
};