static bool isBuiltWithPoly();
+ static bool isBuiltWithCoCoA();
+
/* Return a sorted array of the debug tags name */
static const std::vector<std::string>& getDebugTags();
/* Test if the given argument is a known debug tag name */
#define IS_POLY_BUILD false
#endif /* CVC5_USE_POLY */
+#if CVC5_USE_COCOA
+#define IS_COCOA_BUILD true
+#else /* CVC5_USE_COCOA */
+#define IS_COCOA_BUILD false
+#endif /* CVC5_USE_COCOA */
+
#if HAVE_LIBEDITLINE
#define IS_EDITLINE_BUILD true
#else /* HAVE_LIBEDITLINE */
print_config_cond("gmp", Configuration::isBuiltWithGmp());
print_config_cond("kissat", Configuration::isBuiltWithKissat());
print_config_cond("poly", Configuration::isBuiltWithPoly());
+ print_config_cond("cocoa", Configuration::isBuiltWithCoCoA());
print_config_cond("editline", Configuration::isBuiltWithEditline());
}
{
if (d_state->evaluatesToZero(f))
{
- Assert(CoCoA::deg(f) > 0 && CoCoA::NumTerms(f) <= 2);
+ Trace("nl-cov::lazard") << "Found vanishing factor " << f << std::endl;
+ Assert(CoCoA::deg(f) > 0);
if (CoCoA::deg(f) == 1)
{
auto rat = -CoCoA::ConstantCoeff(f) / CoCoA::LC(f);
roots.emplace_back(r);
}
}
+ // now postprocess roots: sort, remove duplicates and spurious roots.
+ // the reduction to a univariate polynomial that happens within
+ // reducePolynomial() may introduce new (spurious) real roots that correspond
+ // to complex (non-real) roots in the original input. we need to remove such
+ // spurious roots, i.e., roots where the input polynomial does not actually
+ // vanish.
std::sort(roots.begin(), roots.end());
+ auto endit = std::unique(roots.begin(), roots.end());
+ endit = std::remove_if(roots.begin(), endit, [this, &q](const auto& v) {
+ // evaluate q != 0 over the assignment
+ d_state->d_assignment.set(d_state->d_variables.back(), v);
+ bool res = poly::evaluate_constraint(
+ q, d_state->d_assignment, poly::SignCondition::NE);
+ // make sure the assignment is properly reset
+ d_state->d_assignment.unset(d_state->d_variables.back());
+ return res;
+ });
+ // now actually remove the roots we don't want.
+ roots.erase(endit, roots.end());
return roots;
}
regress0/nl/issue6547-ran-model.smt2
regress0/nl/issue6619-ran-model.smt2
regress0/nl/issue8135-icp-candidates.smt2
+ regress0/nl/lazard-spurious-root.smt2
regress0/nl/magnitude-wrong-1020-m.smt2
regress0/nl/mult-po.smt2
regress0/nl/nia-wrong-tl.smt2