diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-02-22 16:07:16 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 16:07:16 -0600 |
commit | 71d72df0437607723256bbd7b4f28cd6c89fe40f (patch) | |
tree | 1021b9e166290db4637a0be447da359d0aed4752 /src/smt | |
parent | 580f3e93c2cc4564e6fa87d07426dc1ff87224e4 (diff) |
(proof-new) Change proof-new option to proof (#5955)
Also moves several proof-specific options to proof_options.
Diffstat (limited to 'src/smt')
-rw-r--r-- | src/smt/preprocess_proof_generator.cpp | 4 | ||||
-rw-r--r-- | src/smt/proof_manager.cpp | 4 | ||||
-rw-r--r-- | src/smt/proof_post_processor.cpp | 3 | ||||
-rw-r--r-- | src/smt/set_defaults.cpp | 28 | ||||
-rw-r--r-- | src/smt/smt_engine.cpp | 33 |
5 files changed, 31 insertions, 41 deletions
diff --git a/src/smt/preprocess_proof_generator.cpp b/src/smt/preprocess_proof_generator.cpp index cb2887ec0..ef80ebdae 100644 --- a/src/smt/preprocess_proof_generator.cpp +++ b/src/smt/preprocess_proof_generator.cpp @@ -16,7 +16,7 @@ #include "smt/preprocess_proof_generator.h" #include "expr/proof.h" -#include "options/smt_options.h" +#include "options/proof_options.h" #include "theory/rewriter.h" namespace CVC4 { @@ -235,7 +235,7 @@ std::string PreprocessProofGenerator::identify() const { return d_name; } void PreprocessProofGenerator::checkEagerPedantic(PfRule r) { - if (options::proofNewEagerChecking()) + if (options::proofEagerChecking()) { // catch a pedantic failure now, which otherwise would not be // triggered since we are doing lazy proof generation diff --git a/src/smt/proof_manager.cpp b/src/smt/proof_manager.cpp index b8f68af88..cb7943aed 100644 --- a/src/smt/proof_manager.cpp +++ b/src/smt/proof_manager.cpp @@ -16,7 +16,7 @@ #include "expr/proof_node_algorithm.h" #include "options/base_options.h" -#include "options/smt_options.h" +#include "options/proof_options.h" #include "smt/assertions.h" #include "smt/defined_function.h" @@ -24,7 +24,7 @@ namespace CVC4 { namespace smt { PfManager::PfManager(context::UserContext* u, SmtEngine* smte) - : d_pchecker(new ProofChecker(options::proofNewPedantic())), + : d_pchecker(new ProofChecker(options::proofPedantic())), d_pnm(new ProofNodeManager(d_pchecker.get())), d_pppg(new PreprocessProofGenerator( d_pnm.get(), u, "smt::PreprocessProofGenerator")), diff --git a/src/smt/proof_post_processor.cpp b/src/smt/proof_post_processor.cpp index ab8dd8f92..0898096f5 100644 --- a/src/smt/proof_post_processor.cpp +++ b/src/smt/proof_post_processor.cpp @@ -15,6 +15,7 @@ #include "smt/proof_post_processor.h" #include "expr/skolem_manager.h" +#include "options/proof_options.h" #include "options/smt_options.h" #include "preprocessing/assertion_pipeline.h" #include "smt/smt_engine.h" @@ -1110,7 +1111,7 @@ bool ProofPostprocessFinalCallback::shouldUpdate(std::shared_ptr<ProofNode> pn, { PfRule r = pn->getRule(); // if not doing eager pedantic checking, fail if below threshold - if (!options::proofNewEagerChecking()) + if (!options::proofEagerChecking()) { if (!d_pedanticFailure) { diff --git a/src/smt/set_defaults.cpp b/src/smt/set_defaults.cpp index 93196fde4..98fbfe1b3 100644 --- a/src/smt/set_defaults.cpp +++ b/src/smt/set_defaults.cpp @@ -73,7 +73,7 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) } if (options::checkUnsatCoresNew()) { - options::proofNew.set(true); + options::proof.set(true); } if (options::bitvectorAigSimplifications.wasSetByUser()) { @@ -872,16 +872,6 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) } if (options::ufHo()) { - // if higher-order, disable proof production - if (options::proofNew()) - { - if (options::proofNew.wasSetByUser()) - { - Warning() << "SmtEngine: turning off proof production (not yet " - "supported with --uf-ho)\n"; - } - options::proofNew.set(false); - } // if higher-order, then current variants of model-based instantiation // cannot be used if (options::mbqiMode() != options::MbqiMode::NONE) @@ -1095,16 +1085,6 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) { options::nlExtTangentPlanes.set(true); } - // not compatible with proofs - if (options::proofNew()) - { - if (options::proofNew.wasSetByUser()) - { - Notice() << "SmtEngine: setting proof-new to false to support SyGuS" - << std::endl; - } - options::proofNew.set(false); - } } // counterexample-guided instantiation for non-sygus // enable if any possible quantifiers with arithmetic, datatypes or bitvectors @@ -1394,10 +1374,10 @@ void setDefaults(LogicInfo& logic, bool isInternalSubsolver) "division. " "Try --bv-div-zero-const to interpret division by zero as a constant."); } - // !!!!!!!!!!!!!!!! temporary, until proof-new is functional - if (options::proofNew()) + // !!!!!!!!!!!!!!!! temporary, until proofs are functional + if (options::proof()) { - throw OptionException("--proof-new is not yet supported."); + throw OptionException("--proof is not yet supported."); } if (logic == LogicInfo("QF_UFNRA")) diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 09d54d6d8..941fd111a 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -22,11 +22,13 @@ #include "base/modal_exception.h" #include "base/output.h" #include "decision/decision_engine.h" +#include "expr/bound_var_manager.h" #include "expr/node.h" #include "options/base_options.h" #include "options/language.h" #include "options/main_options.h" #include "options/printer_options.h" +#include "options/proof_options.h" #include "options/smt_options.h" #include "options/theory_options.h" #include "printer/printer.h" @@ -56,10 +58,10 @@ #include "smt/unsat_core_manager.h" #include "theory/quantifiers/instantiation_list.h" #include "theory/quantifiers/quantifiers_attributes.h" +#include "theory/quantifiers_engine.h" #include "theory/rewriter.h" #include "theory/smt_engine_subsolver.h" #include "theory/theory_engine.h" -#include "theory/quantifiers_engine.h" #include "util/random.h" #include "util/resource_manager.h" @@ -222,8 +224,11 @@ void SmtEngine::finishInit() d_optm->finishInit(d_logic, d_isInternalSubsolver); ProofNodeManager* pnm = nullptr; - if (options::proofNew()) + if (options::proof()) { + // ensure bound variable uses canonical bound variables + d_nodeManager->getBoundVarManager()->enableKeepCacheValues(); + // make the proof manager d_pfManager.reset(new PfManager(getUserContext(), this)); PreprocessProofGenerator* pppg = d_pfManager->getPreprocessProofGenerator(); // start the unsat core manager @@ -979,15 +984,15 @@ Result SmtEngine::checkSatInternal(const std::vector<Node>& assumptions, } } // Check that UNSAT results generate a proof correctly. - if (options::checkProofsNew() || options::proofNewEagerChecking()) + if (options::checkProofs() || options::proofEagerChecking()) { if (r.asSatisfiabilityResult().isSat() == Result::UNSAT) { - if ((options::checkProofsNew() || options::proofNewEagerChecking()) - && !options::proofNew()) + if ((options::checkProofs() || options::proofEagerChecking()) + && !options::proof()) { throw ModalException( - "Cannot check-proofs-new because proof-new was disabled."); + "Cannot check-proofs because proofs were disabled."); } checkProof(); } @@ -1398,13 +1403,17 @@ Node SmtEngine::getSepNilExpr() { return getSepHeapAndNilExpr().second; } void SmtEngine::checkProof() { - Assert(options::proofNew()); + Assert(options::proof()); // internal check the proof PropEngine* pe = getPropEngine(); Assert(pe != nullptr); + if (options::proofEagerChecking()) + { + pe->checkProof(d_asserts->getAssertionList()); + } Assert(pe->getProof() != nullptr); std::shared_ptr<ProofNode> pePfn = pe->getProof(); - if (options ::checkProofsNew()) + if (options::checkProofs()) { d_pfManager->checkProof(pePfn, *d_asserts, *d_definedFunctions); } @@ -1458,7 +1467,7 @@ void SmtEngine::checkUnsatCore() { initializeSubsolver(coreChecker); coreChecker->getOptions().set(options::checkUnsatCores, false); // disable all proof options - coreChecker->getOptions().set(options::proofNew, false); + coreChecker->getOptions().set(options::proof, false); coreChecker->getOptions().set(options::checkUnsatCoresNew, false); // set up separation logic heap if necessary @@ -1536,9 +1545,9 @@ std::string SmtEngine::getProof() getOutputManager().getDumpOut()); } #if IS_PROOFS_BUILD - if (!options::proofNew()) + if (!options::proof()) { - throw ModalException("Cannot get a proof when proof-new option is off."); + throw ModalException("Cannot get a proof when proof option is off."); } if (d_state->getMode() != SmtMode::UNSAT) { @@ -1637,7 +1646,7 @@ void SmtEngine::getInstantiationTermVectors( { SmtScope smts(this); finishInit(); - if (options::proofNew() && getSmtMode() == SmtMode::UNSAT) + if (options::proof() && getSmtMode() == SmtMode::UNSAT) { // TODO (project #37): minimize instantiations based on proof manager } |