Also moves several proof-specific options to proof_options.
#include "expr/proof.h"
#include "expr/proof_ensure_closed.h"
#include "expr/proof_node_algorithm.h"
-#include "options/smt_options.h"
+#include "options/proof_options.h"
namespace CVC4 {
<< " set to generator " << pg->identify() << "\n";
// note this will rewrite the generator for expected, if any
d_gens.insert(expected, pg);
- // check if chain is closed if options::proofNewEagerChecking() is on
- if (options::proofNewEagerChecking())
+ // check if chain is closed if options::proofEagerChecking() is on
+ if (options::proofEagerChecking())
{
Trace("lazy-cdproofchain")
<< "LazyCDProofChain::addLazyStep: Checking closed proof...\n";
#include "expr/proof_checker.h"
#include "expr/skolem_manager.h"
-#include "options/smt_options.h"
+#include "options/proof_options.h"
#include "smt/smt_statistics_registry.h"
using namespace CVC4::kind;
}
}
// fails if pedantic level is not met
- if (options::proofNewEagerChecking())
+ if (options::proofEagerChecking())
{
std::stringstream serr;
if (isPedanticFailure(id, serr, enableOutput))
if (enableOutput)
{
out << serr.str() << std::endl;
- if (Trace.isOn("proof-new-pedantic"))
+ if (Trace.isOn("proof-pedantic"))
{
- Trace("proof-new-pedantic")
+ Trace("proof-pedantic")
<< "Failed pedantic check for " << id << std::endl;
- Trace("proof-new-pedantic") << "Expected: " << expected << std::endl;
+ Trace("proof-pedantic") << "Expected: " << expected << std::endl;
out << "Expected: " << expected << std::endl;
}
}
out << "pedantic level for " << id << " not met (rule level is "
<< itp->second << " which is at or below the pedantic level "
<< d_pclevel << ")";
- bool pedanticTraceEnabled = Trace.isOn("proof-new-pedantic");
+ bool pedanticTraceEnabled = Trace.isOn("proof-pedantic");
if (!pedanticTraceEnabled)
{
- out << ", use -t proof-new-pedantic for details";
+ out << ", use -t proof-pedantic for details";
}
}
return true;
#include "expr/proof_ensure_closed.h"
#include "expr/proof_node_algorithm.h"
+#include "options/proof_options.h"
#include "options/smt_options.h"
namespace CVC4 {
const char* ctx,
bool reqGen)
{
- if (!options::proofNew())
+ if (!options::proof())
{
// proofs not enabled, do not do check
return;
}
bool isTraceDebug = Trace.isOn(c);
- if (!options::proofNewEagerChecking() && !isTraceDebug)
+ if (!options::proofEagerChecking() && !isTraceDebug)
{
// trace is off and proof new eager checking is off, do not do check
return;
/**
* Debug check closed on Trace c. Context ctx is string for debugging.
* This method throws an assertion failure if pg cannot provide a closed
- * proof for fact proven. This is checked only if --proof-new-eager-checking
+ * proof for fact proven. This is checked only if --proof-eager-checking
* is enabled or the Trace c is enabled.
*
* @param reqGen Whether we consider a null generator to be a failure.
!= traversing.end())
{
Unhandled() << "getFreeAssumptionsMap: cyclic proof! (use "
- "--proof-new-eager-checking)"
+ "--proof-eager-checking)"
<< std::endl;
}
visit.push_back(cp);
#include "expr/proof.h"
#include "expr/proof_node_algorithm.h"
-#include "options/smt_options.h"
+#include "options/proof_options.h"
#include "theory/rewriter.h"
using namespace CVC4::kind;
{
Assert(pn != nullptr);
// ---------------- check for cyclic
- if (options::proofNewEagerChecking())
+ if (options::proofEagerChecking())
{
std::unordered_set<const ProofNode*> visited;
for (const std::shared_ptr<ProofNode>& cpc : children)
!= traversing.end())
{
Unhandled() << "ProofNodeToSExpr::convertToSExpr: cyclic proof! (use "
- "--proof-new-eager-checking)"
+ "--proof-eager-checking)"
<< std::endl;
return Node::null();
}
{
Unhandled()
<< "ProofNodeUpdater::processInternal: cyclic proof! (use "
- "--proof-new-eager-checking)"
+ "--proof-eager-checking)"
<< std::endl;
}
visit.push_back(cp);
default = "false"
read_only = true
help = "Print conclusion of proof steps when printing AST"
+
+[[option]]
+ name = "proofPedantic"
+ category = "regular"
+ long = "proof-pedantic=N"
+ type = "uint32_t"
+ default = "0"
+ read_only = true
+ help = "assertion failure for any incorrect rule application or untrusted lemma having pedantic level <=N with proof"
+
+[[option]]
+ name = "proofEagerChecking"
+ category = "regular"
+ long = "proof-eager-checking"
+ type = "bool"
+ default = "false"
+ help = "check proofs eagerly with proof for local debugging"
+
+[[option]]
+ name = "proofGranularityMode"
+ category = "regular"
+ long = "proof-granularity=MODE"
+ type = "ProofGranularityMode"
+ default = "THEORY_REWRITE"
+ help = "modes for proof granularity"
+ help_mode = "Modes for proof granularity."
+[[option.mode.OFF]]
+ name = "off"
+ help = "Do not improve the granularity of proofs."
+[[option.mode.REWRITE]]
+ name = "rewrite"
+ help = "Allow rewrite or substitution steps, expand macros."
+[[option.mode.THEORY_REWRITE]]
+ name = "theory-rewrite"
+ help = "Allow theory rewrite steps, expand macros, rewrite and substitution steps."
+[[option.mode.DSL_REWRITE]]
+ name = "dsl-rewrite"
+ help = "Allow DSL rewrites and evaluation steps, expand macros, rewrite, substitution, and theory rewrite steps."
help = "Block models based on the concrete model values for the free variables."
[[option]]
- name = "dumpProofs"
- category = "regular"
- long = "dump-proofs"
- type = "bool"
- default = "false"
- read_only = true
- help = "output proofs after every UNSAT/VALID response"
-
-[[option]]
- name = "proofNew"
+ name = "proof"
category = "regular"
- long = "proof-new"
+ long = "proof"
type = "bool"
default = "false"
- help = "do proof production using the new infrastructure"
+ help = "produce proofs, support check-proofs and get-proof"
[[option]]
- name = "proofNewPedantic"
- category = "regular"
- long = "proof-new-pedantic=N"
- type = "uint32_t"
- default = "0"
- read_only = true
- help = "assertion failure for any incorrect rule application or untrusted lemma having pedantic level <=N with proof-new"
-
-[[option]]
- name = "proofNewEagerChecking"
+ name = "dumpProofs"
category = "regular"
- long = "proof-new-eager-checking"
+ long = "dump-proofs"
type = "bool"
default = "false"
read_only = true
- help = "check proofs eagerly with proof-new for local debugging"
-
-[[option]]
- name = "proofGranularityMode"
- category = "regular"
- long = "proof-granularity=MODE"
- type = "ProofGranularityMode"
- default = "THEORY_REWRITE"
- help = "modes for proof granularity"
- help_mode = "Modes for proof granularity."
-[[option.mode.OFF]]
- name = "off"
- help = "Do not improve the granularity of proofs."
-[[option.mode.REWRITE]]
- name = "rewrite"
- help = "allow rewrite or substitution steps, expand macros."
-[[option.mode.THEORY_REWRITE]]
- name = "theory-rewrite"
- help = "allow theory rewrite steps, expand macros, rewrite and substitution steps."
-[[option.mode.DSL_REWRITE]]
- name = "dsl-rewrite"
- help = "Allow DSL rewrites and evaluation steps, expand macros, rewrite, substitution, and theory rewrite steps."
+ help = "output proofs after every UNSAT/VALID response"
[[option]]
- name = "checkProofsNew"
+ name = "checkProofs"
category = "regular"
- long = "check-proofs-new"
+ long = "check-proofs"
type = "bool"
- help = "after UNSAT/VALID, check the generated proof (with proof-new)"
+ help = "after UNSAT/VALID, check the generated proof (with proof)"
[[option]]
name = "dumpInstantiations"
imap[assertions->size()] = newSkolems[j];
assertions->pushBackTrusted(newAsserts[j]);
// new assertions have a dependence on the node (old pf architecture)
- if (options::unsatCores() && !options::proofNew())
+ if (options::unsatCores() && !options::proof())
{
ProofManager::currentPM()->addDependence(newAsserts[j].getProven(),
assertion);
for( int i=0; i<(int)assertions.size(); i++ ){
Trace("macros-debug") << " process assertion " << assertions[i] << std::endl;
if( processAssertion( assertions[i] ) ){
- if (options::unsatCores() && !options::proofNew()
+ if (options::unsatCores() && !options::proof()
&& std::find(macro_assertions.begin(),
macro_assertions.end(),
assertions[i])
// is an over-approximation. a more fine-grained unsat core
// computation would require caching dependencies for each subterm of
// the formula, which is expensive.
- if (options::unsatCores() && !options::proofNew())
+ if (options::unsatCores() && !options::proof())
{
ProofManager::currentPM()->addDependence(curr, assertions[i]);
for (unsigned j = 0; j < macro_assertions.size(); j++)
*/
bool assertionLevelOnly()
{
- return (options::proofNew() || options::unsatCores())
+ return (options::proof() || options::unsatCores())
&& options::incrementalSolving();
}
}
d_minisat->addClause(minisat_clause, removable, clause_id);
// FIXME: to be deleted when we kill old proof code for unsat cores
- Assert(!options::unsatCores() || options::proofNew()
+ Assert(!options::unsatCores() || options::proof()
|| clause_id != ClauseIdError);
return clause_id;
}
#include "options/decision_options.h"
#include "options/main_options.h"
#include "options/options.h"
+#include "options/proof_options.h"
#include "options/smt_options.h"
#include "proof/proof_manager.h"
#include "prop/cnf_stream.h"
#include "prop/theory_proxy.h"
#include "smt/smt_statistics_registry.h"
#include "theory/output_channel.h"
-#include "theory/rewriter.h"
#include "theory/theory_engine.h"
#include "util/resource_manager.h"
#include "util/result.h"
Assert(ppSkolems.size() == ppLemmas.size());
// do final checks on the lemmas we are about to send
- if (isProofEnabled() && options::proofNewEagerChecking())
+ if (isProofEnabled() && options::proofEagerChecking())
{
Assert(tplemma.getGenerator() != nullptr);
// ensure closed, make the proof node eagerly here to debug
Node PropEngine::getPreprocessedTerm(TNode n)
{
- Node rewritten = theory::Rewriter::rewrite(n);
// must preprocess
std::vector<theory::TrustNode> newLemmas;
std::vector<Node> newSkolems;
#include "prop/sat_proof_manager.h"
#include "expr/proof_node_algorithm.h"
-#include "options/smt_options.h"
+#include "options/proof_options.h"
#include "prop/cnf_stream.h"
#include "prop/minisat/minisat.h"
#include "theory/theory_proof_step_buffer.h"
}
} while (expanded);
// now we should be able to close it
- if (options::proofNewEagerChecking())
+ if (options::proofEagerChecking())
{
std::vector<Node> assumptionsVec;
for (const Node& a : d_assumptions)
theory::TrustNode tte = d_theoryEngine->getExplanation(lNode);
Node theoryExplanation = tte.getNode();
- if (CVC4::options::proofNew())
+ if (CVC4::options::proof())
{
d_propEngine->getProofCnfStream()->convertPropagation(tte);
}
#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 {
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
#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"
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")),
#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"
{
PfRule r = pn->getRule();
// if not doing eager pedantic checking, fail if below threshold
- if (!options::proofNewEagerChecking())
+ if (!options::proofEagerChecking())
{
if (!d_pedanticFailure)
{
}
if (options::checkUnsatCoresNew())
{
- options::proofNew.set(true);
+ options::proof.set(true);
}
if (options::bitvectorAigSimplifications.wasSetByUser())
{
}
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)
{
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
"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"))
#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"
#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"
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
}
}
// 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();
}
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);
}
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
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)
{
{
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
}
* * assertionToEqualityEngine(..)
* * equalsConstant(c)
* * equalsConstant(lb, ub)
- * If proofNew is off, then just asserts.
+ * If proof is off, then just asserts.
*/
void assertLitToEqualityEngine(Node lit,
TNode reason,
Node lemma = NodeBuilder<3>(OR) << leqNode << geqNode;
TrustNode trustedLemma;
- if (options::proofNew())
+ if (d_database->isProofEnabled())
{
// Farkas proof that this works.
auto nm = NodeManager::currentNM();
Node la = a->getLiteral();
Node lb = b->getLiteral();
Node orN = (la < lb) ? la.orNode(lb) : lb.orNode(la);
- if (options::proofNew())
+ if (isProofEnabled())
{
Assert(b->getNegation()->getType() != ConstraintType::Disequality);
auto nm = NodeManager::currentNM();
#include "options/smt_options.h"
-#define ARITH_PROOF(x) \
- if (CVC4::options::proofNew()) \
- { \
- x; \
+#define ARITH_PROOF(x) \
+ if (CVC4::options::proof()) \
+ { \
+ x; \
}
-#define ARITH_NULLPROOF(x) \
- (CVC4::options::proofNew()) \
- ? x \
- : NULL
-#define ARITH_PROOF_ON() CVC4::options::proofNew()
+#define ARITH_NULLPROOF(x) (CVC4::options::proof()) ? x : NULL
+#define ARITH_PROOF_ON() CVC4::options::proof()
#endif // CVC4__THEORY__ARITH__PROOF_MACROS_H
-; COMMAND-LINE: --proof-new-eager-checking
+; COMMAND-LINE: --proof-eager-checking
; EXPECT: sat
(set-logic QF_UFLRA)
(declare-fun v1 () Real)