// If a literal is false at 0 level (both sat and user level) we also
// ignore it, unless we are tracking the SAT solver's reasoning
if (value(ps[i]) == l_False) {
- if (!options().smt.unsatCores && !needProof() && level(var(ps[i])) == 0
- && user_level(var(ps[i])) == 0)
+ if (!options().smt.produceUnsatCores && !needProof()
+ && level(var(ps[i])) == 0 && user_level(var(ps[i])) == 0)
{
continue;
}
// If all false, we're in conflict
if (ps.size() == falseLiteralsCount) {
- if (options().smt.unsatCores || needProof())
+ if (options().smt.produceUnsatCores || needProof())
{
// Take care of false units here; otherwise, we need to
// construct the clause below to give to the proof manager
MinisatSatSolver::toSatClause(ca[cr], satClause);
d_proxy->notifyClauseInsertedAtLevel(satClause, clauseLevel);
}
- if (options().smt.unsatCores || needProof())
+ if (options().smt.produceUnsatCores || needProof())
{
if (ps.size() == falseLiteralsCount)
{
// If it's an empty lemma, we have a conflict at zero level
if (lemma.size() == 0) {
- Assert(!options().smt.unsatCores && !needProof());
+ Assert(!options().smt.produceUnsatCores && !needProof());
conflict = CRef_Lazy;
backtrackLevel = 0;
Trace("minisat::lemmas") << "Solver::updateLemmas(): found empty clause" << std::endl;
bool Solver::assertionLevelOnly() const
{
- return options().smt.unsatCores && !needProof()
+ return options().smt.produceUnsatCores && !needProof()
&& options().base.incrementalSolving;
}
|| opts.smt.unsatAssumptions || opts.smt.minimalUnsatCores
|| opts.smt.unsatCoresMode != options::UnsatCoresMode::OFF)
{
- opts.writeSmt().unsatCores = true;
+ opts.writeSmt().produceUnsatCores = true;
}
- if (opts.smt.unsatCores
+ if (opts.smt.produceUnsatCores
&& opts.smt.unsatCoresMode == options::UnsatCoresMode::OFF)
{
if (opts.smt.unsatCoresModeWasSetByUser)
{
notifyModifyOption("unsatCoresMode", "sat-proof", "enabling proofs");
}
- opts.writeSmt().unsatCores = true;
+ opts.writeSmt().produceUnsatCores = true;
opts.writeSmt().unsatCoresMode = options::UnsatCoresMode::SAT_PROOF;
}
}
}
}
// if proofs weren't enabled by user, and we are producing unsat cores
- if (opts.smt.unsatCores)
+ if (opts.smt.produceUnsatCores)
{
opts.writeSmt().produceProofs = true;
if (opts.smt.unsatCoresMode == options::UnsatCoresMode::SAT_PROOF)
// if unsat cores are disabled, then unsat cores mode should be OFF. Similarly
// for proof mode.
- Assert(opts.smt.unsatCores
+ Assert(opts.smt.produceUnsatCores
== (opts.smt.unsatCoresMode != options::UnsatCoresMode::OFF));
Assert(opts.smt.produceProofs
== (opts.smt.proofMode != options::ProofMode::OFF));
// Disable options incompatible with unsat cores or output an error if enabled
// explicitly
- if (safeUnsatCores(opts))
+ if (opts.smt.produceUnsatCores)
{
// check if the options are not compatible with unsat cores
std::stringstream reasonNoUc;
bool SetDefaults::incompatibleWithUnsatCores(Options& opts,
std::ostream& reason) const
{
- if (opts.smt.simplificationMode != options::SimplificationMode::NONE)
+ // All techniques that are incompatible with unsat cores are listed here.
+ // A preprocessing pass is incompatible with unsat cores if
+ // (A) its reasoning is not local, i.e. it may replace an assertion A by A'
+ // where A does not imply A', or if it adds new assertions B that are not
+ // tautologies, AND
+ // (B) it does not track proofs.
+ if (opts.smt.deepRestartMode != options::DeepRestartMode::NONE)
{
- if (opts.smt.simplificationModeWasSetByUser)
+ if (opts.smt.deepRestartModeWasSetByUser)
{
- reason << "simplification";
+ reason << "deep restarts";
return true;
}
- notifyModifyOption("simplificationMode", "none", "unsat cores");
- opts.writeSmt().simplificationMode = options::SimplificationMode::NONE;
- if (opts.smt.deepRestartMode != options::DeepRestartMode::NONE)
- {
- verbose(1) << "SolverEngine: turning off deep restart to support unsat "
- "cores"
- << std::endl;
- opts.writeSmt().deepRestartMode = options::DeepRestartMode::NONE;
- }
+ verbose(1) << "SolverEngine: turning off deep restart to support unsat "
+ "cores"
+ << std::endl;
+ opts.writeSmt().deepRestartMode = options::DeepRestartMode::NONE;
}
-
if (opts.smt.learnedRewrite)
{
if (opts.smt.learnedRewriteWasSetByUser)
notifyModifyOption("learnedRewrite", "false", "unsat cores");
opts.writeSmt().learnedRewrite = false;
}
-
- if (opts.arith.pbRewrites)
- {
- if (opts.arith.pbRewritesWasSetByUser)
- {
- reason << "pseudoboolean rewrites";
- return true;
- }
- notifyModifyOption("pbRewrites", "false", "unsat cores");
- opts.writeArith().pbRewrites = false;
- }
-
- if (opts.smt.sortInference)
- {
- if (opts.smt.sortInferenceWasSetByUser)
- {
- reason << "sort inference";
- return true;
- }
- notifyModifyOption("sortInference", "false", "unsat cores");
- opts.writeSmt().sortInference = false;
- }
-
- if (opts.quantifiers.preSkolemQuant != options::PreSkolemQuantMode::OFF)
- {
- if (opts.quantifiers.preSkolemQuantWasSetByUser)
- {
- reason << "pre-skolemization";
- return true;
- }
- notifyModifyOption("preSkolemQuant", "off", "unsat cores");
- opts.writeQuantifiers().preSkolemQuant = options::PreSkolemQuantMode::OFF;
- }
-
- if (opts.bv.bitvectorToBool)
- {
- if (opts.bv.bitvectorToBoolWasSetByUser)
- {
- reason << "bv-to-bool";
- return true;
- }
- notifyModifyOption("bitvectorToBool", "false", "unsat cores");
- opts.writeBv().bitvectorToBool = false;
- }
-
- if (opts.bv.boolToBitvector != options::BoolToBVMode::OFF)
- {
- if (opts.bv.boolToBitvectorWasSetByUser)
- {
- reason << "bool-to-bv != off";
- return true;
- }
- notifyModifyOption("boolToBitvector", "off", "unsat cores");
- opts.writeBv().boolToBitvector = options::BoolToBVMode::OFF;
- }
-
- if (opts.bv.bvIntroducePow2)
+ // most static learning techniques are local, although arithmetic static
+ // learning is not.
+ if (opts.arith.arithStaticLearning)
{
- if (opts.bv.bvIntroducePow2WasSetByUser)
+ if (opts.arith.arithStaticLearningWasSetByUser)
{
- reason << "bv-intro-pow2";
+ reason << "arith static learning";
return true;
}
- notifyModifyOption("bvIntroducePow2", "false", "unsat cores");
- opts.writeBv().bvIntroducePow2 = false;
+ notifyModifyOption("arithStaticLearning", "false", "proofs");
+ opts.writeArith().arithStaticLearning = false;
}
- if (opts.smt.repeatSimp)
+ if (opts.arith.pbRewrites)
{
- if (opts.smt.repeatSimpWasSetByUser)
+ if (opts.arith.pbRewritesWasSetByUser)
{
- reason << "repeat-simp";
+ reason << "pseudoboolean rewrites";
return true;
}
- notifyModifyOption("repeatSimp", "false", "unsat cores");
- opts.writeSmt().repeatSimp = false;
+ notifyModifyOption("pbRewrites", "false", "unsat cores");
+ opts.writeArith().pbRewrites = false;
}
if (opts.quantifiers.globalNegate)
reason << "ITE simp";
return true;
}
- if (opts.smt.unconstrainedSimp)
- {
- if (opts.smt.unconstrainedSimpWasSetByUser)
- {
- reason << "unconstrained simplification";
- return true;
- }
- notifyModifyOption("unconstrainedSimp", "false", "unsat cores");
- opts.writeSmt().unconstrainedSimp = false;
- }
- if (opts.smt.deepRestartMode != options::DeepRestartMode::NONE)
- {
- reason << "deep restarts";
- return true;
- }
return false;
}