14 namespace mccallum_partial {
16 template<
typename Poly,
typename Callback>
17 void single(
const Poly& p, carl::Variable variable, Callback&& cb) {
18 SMTRAT_LOG_DEBUG(
"smtrat.cad.projection",
"McCallum_partial_single(" << p <<
")");
21 for (std::size_t i = 0; i < p.coefficients().size(); ++i) {
22 const auto& coeff = p.coefficients()[i];
24 if (i == p.coefficients().size()-1) {
25 SMTRAT_LOG_DEBUG(
"smtrat.cad.projection",
"lcoeff = " << p.lcoeff() <<
" does not vanish. No coefficients needed.");
28 SMTRAT_LOG_DEBUG(
"smtrat.cad.projection",
"coeff " << coeff <<
" does not vanish. We only need the lcoeff() = " << p.lcoeff());
34 SMTRAT_LOG_DEBUG(
"smtrat.cad.projection",
"All coefficients might vanish, we need all of them.");
35 for (
const auto& coeff : p.coefficients()) {
36 if (is_zero(coeff))
continue;
37 assert(!coeff.is_constant());
43 template<
typename Poly,
typename Callback>
44 void paired(
const Poly& p,
const UPoly& q, carl::Variable variable, Callback&& cb) {
45 SMTRAT_LOG_DEBUG(
"smtrat.cad.projection",
"McCallum_partial_paired(" << p <<
", " << q <<
") -> McCallum_paired");
void single(const Poly &p, carl::Variable variable, Callback &&cb)
void paired(const Poly &p, const UPoly &q, carl::Variable variable, Callback &&cb)
void paired(const Poly &p, const UPoly &q, carl::Variable variable, Callback &&cb)
Implements the part of McCallums projection operator from that deals with two polynomials p and q: .
void returnPoly(const Poly &p, Callback &&cb)
Poly discriminant(carl::Variable variable, const Poly &p)
Computes the discriminant of a polynomial.
Poly normalize(const Poly &p)
Normalizes the given Poly by removing constant and duplicate factors.
bool doesNotVanish(const Poly &p)
Tries to determine whether the given Poly vanishes for some assignment.
carl::UnivariatePolynomial< Poly > UPoly
Class to create the formulas for axioms.
carl::MultivariatePolynomial< Rational > Poly
#define SMTRAT_LOG_DEBUG(channel, msg)