This is in preparation for making SmtSolver able to be deep reset (reconstructed) within in a SolverEngine instance.
{
}
+void ProofChecker::reset()
+{
+ d_checker.clear();
+ d_plevel.clear();
+}
+
Node ProofChecker::check(ProofNode* pn, Node expected)
{
return check(pn->getRule(), pn->getChildren(), pn->getArguments(), expected);
uint32_t pclevel = 0,
rewriter::RewriteDb* rdb = nullptr);
~ProofChecker() {}
+ /** Reset, which clears the rule checkers */
+ void reset();
/**
* Return the formula that is proven by proof node pn, or null if pn is not
* well-formed. If expected is non-null, then we return null if pn does not
#include "smt/smt_solver.h"
+#include "options/base_options.h"
#include "options/main_options.h"
#include "options/smt_options.h"
#include "prop/prop_engine.h"
namespace smt {
SmtSolver::SmtSolver(Env& env,
- SolverEngineState& state,
AbstractValues& abs,
SolverEngineStatistics& stats)
- : d_env(env),
- d_state(state),
+ : EnvObj(env),
d_pp(env, abs, stats),
d_stats(stats),
d_theoryEngine(nullptr),
ProofNodeManager* pnm = d_env.getProofNodeManager();
if (pnm)
{
+ // reset the rule checkers
+ pnm->getChecker()->reset();
+ // add rule checkers from the theory engine
d_theoryEngine->initializeProofChecker(pnm->getChecker());
}
Trace("smt-debug") << "Making prop engine..." << std::endl;
const std::vector<Node>& assumptions)
{
Result result;
-
- bool hasAssumptions = !assumptions.empty();
-
try
{
- // update the state to indicate we are about to run a check-sat
- d_state.notifyCheckSat(hasAssumptions);
// then, initialize the assertions
as.initializeCheckSat(assumptions);
// set the filename on the result
const std::string& filename = d_env.getOptions().driver.filename;
- result = Result(result, filename);
-
- // notify our state of the check-sat result
- d_state.notifyCheckSatResult(hasAssumptions, result);
-
- return result;
+ return Result(result, filename);
}
void SmtSolver::processAssertions(Assertions& as)
{
TimerStat::CodeTimer paTimer(d_stats.d_processAssertionsTime);
d_env.getResourceManager()->spendResource(Resource::PreprocessStep);
- Assert(d_state.isFullyReady());
preprocessing::AssertionPipeline& ap = as.getAssertionPipeline();
#include <vector>
#include "expr/node.h"
+#include "smt/assertions.h"
+#include "smt/env_obj.h"
#include "smt/preprocessor.h"
#include "theory/logic_info.h"
#include "util/result.h"
namespace smt {
-class Assertions;
class SolverEngineState;
struct SolverEngineStatistics;
* models) can be queries using other classes that examine the state of the
* TheoryEngine directly, which can be accessed via getTheoryEngine.
*/
-class SmtSolver
+class SmtSolver : protected EnvObj
{
public:
SmtSolver(Env& env,
- SolverEngineState& state,
AbstractValues& abs,
SolverEngineStatistics& stats);
~SmtSolver();
//------------------------------------------ end access methods
private:
- /** Reference to the environment */
- Env& d_env;
- /** Reference to the state of the SolverEngine */
- SolverEngineState& d_state;
/** The preprocessor of this SMT solver */
Preprocessor d_pp;
/** Reference to the statistics of SolverEngine */
// make statistics
d_stats.reset(new SolverEngineStatistics());
// make the SMT solver
- d_smtSolver.reset(new SmtSolver(*d_env, *d_state, *d_absValues, *d_stats));
+ d_smtSolver.reset(new SmtSolver(*d_env, *d_absValues, *d_stats));
// make the SyGuS solver
d_sygusSolver.reset(new SygusSolver(*d_env.get(), *d_smtSolver));
// make the quantifier elimination solver
Result SolverEngine::checkSatInternal(const std::vector<Node>& assumptions)
{
- Result r;
-
SolverEngineScope smts(this);
finishInit();
Trace("smt") << "SolverEngine::checkSat(" << assumptions << ")" << endl;
+ // update the state to indicate we are about to run a check-sat
+ bool hasAssumptions = !assumptions.empty();
+ d_state->notifyCheckSat(hasAssumptions);
+
+ // state should be fully ready now
+ Assert(d_state->isFullyReady());
+
// check the satisfiability with the solver object
- r = d_smtSolver->checkSatisfiability(*d_asserts.get(), assumptions);
+ Result r = d_smtSolver->checkSatisfiability(*d_asserts.get(), assumptions);
Trace("smt") << "SolverEngine::checkSat(" << assumptions << ") => " << r
<< endl;
+ // notify our state of the check-sat result
+ d_state->notifyCheckSatResult(hasAssumptions, r);
// Check that SAT results generate a model correctly.
if (d_env->getOptions().smt.checkModels)