5 #include "../datastructures/derivation.h"
17 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
")");
19 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
") <= false");
22 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
") <= " << poly <<
" has const coeff");
24 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
") <= ldcf(" << poly <<
")(" << deriv.
sample() <<
")!=0 && sgn_inv(ldcf(" << poly <<
") [" << deriv.
proj().
ldcf(poly) <<
"])");
29 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
") <= disc(" << poly <<
")(" << deriv.
sample() <<
")!=0 && sgn_inv(disc(" << poly <<
") [" << deriv.
proj().
disc(poly) <<
"])");
32 if (deriv.proj().known(a) && deriv.contains( properties::poly_sgn_inv { deriv.proj().polys()(a)} ))
return true;
36 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"non_null(" << poly <<
") <= sgn_inv(" << coeff <<
") && " << coeff <<
" in coeff(" << poly <<
")");
45 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> del(" << poly <<
") <= non_null(" << poly <<
") && ord_inv(disc(" << poly <<
") [" << deriv.
proj().
disc(poly) <<
"]) && sgn_inv(ldcf(" << poly <<
") [" << deriv.
proj().
ldcf(poly) <<
"]) && cell_connected(" << (poly.
base_level) <<
")");
55 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"ord_inv(" << poly <<
"), " << poly <<
" irreducible");
57 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv(" << poly <<
") <= " << poly <<
" const");
60 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv(" << poly <<
") <= del(" << poly <<
") && sgn_inv(" << poly <<
") && cell_connected(" << poly.
level <<
")");
64 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv(" << poly <<
") <= " << poly <<
"(" << deriv.
sample() <<
") != 0 && sgn_inv(" << poly <<
")");
72 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"ord_inv(" << poly <<
")");
74 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv(" << poly <<
") <= " << poly <<
" const");
77 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv(" << poly <<
") <= ord_inv(factors(" << poly <<
")) <=> ord_inv(" << factors <<
")");
78 for (
const auto& factor : factors) {
86 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
")");
88 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sgn_inv(" << poly <<
") <= " << poly <<
" const");
90 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sgn_inv(" << poly <<
") <= ord_inv(" << poly <<
")");
92 std::optional<datastructures::PolyRef> lowest_zero_factor;
95 if (lowest_zero_factor == std::nullopt ||
96 factor.level < lowest_zero_factor->level ||
100 lowest_zero_factor = factor;
105 if (lowest_zero_factor) {
106 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sgn_inv(" << poly <<
") <= sgn_inv(" << *lowest_zero_factor <<
") && " << *lowest_zero_factor <<
"("<< deriv.
sample() <<
")=0");
109 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sgn_inv(" << poly <<
") <= sgn_inv(factors(" << poly <<
")) <=> sgn_inv(" << deriv.
proj().
factors_nonconst(poly) <<
")");
119 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
"), " << poly <<
" irreducible and non-zero");
121 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sgn_inv(" << poly <<
") <= del(" << poly <<
")");
127 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
135 for (
size_t idx = 0; idx < roots.size(); idx++) {
144 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
152 for (
size_t idx = 0; idx < roots.size(); idx++) {
170 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"an_sub(" << deriv.level() <<
")");
175 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
"), using EC");
186 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"semi_sgn_inv(" << poly <<
"), using EC");
192 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"repr(" << cell <<
")");
194 if (!cell.
lower().is_infty()) {
195 if (cell.
lower().value().is_root()) {
198 for (
const auto& roots : cell.
lower().value().roots()) {
199 for (
const auto& root : roots) {
205 if (!cell.
upper().is_infty()) {
206 if (cell.
upper().value().is_root()) {
209 for (
const auto& roots : cell.
upper().value().roots()) {
210 for (
const auto& root : roots) {
223 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"ir_ord(" << ordering <<
", " << deriv.
sample() <<
")");
225 for (
const auto& rel : ordering.
data()) {
226 assert(rel.first.is_root() && rel.second.is_root());
227 auto& first = rel.first.root();
228 auto& second = rel.second.root();
229 if (first.poly != second.poly) {
240 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
"), " << poly <<
" irreducible");
245 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
"), " << poly <<
" irreducible and nullified");
248 for (
const auto coeff : deriv.
proj().
coeffs(poly)) {
A DelineatedDerivation is a BaseDerivation with a Delineation and an underlying SampledDerivation.
const Assignment & underlying_sample() const
void add_poly_nonzero(PolyRef poly)
void add_poly_nullified(PolyRef poly)
void add_root(RAN root, TaggedIndexedRoot tagged_root)
Describes an ordering of IndexedRoots.
const auto & data() const
bool holds_transitive(RootFunction first, RootFunction second, bool strict) const
bool is_projective() const
const std::vector< PolyRef > & factors_nonconst(PolyRef p)
bool has_const_coeff(PolyRef p) const
bool known(const Polynomial &p) const
std::size_t degree(PolyRef p) const
bool is_ldcf_zero(const Assignment &sample, PolyRef p)
bool is_disc_zero(const Assignment &sample, PolyRef p)
bool is_nullified(const Assignment &sample, PolyRef p)
std::size_t total_degree(PolyRef p)
const std::vector< RAN > & real_roots(const Assignment &sample, PolyRef p)
PolyRef simplest_nonzero_coeff(const Assignment &sample, PolyRef p, std::function< bool(const Polynomial &, const Polynomial &)> compare)
size_t num_roots(const Assignment &sample, PolyRef p)
bool is_zero(const Assignment &sample, PolyRef p)
std::vector< PolyRef > coeffs(PolyRef p)
A SampledDerivation is a DelineatedDerivation with a sample and an DelineationInterval w....
const Assignment & sample() const
const Assignment & underlying_sample() const
bool contains(const P &property) const
A symbolic interal whose bounds are defined by indexed root expressions.
const auto & lower() const
Return the lower bound.
const auto & upper() const
Returns the upper bound.
const IndexedRoot & section_defining() const
In case of a section, the defining indexed root is returned.
Implementation of derivation rules.
void poly_irreducible_ord_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void root_ordering_holds(datastructures::SampledDerivation< P > &deriv, const datastructures::IndexedRootOrdering &ordering)
void cell_analytic_submanifold([[maybe_unused]] datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &)
void poly_irreducible_null_sgn_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_ord_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_irreducible_sgn_inv_ec(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell, datastructures::PolyRef poly)
void poly_irreducible_nonzero_sgn_inv(datastructures::DelineatedDerivation< P > &deriv, datastructures::PolyRef poly)
void cell_connected(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell, const datastructures::IndexedRootOrdering &ordering)
void poly_sgn_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly, bool skip_if_ord_inv=true)
bool poly_del(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_irreducible_sgn_inv(datastructures::SampledDerivation< P > &, const datastructures::SymbolicInterval &, const datastructures::IndexedRootOrdering &, [[maybe_unused]] datastructures::PolyRef poly)
void delineate(datastructures::DelineatedDerivation< P > &deriv, const properties::poly_irreducible_semi_sgn_inv &prop)
void poly_irreducible_semi_sgn_inv_ec(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell, datastructures::PolyRef poly)
bool poly_non_null(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void cell_represents(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell)
carl::ContextPolynomial< Rational > Polynomial
static size_t level_of(const VariableOrdering &order, const Pol &poly)
#define SMTRAT_LOG_TRACE(channel, msg)
Represents the i-th root of a multivariate polynomial at its main variable (given an appropriate samp...
PolyRef poly
A multivariate polynomial.
level_t level
The level of the polynomial.
level_t base_level
The base level of the polynomial.
datastructures::PolyRef poly
datastructures::PolyRef poly
datastructures::PolyRef poly