Notice() << "SmtEngine: setting dumpUnsatCores" << std::endl;
options::dumpUnsatCores.set(true);
}
- if (options::checkUnsatCores() || options::dumpUnsatCores()
- || options::unsatAssumptions())
+ if (options::checkUnsatCores() || options::checkUnsatCoresNew()
+ || options::dumpUnsatCores() || options::unsatAssumptions())
{
Notice() << "SmtEngine: setting unsatCores" << std::endl;
options::unsatCores.set(true);
}
+ if (options::checkUnsatCoresNew())
+ {
+ options::proofNew.set(true);
+ }
if (options::bitvectorAigSimplifications.wasSetByUser())
{
Notice() << "SmtEngine: setting bitvectorAig" << std::endl;
// Note we allow E-matching by default to support combinations of sequences
// and quantifiers.
}
+
if (options::arraysExp())
{
if (!logic.isQuantified())
#include "smt/smt_engine_stats.h"
#include "smt/smt_solver.h"
#include "smt/sygus_solver.h"
+#include "smt/unsat_core_manager.h"
#include "theory/quantifiers/instantiation_list.h"
#include "theory/quantifiers/quantifiers_attributes.h"
#include "theory/rewriter.h"
d_model(nullptr),
d_checkModels(nullptr),
d_pfManager(nullptr),
+ d_ucManager(nullptr),
d_rewriter(new theory::Rewriter()),
d_definedFunctions(nullptr),
d_sygusSolver(nullptr),
// d_proofManager must be created before Options has been finished
// being parsed from the input file. Because of this, we cannot trust
- // that options::proof() is set correctly yet.
+ // that options::unsatCores() is set correctly yet.
#ifdef CVC4_PROOF
d_proofManager.reset(new ProofManager(getUserContext()));
#endif
{
d_pfManager.reset(new PfManager(getUserContext(), this));
PreprocessProofGenerator* pppg = d_pfManager->getPreprocessProofGenerator();
+ // start the unsat core manager
+ d_ucManager.reset(new UnsatCoreManager());
// use this proof node manager
pnm = d_pfManager->getProofNodeManager();
// enable proof support in the rewriter
#endif
d_rewriter.reset(nullptr);
d_pfManager.reset(nullptr);
+ d_ucManager.reset(nullptr);
d_absValues.reset(nullptr);
d_asserts.reset(nullptr);
}
}
// Check that UNSAT results generate an unsat core correctly.
- if(options::checkUnsatCores()) {
- if(r.asSatisfiabilityResult().isSat() == Result::UNSAT) {
+ if (options::checkUnsatCores() || options::checkUnsatCoresNew())
+ {
+ if (r.asSatisfiabilityResult().isSat() == Result::UNSAT)
+ {
TimerStat::CodeTimer checkUnsatCoreTimer(d_stats->d_checkUnsatCoreTime);
checkUnsatCore();
}
"Cannot get an unsat core unless immediately preceded by "
"UNSAT/ENTAILED response.");
}
-
- d_proofManager->traceUnsatCore(); // just to trigger core creation
- return UnsatCore(d_proofManager->extractUnsatCore());
+ // use old proof infrastructure
+ if (!d_pfManager)
+ {
+ d_proofManager->traceUnsatCore(); // just to trigger core creation
+ return UnsatCore(d_proofManager->extractUnsatCore());
+ }
+ // generate with new proofs
+ PropEngine* pe = getPropEngine();
+ Assert(pe != nullptr);
+ Assert(pe->getProof() != nullptr);
+ std::shared_ptr<ProofNode> pfn = d_pfManager->getFinalProof(
+ pe->getProof(), *d_asserts, *d_definedFunctions);
+ std::vector<Node> core;
+ d_ucManager->getUnsatCore(pfn, *d_asserts, core);
+ return UnsatCore(core);
#else /* IS_PROOFS_BUILD */
throw ModalException(
"This build of CVC4 doesn't have proof support (required for unsat "
std::unique_ptr<SmtEngine> coreChecker;
initializeSubsolver(coreChecker);
coreChecker->getOptions().set(options::checkUnsatCores, false);
+ // disable all proof options
+ coreChecker->getOptions().set(options::proofNew, false);
+ coreChecker->getOptions().set(options::checkUnsatCoresNew, false);
// set up separation logic heap if necessary
TypeNode sepLocType, sepDataType;
d_checkModels->checkModel(m, al, hardFailure);
}
-// TODO(#1108): Simplify the error reporting of this method.
UnsatCore SmtEngine::getUnsatCore() {
- Trace("smt") << "SMT getUnsatCore()" << endl;
+ Trace("smt") << "SMT getUnsatCore()" << std::endl;
SmtScope smts(this);
finishInit();
- if(Dump.isOn("benchmark")) {
+ if (Dump.isOn("benchmark"))
+ {
getOutputManager().getPrinter().toStreamCmdGetUnsatCore(
getOutputManager().getDumpOut());
}
-; COMMAND-LINE: --finite-model-find --no-check-unsat-core
+; COMMAND-LINE: --finite-model-find --no-check-unsat-cores
; EXPECT: unsat
;%------------------------------------------------------------------------------
;% File : PUZ001+1 : TPTP v5.4.0. Released v2.0.0.
(declare-fun richer__smt2_2 ( sort__smt2 sort__smt2 ) Bool)
; pel55_1 axiom
-(assert (exists ((?X sort__smt2))
+(assert (exists ((?X sort__smt2))
(and (lives__smt2_1 ?X)
(killed__smt2_2 ?X agatha__smt2_0))))
(assert (lives__smt2_1 charles__smt2_0))
; pel55_3 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(=> (lives__smt2_1 ?X)
(or (= ?X agatha__smt2_0)
(= ?X butler__smt2_0)
(= ?X charles__smt2_0)))))
; pel55_4 axiom
-(assert (forall ((?X sort__smt2) (?Y sort__smt2))
+(assert (forall ((?X sort__smt2) (?Y sort__smt2))
(=> (killed__smt2_2 ?X ?Y)
(hates__smt2_2 ?X ?Y))))
; pel55_5 axiom
-(assert (forall ((?X sort__smt2) (?Y sort__smt2))
+(assert (forall ((?X sort__smt2) (?Y sort__smt2))
(=> (killed__smt2_2 ?X ?Y)
(not (richer__smt2_2 ?X ?Y)))))
; pel55_6 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(=> (hates__smt2_2 agatha__smt2_0 ?X)
(not (hates__smt2_2 charles__smt2_0 ?X)))))
; pel55_7 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(=> (not (= ?X butler__smt2_0))
(hates__smt2_2 agatha__smt2_0 ?X))))
; pel55_8 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(=> (not (richer__smt2_2 ?X agatha__smt2_0))
(hates__smt2_2 butler__smt2_0 ?X))))
; pel55_9 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(=> (hates__smt2_2 agatha__smt2_0 ?X)
(hates__smt2_2 butler__smt2_0 ?X))))
; pel55_10 axiom
-(assert (forall ((?X sort__smt2))
+(assert (forall ((?X sort__smt2))
(exists ((?Y sort__smt2)) (not (hates__smt2_2 ?X ?Y)))))
; pel55_11 axiom