Makes arithEqSolver more robust to propagations from multiple sources, changes the default relationship to congruence manager based on preliminary results on SMT-LIB.
type = "bool"
default = "false"
help = "whether to use the equality solver in the theory of arithmetic"
+
+[[option]]
+ name = "arithCongMan"
+ category = "regular"
+ long = "arith-cong-man"
+ type = "bool"
+ default = "true"
+ help = "(experimental) whether to use the congruence manager when the equality solver is enabled"
Trace("smt") << "setting decision mode to " << opts.decision.decisionMode
<< std::endl;
}
+
+ // set up of central equality engine
+ if (opts.arith.arithEqSolver)
+ {
+ if (!opts.arith.arithCongManWasSetByUser)
+ {
+ // if we are using the arithmetic equality solver, do not use the
+ // arithmetic congruence manager by default
+ opts.arith.arithCongMan = false;
+ }
+ }
+
if (options::incrementalSolving())
{
// disable modes not supported by incremental
}
bool EqualitySolver::propagateLit(Node lit)
{
+ // if we've already propagated, ignore
+ if (d_aim.hasPropagated(lit))
+ {
+ return true;
+ }
// notice this is only used when ee-mode=distributed
// remember that this was a literal we propagated
Trace("arith-eq-solver-debug") << "propagate lit " << lit << std::endl;
InferenceManager::InferenceManager(TheoryArith& ta,
ArithState& astate,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(ta, astate, pnm, "theory::arith::")
+ : InferenceManagerBuffered(ta, astate, pnm, "theory::arith::"),
+ // currently must track propagated literals if using the equality solver
+ d_trackPropLits(options::arithEqSolver()),
+ d_propLits(astate.getSatContext())
{
}
return false;
}
+bool InferenceManager::propagateLit(TNode lit)
+{
+ if (d_trackPropLits)
+ {
+ d_propLits.insert(lit);
+ }
+ return TheoryInferenceManager::propagateLit(lit);
+}
+
+bool InferenceManager::hasPropagated(TNode lit) const
+{
+ Assert(d_trackPropLits);
+ return d_propLits.find(lit) != d_propLits.end();
+}
+
} // namespace arith
} // namespace theory
} // namespace cvc5
/** Checks whether the given lemma is already present in the cache. */
virtual bool hasCachedLemma(TNode lem, LemmaProperty p) override;
+ /** overrides propagateLit to track which literals have been propagated */
+ bool propagateLit(TNode lit) override;
+ /**
+ * Return true if we have propagated lit already. This call is only valid if
+ * d_trackPropLits is true.
+ */
+ bool hasPropagated(TNode lit) const;
protected:
/**
* conflict.
*/
bool isEntailedFalse(const SimpleTheoryLemma& lem);
-
/** The waiting lemmas. */
std::vector<std::unique_ptr<SimpleTheoryLemma>> d_waitingLem;
+ /** Whether we are tracking the set of propagated literals */
+ bool d_trackPropLits;
+ /** The literals we have propagated */
+ NodeSet d_propLits;
};
} // namespace arith
d_partialModel,
RaiseEqualityEngineConflict(*this),
d_pnm),
- d_cmEnabled(c, true),
+ d_cmEnabled(c, options::arithCongMan()),
d_dualSimplex(
d_linEq, d_errorSet, RaiseConflict(*this), TempVarMalloc(*this)),
* EqualityEngineNotify::eqNotifyTriggerPredicate and
* EqualityEngineNotify::eqNotifyTriggerTermEquality.
*/
- bool propagateLit(TNode lit);
+ virtual bool propagateLit(TNode lit);
/**
* Return an explanation for the literal represented by parameter lit
* (which was previously propagated by this theory). By default, this