}
void SetDefaults::setDefaults(LogicInfo& logic, Options& opts)
+{
+ // initial changes that are independent of logic, and may impact the logic
+ setDefaultsPre(opts);
+ // now, finalize the logic
+ finalizeLogic(logic, opts);
+ // further changes to options based on the logic
+ setDefaultsPost(logic, opts);
+}
+
+void SetDefaults::setDefaultsPre(Options& opts)
{
// implied options
if (opts.smt.debugCheckModels)
Notice() << "SmtEngine: setting bitvectorAlgebraicSolver" << std::endl;
opts.bv.bitvectorAlgebraicSolver = true;
}
+}
+void SetDefaults::finalizeLogic(LogicInfo& logic, Options& opts) const
+{
if (opts.bv.bitblastMode == options::BitblastMode::EAGER)
{
if (opts.smt.produceModels
opts.bv.bvSolver = options::BVSolver::BITBLAST_INTERNAL;
}
- // whether we want to force safe unsat cores, i.e., if we are in the default
- // ASSUMPTIONS mode, since other ones are experimental
- bool safeUnsatCores =
- opts.smt.unsatCoresMode == options::UnsatCoresMode::ASSUMPTIONS;
-
// Disable options incompatible with incremental solving, unsat cores or
// output an error if enabled explicitly. It is also currently incompatible
// with arithmetic, force the option off.
- if (opts.base.incrementalSolving || safeUnsatCores)
+ if (opts.base.incrementalSolving || safeUnsatCores(opts))
{
if (opts.smt.unconstrainedSimp)
{
// Disable options incompatible with unsat cores or output an error if enabled
// explicitly
- if (safeUnsatCores)
+ if (safeUnsatCores(opts))
{
if (opts.smt.simplificationMode != options::SimplificationMode::NONE)
{
opts.smt.produceModels = true;
}
- /////////////////////////////////////////////////////////////////////////////
- // Widen logic
- /////////////////////////////////////////////////////////////////////////////
+ // widen the logic
widenLogic(logic, opts);
- /////////////////////////////////////////////////////////////////////////////
+}
+void SetDefaults::setDefaultsPost(const LogicInfo& logic, Options& opts) const
+{
// Set the options for the theoryOf
if (!opts.theory.theoryOfModeWasSetByUser)
{
if (!opts.uf.ufSymmetryBreakerWasSetByUser)
{
bool qf_uf_noinc = logic.isPure(THEORY_UF) && !logic.isQuantified()
- && !opts.base.incrementalSolving && !safeUnsatCores;
+ && !opts.base.incrementalSolving
+ && !safeUnsatCores(opts);
Trace("smt") << "setting uf symmetry breaker to " << qf_uf_noinc
<< std::endl;
opts.uf.ufSymmetryBreaker = qf_uf_noinc;
&& (logic.isTheoryEnabled(THEORY_ARRAYS)
&& logic.isTheoryEnabled(THEORY_UF)
&& logic.isTheoryEnabled(THEORY_BV))
- && !safeUnsatCores;
+ && !safeUnsatCores(opts);
Trace("smt") << "setting repeat simplification to " << repeatSimp
<< std::endl;
opts.smt.repeatSimp = repeatSimp;
return false;
}
+bool SetDefaults::safeUnsatCores(const Options& opts) const
+{
+ // whether we want to force safe unsat cores, i.e., if we are in the default
+ // ASSUMPTIONS mode, since other ones are experimental
+ return opts.smt.unsatCoresMode == options::UnsatCoresMode::ASSUMPTIONS;
+}
+
void SetDefaults::widenLogic(LogicInfo& logic, Options& opts) const
{
bool needsUf = false;
void setDefaults(LogicInfo& logic, Options& opts);
private:
+ //------------------------- utility methods
/**
* Determine whether we will be solving a SyGuS problem.
*/
* that answers "unsat" without showing a proof of unsatisfiabilty.
*/
bool mustDisableProofs(const Options& opts) const;
+ /**
+ * Return true if we are using "safe" unsat cores, which disables all
+ * techniques that may interfere with producing correct unsat cores.
+ */
+ bool safeUnsatCores(const Options& opts) const;
+ //------------------------- options setting, prior finalization of logic
+ /**
+ * Set defaults pre, which sets all options prior to finalizing the logic.
+ * It is required that any options that impact the finalization of logic
+ * (finalizeLogic).
+ */
+ void setDefaultsPre(Options& opts);
+ //------------------------- finalization of the logic
+ /**
+ * Finalize the logic based on the options.
+ */
+ void finalizeLogic(LogicInfo& logic, Options& opts) const;
/**
* Widen logic to theories that are required, since some theories imply the
* use of other theories to handle certain operators, e.g. UF to handle
* partial functions.
*/
void widenLogic(LogicInfo& logic, Options& opts) const;
+ //------------------------- options setting, post finalization of logic
+ /**
+ * Set all default options, after we have finalized the logic.
+ */
+ void setDefaultsPost(const LogicInfo& logic, Options& opts) const;
/**
* Set defaults related to quantifiers, called when quantifiers are enabled.
* This method modifies opt.quantifiers only.