d_pp.reset(
new smt::Preprocessor(*this, *d_env.get(), *d_absValues.get(), *d_stats));
// make the SMT solver
- d_smtSolver.reset(
- new SmtSolver(*this, *d_env.get(), *d_state, *d_pp, *d_stats));
+ d_smtSolver.reset(new SmtSolver(*d_env.get(), *d_state, *d_pp, *d_stats));
// make the SyGuS solver
d_sygusSolver.reset(
new SygusSolver(*d_smtSolver, *d_pp, getUserContext(), d_outMgr));
LogicInfo everything;
everything.lock();
getPrinter().toStreamCmdComment(
- getOutputManager().getDumpOut(),
+ d_env->getDumpOut(),
"cvc5 always dumps the most general, all-supported logic (below), as "
"some internals might require the use of a logic more general than "
"the input.");
- getPrinter().toStreamCmdSetBenchmarkLogic(getOutputManager().getDumpOut(),
+ getPrinter().toStreamCmdSetBenchmarkLogic(d_env->getDumpOut(),
everything.getLogicString());
}
if (Dump.isOn("raw-benchmark"))
{
getPrinter().toStreamCmdSetBenchmarkLogic(
- getOutputManager().getDumpOut(), getLogicInfo().getLogicString());
+ d_env->getDumpOut(), getLogicInfo().getLogicString());
}
}
catch (IllegalArgumentException& e)
(value == "sat")
? Result::SAT
: ((value == "unsat") ? Result::UNSAT : Result::SAT_UNKNOWN);
- getPrinter().toStreamCmdSetBenchmarkStatus(
- getOutputManager().getDumpOut(), status);
+ getPrinter().toStreamCmdSetBenchmarkStatus(d_env->getDumpOut(), status);
}
else
{
- getPrinter().toStreamCmdSetInfo(
- getOutputManager().getDumpOut(), key, value);
+ getPrinter().toStreamCmdSetInfo(d_env->getDumpOut(), key, value);
}
}
if (Dump.isOn("raw-benchmark"))
{
getPrinter().toStreamCmdDefineFunctionRec(
- getOutputManager().getDumpOut(), funcs, formals, formulas);
+ d_env->getDumpOut(), funcs, formals, formulas);
}
NodeManager* nm = getNodeManager();
{
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdCheckSat(getOutputManager().getDumpOut(),
- assumption);
+ getPrinter().toStreamCmdCheckSat(d_env->getDumpOut(), assumption);
}
std::vector<Node> assump;
if (!assumption.isNull())
{
if (assumptions.empty())
{
- getPrinter().toStreamCmdCheckSat(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdCheckSat(d_env->getDumpOut());
}
else
{
- getPrinter().toStreamCmdCheckSatAssuming(getOutputManager().getDumpOut(),
+ getPrinter().toStreamCmdCheckSatAssuming(d_env->getDumpOut(),
assumptions);
}
}
{
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdQuery(getOutputManager().getDumpOut(), node);
+ getPrinter().toStreamCmdQuery(d_env->getDumpOut(), node);
}
return checkSatInternal(
node.isNull() ? std::vector<Node>() : std::vector<Node>{node},
finishInit();
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdGetUnsatAssumptions(
- getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdGetUnsatAssumptions(d_env->getDumpOut());
}
UnsatCore core = getUnsatCoreInternal();
std::vector<Node> res;
if (Dump.isOn("raw-benchmark"))
{
- getPrinter().toStreamCmdAssert(getOutputManager().getDumpOut(), formula);
+ getPrinter().toStreamCmdAssert(d_env->getDumpOut(), formula);
}
// Substitute out any abstract values in ex
d_sygusSolver->declareSygusVar(var);
if (Dump.isOn("raw-benchmark"))
{
- getPrinter().toStreamCmdDeclareVar(
- getOutputManager().getDumpOut(), var, var.getType());
+ getPrinter().toStreamCmdDeclareVar(d_env->getDumpOut(), var, var.getType());
}
// don't need to set that the conjecture is stale
}
if (Dump.isOn("raw-benchmark"))
{
getPrinter().toStreamCmdSynthFun(
- getOutputManager().getDumpOut(), func, vars, isInv, sygusType);
+ d_env->getDumpOut(), func, vars, isInv, sygusType);
}
}
void SmtEngine::declareSynthFun(Node func,
d_sygusSolver->assertSygusConstraint(constraint);
if (Dump.isOn("raw-benchmark"))
{
- getPrinter().toStreamCmdConstraint(getOutputManager().getDumpOut(),
- constraint);
+ getPrinter().toStreamCmdConstraint(d_env->getDumpOut(), constraint);
}
}
if (Dump.isOn("raw-benchmark"))
{
getPrinter().toStreamCmdInvConstraint(
- getOutputManager().getDumpOut(), inv, pre, trans, post);
+ d_env->getDumpOut(), inv, pre, trans, post);
}
}
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdGetModel(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdGetModel(d_env->getDumpOut());
}
Model* m = getAvailableModel("get model");
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdBlockModel(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdBlockModel(d_env->getDumpOut());
}
Model* m = getAvailableModel("block model");
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdBlockModelValues(getOutputManager().getDumpOut(),
- exprs);
+ getPrinter().toStreamCmdBlockModelValues(d_env->getDumpOut(), exprs);
}
Model* m = getAvailableModel("block model values");
finishInit();
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdGetUnsatCore(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdGetUnsatCore(d_env->getDumpOut());
}
return getUnsatCoreInternal();
}
finishInit();
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdGetProof(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdGetProof(d_env->getDumpOut());
}
if (!d_env->getOptions().smt.produceProofs)
{
d_state->doPendingPops();
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdGetAssertions(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdGetAssertions(d_env->getDumpOut());
}
Trace("smt") << "SMT getAssertions()" << endl;
if (!d_env->getOptions().smt.produceAssertions)
Trace("smt") << "SMT push()" << endl;
d_smtSolver->processAssertions(*d_asserts);
if(Dump.isOn("benchmark")) {
- getPrinter().toStreamCmdPush(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdPush(d_env->getDumpOut());
}
d_state->userPush();
}
Trace("smt") << "SMT pop()" << endl;
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdPop(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdPop(d_env->getDumpOut());
}
d_state->userPop();
Trace("smt") << "SMT resetAssertions()" << endl;
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdResetAssertions(getOutputManager().getDumpOut());
+ getPrinter().toStreamCmdResetAssertions(d_env->getDumpOut());
}
d_asserts->clearCurrent();
if (Dump.isOn("benchmark"))
{
- getPrinter().toStreamCmdSetOption(
- getOutputManager().getDumpOut(), key, value);
+ getPrinter().toStreamCmdSetOption(d_env->getDumpOut(), key, value);
}
if (key == "command-verbosity")
namespace cvc5 {
namespace smt {
-SmtSolver::SmtSolver(SmtEngine& smt,
- Env& env,
+SmtSolver::SmtSolver(Env& env,
SmtEngineState& state,
Preprocessor& pp,
SmtEngineStatistics& stats)
- : d_smt(smt),
- d_env(env),
+ : d_env(env),
d_state(state),
d_pp(pp),
d_stats(stats),
// engine later (it is non-essential there)
d_theoryEngine.reset(new TheoryEngine(
d_env,
- d_smt.getOutputManager(),
// Other than whether d_pm is set, theory engine proofs are conditioned on
// the relationshup between proofs and unsat cores: the unsat cores are in
// FULL_PROOF mode, no proofs are generated on theory engine.
* are unregistered by the obsolete PropEngine object before registered
* again by the new PropEngine object */
d_propEngine.reset(nullptr);
- d_propEngine.reset(new prop::PropEngine(
- d_theoryEngine.get(), d_env, d_smt.getOutputManager(), d_pnm));
+ d_propEngine.reset(new prop::PropEngine(d_theoryEngine.get(), d_env, d_pnm));
Trace("smt-debug") << "Setting up theory engine..." << std::endl;
d_theoryEngine->setPropEngine(getPropEngine());
* statistics are unregistered by the obsolete PropEngine object before
* registered again by the new PropEngine object */
d_propEngine.reset(nullptr);
- d_propEngine.reset(new prop::PropEngine(
- d_theoryEngine.get(), d_env, d_smt.getOutputManager(), d_pnm));
+ d_propEngine.reset(new prop::PropEngine(d_theoryEngine.get(), d_env, d_pnm));
d_theoryEngine->setPropEngine(getPropEngine());
// Notice that we do not reset TheoryEngine, nor does it require calling
// finishInit again. In particular, TheoryEngine::finishInit does not
// then, initialize the assertions
as.initializeCheckSat(assumptions, isEntailmentCheck);
- // make the check
- Assert(d_smt.isFullyInited());
+ // make the check, where notice smt engine should be fully inited by now
Trace("smt") << "SmtSolver::check()" << endl;
}
TheoryEngine::TheoryEngine(Env& env,
- OutputManager& outMgr,
ProofNodeManager* pnm)
: d_propEngine(nullptr),
d_env(env),
d_logicInfo(env.getLogicInfo()),
- d_outMgr(outMgr),
d_pnm(pnm),
d_lazyProof(d_pnm != nullptr
? new LazyCDProof(d_pnm,
void TheoryEngine::dumpAssertions(const char* tag) {
if (Dump.isOn(tag)) {
- const Printer& printer = d_outMgr.getPrinter();
- std::ostream& out = d_outMgr.getDumpOut();
+ const Printer& printer = d_env.getPrinter();
+ std::ostream& out = d_env.getDumpOut();
printer.toStreamCmdComment(out, "Starting completeness check");
for (TheoryId theoryId = THEORY_FIRST; theoryId < THEORY_LAST; ++theoryId) {
Theory* theory = d_theoryTable[theoryId];
if(Dump.isOn("t-lemmas")) {
// we dump the negation of the lemma, to show validity of the lemma
Node n = lemma.negate();
- const Printer& printer = d_outMgr.getPrinter();
- std::ostream& out = d_outMgr.getDumpOut();
+ const Printer& printer = d_env.getPrinter();
+ std::ostream& out = d_env.getDumpOut();
printer.toStreamCmdComment(out, "theory lemma: expect valid");
printer.toStreamCmdCheckSat(out, n);
}
markInConflict();
if(Dump.isOn("t-conflicts")) {
- const Printer& printer = d_outMgr.getPrinter();
- std::ostream& out = d_outMgr.getDumpOut();
+ const Printer& printer = d_env.getPrinter();
+ std::ostream& out = d_env.getDumpOut();
printer.toStreamCmdComment(out, "theory conflict: expect unsat");
printer.toStreamCmdCheckSat(out, conflict);
}