diff options
Diffstat (limited to 'src/smt')
-rw-r--r-- | src/smt/options_handlers.h | 5 | ||||
-rw-r--r-- | src/smt/smt_engine.cpp | 15 | ||||
-rw-r--r-- | src/smt/smt_engine.h | 3 | ||||
-rw-r--r-- | src/smt/smt_engine_check_proof.cpp | 7 | ||||
-rw-r--r-- | src/smt/smt_engine_scope.h | 17 |
5 files changed, 24 insertions, 23 deletions
diff --git a/src/smt/options_handlers.h b/src/smt/options_handlers.h index fc2b796d3..eeefd7af0 100644 --- a/src/smt/options_handlers.h +++ b/src/smt/options_handlers.h @@ -20,6 +20,7 @@ #define __CVC4__SMT__OPTIONS_HANDLERS_H #include "cvc4autoconfig.h" +#include "util/configuration_private.h" #include "util/dump.h" #include "util/resource_manager.h" #include "smt/modal_exception.h" @@ -307,13 +308,13 @@ inline void setProduceAssertions(std::string option, bool value, SmtEngine* smt) // ensure we are a proof-enabled build of CVC4 inline void proofEnabledBuild(std::string option, bool value, SmtEngine* smt) throw(OptionException) { -#ifndef CVC4_PROOF +#if !(IS_PROOFS_BUILD) if(value) { std::stringstream ss; ss << "option `" << option << "' requires a proofs-enabled build of CVC4; this binary was not built with proof support"; throw OptionException(ss.str()); } -#endif /* CVC4_PROOF */ +#endif /* IS_PROOFS_BUILD */ } // This macro is used for setting :regular-output-channel and :diagnostic-output-channel diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index c863909e5..5dfada655 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -57,6 +57,7 @@ #include "util/boolean_simplification.h" #include "util/node_visitor.h" #include "util/configuration.h" +#include "util/configuration_private.h" #include "util/exception.h" #include "util/nary_builder.h" #include "smt/command_list.h" @@ -701,9 +702,7 @@ SmtEngine::SmtEngine(ExprManager* em) throw() : d_modelGlobalCommands(), d_modelCommands(NULL), d_dumpCommands(), -#ifdef CVC4_PROOF d_defineCommands(), -#endif d_logic(), d_originalOptions(em->getOptions()), d_pendingPops(0), @@ -4377,7 +4376,7 @@ UnsatCore SmtEngine::getUnsatCore() throw(ModalException, UnsafeInterruptExcepti if(Dump.isOn("benchmark")) { Dump("benchmark") << GetUnsatCoreCommand(); } -#ifdef CVC4_PROOF +#if IS_PROOFS_BUILD if(!options::unsatCores()) { throw ModalException("Cannot get an unsat core when produce-unsat-cores option is off."); } @@ -4389,9 +4388,9 @@ UnsatCore SmtEngine::getUnsatCore() throw(ModalException, UnsafeInterruptExcepti d_proofManager->getProof(this);// just to trigger core creation return UnsatCore(this, d_proofManager->begin_unsat_core(), d_proofManager->end_unsat_core()); -#else /* CVC4_PROOF */ +#else /* IS_PROOFS_BUILD */ throw ModalException("This build of CVC4 doesn't have proof support (required for unsat cores)."); -#endif /* CVC4_PROOF */ +#endif /* IS_PROOFS_BUILD */ } Proof* SmtEngine::getProof() throw(ModalException, UnsafeInterruptException) { @@ -4401,7 +4400,7 @@ Proof* SmtEngine::getProof() throw(ModalException, UnsafeInterruptException) { if(Dump.isOn("benchmark")) { Dump("benchmark") << GetProofCommand(); } -#ifdef CVC4_PROOF +#if IS_PROOFS_BUILD if(!options::proof()) { throw ModalException("Cannot get a proof when produce-proofs option is off."); } @@ -4412,9 +4411,9 @@ Proof* SmtEngine::getProof() throw(ModalException, UnsafeInterruptException) { } return ProofManager::getProof(this); -#else /* CVC4_PROOF */ +#else /* IS_PROOFS_BUILD */ throw ModalException("This build of CVC4 doesn't have proof support."); -#endif /* CVC4_PROOF */ +#endif /* IS_PROOFS_BUILD */ } void SmtEngine::printInstantiations( std::ostream& out ) { diff --git a/src/smt/smt_engine.h b/src/smt/smt_engine.h index b4c293dff..be31d768b 100644 --- a/src/smt/smt_engine.h +++ b/src/smt/smt_engine.h @@ -196,9 +196,8 @@ class CVC4_PUBLIC SmtEngine { *A vector of command definitions to be imported in the new *SmtEngine when checking unsat-cores. */ -#ifdef CVC4_PROOF std::vector<Command*> d_defineCommands; -#endif + /** * The logic we're in. */ diff --git a/src/smt/smt_engine_check_proof.cpp b/src/smt/smt_engine_check_proof.cpp index 4c35bd863..d04daef92 100644 --- a/src/smt/smt_engine_check_proof.cpp +++ b/src/smt/smt_engine_check_proof.cpp @@ -16,6 +16,7 @@ **/ #include "smt/smt_engine.h" +#include "util/configuration_private.h" #include "util/statistics_registry.h" #include "check.h" @@ -49,7 +50,7 @@ public: void SmtEngine::checkProof() { -#ifdef CVC4_PROOF +#if IS_PROOFS_BUILD Chat() << "generating proof..." << endl; @@ -88,10 +89,10 @@ void SmtEngine::checkProof() { check_file(pfFile, args()); close(fd); -#else /* CVC4_PROOF */ +#else /* IS_PROOFS_BUILD */ Unreachable("This version of CVC4 was built without proof support; cannot check proofs."); -#endif /* CVC4_PROOF */ +#endif /* IS_PROOFS_BUILD */ } diff --git a/src/smt/smt_engine_scope.h b/src/smt/smt_engine_scope.h index 701775c9c..bc978b728 100644 --- a/src/smt/smt_engine_scope.h +++ b/src/smt/smt_engine_scope.h @@ -17,14 +17,15 @@ #include "cvc4_private.h" +#pragma once + +#include "expr/node_manager.h" #include "smt/smt_engine.h" -#include "util/tls.h" +#include "smt/options.h" +#include "util/configuration_private.h" #include "util/cvc4_assert.h" -#include "expr/node_manager.h" #include "util/output.h" -#include "proof/proof.h" - -#pragma once +#include "util/tls.h" namespace CVC4 { @@ -43,14 +44,14 @@ inline bool smtEngineInScope() { } inline ProofManager* currentProofManager() { -#ifdef CVC4_PROOF +#if IS_PROOFS_BUILD Assert(options::proof() || options::unsatCores()); Assert(s_smtEngine_current != NULL); return s_smtEngine_current->d_proofManager; -#else /* CVC4_PROOF */ +#else /* IS_PROOFS_BUILD */ InternalError("proofs/unsat cores are not on, but ProofManager requested"); return NULL; -#endif /* CVC4_PROOF */ +#endif /* IS_PROOFS_BUILD */ } class SmtScope : public NodeManagerScope { |