CadicalSolver::~CadicalSolver() {}
/**
- * Terminator class that notifies CaDiCaL to terminate when time limit is
- * reached (used for time limits specified via --tlimit-per).
+ * Terminator class that notifies CaDiCaL to terminate when the resource limit
+ * is reached (used for resource limits specified via --rlimit or --tlimit).
*/
-class TimeLimitTerminator : public CaDiCaL::Terminator
+class ResourceLimitTerminator : public CaDiCaL::Terminator
{
public:
- TimeLimitTerminator(ResourceManager& resmgr) : d_resmgr(resmgr){};
+ ResourceLimitTerminator(ResourceManager& resmgr) : d_resmgr(resmgr){};
- bool terminate() override { return d_resmgr.outOfTime(); }
+ bool terminate() override
+ {
+ d_resmgr.spendResource(Resource::BvSatStep);
+ return d_resmgr.outOfResources() || d_resmgr.outOfTime();
+ }
private:
ResourceManager& d_resmgr;
};
-void CadicalSolver::setTimeLimit(ResourceManager* resmgr)
+void CadicalSolver::setResourceLimit(ResourceManager* resmgr)
{
- d_terminator.reset(new TimeLimitTerminator(*resmgr));
+ d_terminator.reset(new ResourceLimitTerminator(*resmgr));
d_solver->connect_terminator(d_terminator.get());
}
void init();
/**
- * Set time limit per solve() call.
+ * Set resource limit.
*/
- void setTimeLimit(ResourceManager* resmgr);
+ void setResourceLimit(ResourceManager* resmgr);
std::unique_ptr<CaDiCaL::Solver> d_solver;
std::unique_ptr<CaDiCaL::Terminator> d_terminator;
case Resource::ArithNlCoveringStep: return "ArithNlCoveringStep";
case Resource::ArithNlLemmaStep: return "ArithNlLemmaStep";
case Resource::BitblastStep: return "BitblastStep";
- case Resource::BvEagerAssertStep: return "BvEagerAssertStep";
- case Resource::BvPropagationStep: return "BvPropagationStep";
- case Resource::BvSatConflictsStep: return "BvSatConflictsStep";
- case Resource::BvSatPropagateStep: return "BvSatPropagateStep";
- case Resource::BvSatSimplifyStep: return "BvSatSimplifyStep";
+ case Resource::BvSatStep: return "BvSatStep";
case Resource::CnfStep: return "CnfStep";
case Resource::DecisionStep: return "DecisionStep";
case Resource::LemmaStep: return "LemmaStep";