7 namespace ordering_util {
8 using Decomposition = boost::container::flat_map<std::pair<datastructures::PolyRef,datastructures::PolyRef>,std::vector<datastructures::IndexedRootRelation>>;
13 result.try_emplace(std::make_pair(p1, p2)).first->second.push_back(rel);
15 result.try_emplace(std::make_pair(p2, p1)).first->second.push_back(rel);
22 for (
const auto& rel : ordering.
data()) {
23 if (rel.first.is_root() && rel.second.is_root()) {
25 }
else if (rel.first.is_root() && !rel.second.is_root()) {
26 const auto& roots = rel.second.is_cminmax() ? rel.second.cminmax().roots : rel.second.cmaxmin().roots;
27 for (
const auto& rootsp : roots) {
28 for (
const auto& root : rootsp) {
32 }
else if (!rel.first.is_root() && rel.second.is_root()) {
33 const auto& roots = rel.first.is_cminmax() ? rel.first.cminmax().roots : rel.first.cmaxmin().roots;
34 for (
const auto& rootsp : roots) {
35 for (
const auto& root : rootsp) {
40 const auto& roots1 = rel.first.is_cminmax() ? rel.first.cminmax().roots : rel.first.cmaxmin().roots;
41 const auto& roots2 = rel.second.is_cminmax() ? rel.second.cminmax().roots : rel.second.cmaxmin().roots;
42 for (
const auto& roots1p : roots1) {
43 for (
const auto& root1 : roots1p) {
44 for (
const auto& roots2p : roots2) {
45 for (
const auto& root2 : roots2p) {
58 for (
const auto& rel : ordering.
data()) {
69 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
", " << enable_weak <<
")");
74 for (
const auto& d : decomposed) {
75 const auto& poly1 = d.first.first;
76 const auto& poly2 = d.first.second;
77 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
78 bool all_relations_weak = std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair){ return pair.is_strict; }) == d.second.end();
79 boost::container::flat_set<datastructures::PolyRef> polys({ poly1, poly2 });
82 bool only_regular = std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair) { return !(pair.first.is_root() && pair.second.is_root()); }) == d.second.end();
83 filter_util::delineable_interval_roots<P>(deriv, polys, deriv.
proj().
res(poly1, poly2));
85 if (!enable_regular && only_regular) return filter_util::result::NORMAL;
86 Assignment ass = filter_util::projection_root(*deriv.delineated(), ran);
87 if (!delineable_interval->contains(ran)) {
88 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" outside of " << delineable_interval);
89 if (!enable_regular) return filter_util::result::NORMAL;
90 if (filter_util::has_common_real_root(deriv.proj(),ass,poly1,poly2)) {
91 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> common root at " << ran);
92 if (all_relations_weak && enable_weak) return filter_util::result::INCLUSIVE;
93 else return filter_util::result::NORMAL;
95 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no intersection at " << ran);
96 if (enable_weak) return filter_util::result::INCLUSIVE_OPTIONAL;
97 else return filter_util::result::NORMAL_OPTIONAL;
100 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" in " << delineable_interval);
101 assert(!deriv.proj().is_nullified(ass,poly1));
102 assert(!deriv.proj().is_nullified(ass,poly2));
103 auto roots1 = deriv.proj().real_roots(ass,poly1);
104 auto roots2 = deriv.proj().real_roots(ass,poly2);
105 for (const auto& pair : d.second) {
106 if (pair.first.is_root() && pair.second.is_root()) {
107 if (!enable_regular) return filter_util::result::NORMAL;
108 const auto& roots_first = pair.first.root().poly == poly1 ? roots1 : roots2;
109 const auto& roots_second = pair.first.root().poly == poly1 ? roots2 : roots1;
110 auto index_first = pair.first.root().index;
111 auto index_second = pair.second.root().index;
112 assert(index_first <= roots_first.size());
113 assert(index_second <= roots_second.size());
114 if (roots_first[index_first-1] == roots_second[index_second-1]) {
115 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
116 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
117 else return filter_util::result::NORMAL;
119 } else if (pair.first.is_root()) {
120 const auto& roots_first = pair.first.root().poly == poly1 ? roots1 : roots2;
121 auto index_first = pair.first.root().index;
122 assert(index_first <= roots_first.size());
123 auto poly_second = pair.first.root().poly == poly1 ? poly2 : poly1;
125 bool relevant = true;
126 assert(pair.second.is_cminmax() || pair.second.is_cmaxmin());
127 auto delineable_interval_cb = filter_util::delineable_interval(deriv.proj(), deriv.sample(), pair.second.polys());
128 assert(delineable_interval_cb);
129 if (delineable_interval_cb->contains(ran)) {
130 auto res = pair.second.is_cminmax() ? deriv.proj().evaluate(ass, pair.second.cminmax()) : deriv.proj().evaluate(ass, pair.second.cmaxmin());
132 if (res.first == roots_first[index_first-1]) {
133 relevant = std::find_if(res.second.begin(), res.second.end(), [&](const auto& ir) { return ir.poly == poly_second; }) != res.second.end();
137 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
138 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
139 else return filter_util::result::NORMAL;
141 } else if (pair.second.is_root()) {
142 const auto& roots_second = pair.second.root().poly == poly1 ? roots1 : roots2;
143 auto index_second = pair.second.root().index;
144 assert(index_second <= roots_second.size());
145 auto poly_first = pair.second.root().poly == poly1 ? poly2 : poly1;
147 bool relevant = true;
148 assert(pair.first.is_cminmax() || pair.first.is_cmaxmin());
149 auto delineable_interval_cb = filter_util::delineable_interval(deriv.proj(), deriv.sample(), pair.first.polys());
150 assert(delineable_interval_cb);
151 if (delineable_interval_cb->contains(ran)) {
152 auto res = pair.first.is_cminmax() ? deriv.proj().evaluate(ass, pair.first.cminmax()) : deriv.proj().evaluate(ass, pair.first.cmaxmin());
154 if (res.first == roots_second[index_second-1]) {
155 relevant = std::find_if(res.second.begin(), res.second.end(), [&](const auto& ir) { return ir.poly == poly_first; }) != res.second.end();
159 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
160 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
161 else return filter_util::result::NORMAL;
164 assert(pair.first.is_cmaxmin() && pair.second.is_cminmax());
165 auto poly_first = (pair.first.has_poly(poly1) && pair.second.has_poly(poly2)) ? poly1 : poly2;
166 auto poly_second = (pair.first.has_poly(poly1) && pair.second.has_poly(poly2)) ? poly2 : poly1;
167 assert(pair.first.has_poly(poly_first) && pair.second.has_poly(poly_second));
169 bool relevant = true;
170 auto cb_polys = pair.first.polys();
171 cb_polys.merge(pair.second.polys());
172 auto delineable_interval_cb = filter_util::delineable_interval(deriv.proj(), deriv.sample(), cb_polys);
173 assert(delineable_interval_cb);
174 if (delineable_interval_cb->contains(ran)) {
175 auto res1 = deriv.proj().evaluate(ass, pair.first.cmaxmin());
176 auto res2 = deriv.proj().evaluate(ass, pair.second.cminmax());
178 if (res1.first == res2.first) {
179 relevant = std::find_if(res1.second.begin(), res1.second.end(), [&](const auto& ir) { return ir.poly == poly_first; }) != res1.second.end() && std::find_if(res2.second.begin(), res2.second.end(), [&](const auto& ir) { return ir.poly == poly_second; }) != res2.second.end();
183 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
184 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
185 else return filter_util::result::NORMAL;
189 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no relevant intersection at " << ran);
198 static constexpr
bool only_rational_samples =
false;
199 static constexpr
bool only_irreducible_resultants =
false;
200 static constexpr
bool only_if_no_intersections =
false;
201 static constexpr std::size_t only_if_total_degree_below = 0;
204 template<
typename Settings,
typename P>
206 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
213 for (
const auto& d : decomposed) {
214 const auto& poly1 = d.first.first;
215 const auto& poly2 = d.first.second;
216 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
218 bool all_relations_weak = std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair){ return pair.is_strict; }) == d.second.end();
220 bool all_roots_algebraic =
true;
221 if (!underlying_sample_algebraic) {
223 all_roots_algebraic =
false;
226 all_roots_algebraic = std::find_if(roots.begin(), roots.end(), [](
const auto& r) { return !r.is_numeric(); }) != roots.end();
231 (!Settings::only_rational_samples || !all_roots_algebraic) &&
232 (!Settings::only_irreducible_resultants || irreducible) &&
234 (Settings::only_if_total_degree_below == 0 || deriv.
proj().
total_degree(deriv.
proj().
res(poly1, poly2)) < Settings::only_if_total_degree_below)
236 boost::container::flat_set<datastructures::PolyRef> polys({ poly1, poly2 });
239 filter_util::delineable_interval_roots<P>(deriv, polys, deriv.
proj().
res(poly1, poly2));
241 if (Settings::only_rational_samples && !ran.is_numeric()) {
242 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> sample is algebraic, adding " << ran);
244 if (enable_weak && all_relations_weak) return filter_util::result::INCLUSIVE;
245 else return filter_util::result::NORMAL;
250 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" outside of " << delineable_interval);
251 if (filter_util::has_common_real_root(deriv.proj(),ass,poly1,poly2)) {
252 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> common root at " << ran);
253 if (enable_weak && all_relations_weak) return filter_util::result::INCLUSIVE;
254 else return filter_util::result::NORMAL;
256 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no intersection at " << ran);
257 if (all_relations_weak) return filter_util::result::INCLUSIVE_OPTIONAL;
258 else return filter_util::result::NORMAL_OPTIONAL;
266 for (
const auto& pair : d.second) {
267 assert(pair.first.is_root() && pair.second.is_root());
268 auto index1 = pair.first.root().poly == poly1 ? pair.first.root().index : pair.second.root().index;
269 auto index2 = pair.first.root().poly == poly1 ? pair.second.root().index : pair.first.root().index;
270 assert(index1 <= roots1.size());
271 assert(index2 <= roots2.size());
274 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
277 if (enable_weak && !pair.is_strict)
return filter_util::result::INCLUSIVE;
281 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no relevant intersection at " << ran);
282 if (all_relations_weak)
return filter_util::result::INCLUSIVE_OPTIONAL;
283 else return filter_util::result::NORMAL_OPTIONAL;
288 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> skip filter, adding " << ran);
290 if (enable_weak && all_relations_weak) return filter_util::result::INCLUSIVE;
291 else return filter_util::result::NORMAL;
299 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
304 for (
const auto& d : decomposed) {
305 const auto& poly1 = d.first.first;
306 const auto& poly2 = d.first.second;
307 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
308 bool all_relations_weak = std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair){ return pair.is_strict; }) == d.second.end();
310 if (all_relations_weak) return filter_util::result::INCLUSIVE;
311 else return filter_util::result::NORMAL;
318 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
323 for (
const auto& d : decomposed) {
324 const auto& poly1 = d.first.first;
325 const auto& poly2 = d.first.second;
326 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
328 return filter_util::result::NORMAL;
335 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
")");
341 for (
const auto& d : decomposed) {
342 const auto& poly1 = d.first.first;
343 const auto& poly2 = d.first.second;
344 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
345 bool all_relations_weak = std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair){ return pair.is_strict; }) == d.second.end();
346 boost::container::flat_set<datastructures::PolyRef> polys({ poly1, poly2 });
349 filter_util::delineable_interval_roots<P>(deriv, polys, deriv.
proj().
res(poly1, poly2));
351 Assignment ass = filter_util::projection_root(*deriv.delineated(), ran);
352 if (!delineable_interval->contains(ran)) {
353 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" outside of " << delineable_interval);
354 if (all_relations_weak) return filter_util::result::INCLUSIVE;
355 else return filter_util::result::NORMAL;
357 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" in " << delineable_interval);
358 assert(poly1 != poly2);
359 if (!prop.ordering.biggest_cell_wrt) {
360 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> not biggest_cell_wrt");
361 for (const auto& pair : d.second) {
362 if (enable_weak && !pair.is_strict) return filter_util::result::INCLUSIVE;
364 return filter_util::result::NORMAL;
366 for (
const auto& pair : d.second) {
367 assert(pair.first.is_root() && pair.second.is_root());
368 if (!prop.ordering.biggest_cell_wrt->lower().is_infty() && pair.second == prop.ordering.biggest_cell_wrt->lower().value()) {
369 auto root = deriv.proj().evaluate(ass, pair.second.root());
370 Assignment ass2 = ass;
371 ass2.emplace(deriv.proj().main_var(pair.first.root().poly), root);
372 if (deriv.proj().is_zero(ass2, pair.first.root().poly)) {
373 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
374 if (enable_weak && !pair.is_strict) return filter_util::result::INCLUSIVE;
375 else return filter_util::result::NORMAL;
378 auto root = deriv.proj().evaluate(ass, pair.first.root());
379 Assignment ass2 = ass;
380 ass2.emplace(deriv.proj().main_var(pair.second.root().poly), root);
381 if (deriv.proj().is_zero(ass2, pair.second.root().poly)) {
382 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
383 if (enable_weak && !pair.is_strict) return filter_util::result::INCLUSIVE;
384 else return filter_util::result::NORMAL;
387 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> not an intersection with an interval bound at " << ran);
388 if (enable_weak && !pair.is_strict)
return filter_util::result::INCLUSIVE;
392 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no relevant intersection at " << ran);
393 if (all_relations_weak)
return filter_util::result::INCLUSIVE_OPTIONAL;
394 else return filter_util::result::NORMAL_OPTIONAL;
402 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"delineate(" << prop <<
", " << enable_weak <<
")");
407 for (
const auto& d : decomposed) {
408 const auto& poly1 = d.first.first;
409 const auto& poly2 = d.first.second;
410 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
411 bool all_relations_weak = enable_weak && std::find_if(d.second.begin(), d.second.end(), [](
const auto& pair){ return pair.is_strict; }) == d.second.end();
412 boost::container::flat_set<datastructures::PolyRef> polys({ poly1, poly2 });
415 filter_util::delineable_interval_roots<P>(deriv, polys, deriv.
proj().
res(poly1, poly2));
417 Assignment ass = filter_util::projection_root(*deriv.delineated(), ran);
418 if (!delineable_interval->contains(ran)) {
419 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" outside of " << delineable_interval);
420 if (all_relations_weak && enable_weak) return filter_util::result::INCLUSIVE;
421 else return filter_util::result::NORMAL;
423 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> resultant's root " << ran <<
" in " << delineable_interval);
424 for (const auto& pair : d.second) {
425 if (pair.first.is_root() && pair.second.is_root()) {
426 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
427 else return filter_util::result::NORMAL;
428 } else if (pair.first.is_root()) {
429 assert(pair.second.is_cminmax() || pair.second.is_cmaxmin());
430 auto poly_second = pair.first.root().poly == poly1 ? poly2 : poly1;
431 if ((pair.second.is_cminmax() && pair.second.cminmax().bounds->poly_bound_at(poly_second, ran)) ||
432 (pair.second.is_cmaxmin() && pair.second.cmaxmin().bounds->poly_bound_at(poly_second, ran))) {
434 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
435 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
436 else return filter_util::result::NORMAL;
438 } else if (pair.second.is_root()) {
439 assert(pair.first.is_cminmax() || pair.first.is_cmaxmin());
440 auto poly_first = pair.second.root().poly == poly1 ? poly2 : poly1;
441 if ((pair.first.is_cminmax() && pair.first.cminmax().bounds->poly_bound_at(poly_first, ran)) ||
442 (pair.first.is_cmaxmin() && pair.first.cmaxmin().bounds->poly_bound_at(poly_first, ran))) {
443 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
444 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
445 else return filter_util::result::NORMAL;
448 assert(pair.first.is_cmaxmin() && pair.second.is_cminmax());
449 auto poly_first = (pair.first.has_poly(poly1) && pair.second.has_poly(poly2)) ? poly1 : poly2;
450 auto poly_second = (pair.first.has_poly(poly1) && pair.second.has_poly(poly2)) ? poly2 : poly1;
451 assert(pair.first.has_poly(poly_first) && pair.second.has_poly(poly_second));
452 if (pair.first.cmaxmin().bounds->poly_bound_at(poly_first, ran) && pair.second.cminmax().bounds->poly_bound_at(poly_second, ran)) {
453 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> relevant intersection at " << ran);
454 if (!pair.is_strict && enable_weak) return filter_util::result::INCLUSIVE;
455 else return filter_util::result::NORMAL;
459 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> no relevant intersection at " << ran);
460 if (enable_weak)
return filter_util::result::INCLUSIVE_OPTIONAL;
461 else return filter_util::result::NORMAL_OPTIONAL;
469 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"poly_loc_del(" << poly <<
", " << underlying_ordering <<
")");
473 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add ord_inv_base(" << factor <<
") ");
474 if (factor.level == deriv.
level()) {
477 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add sgn_inv(" << factor <<
") ");
482 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add sgn_inv(" << factor <<
") ");
484 if (ordering_polys.contains(factor)) {
486 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add del(" << factor <<
") ");
490 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add sgn_inv(" << factor <<
") ");
495 assert(factor.level < deriv.
level());
497 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> add sgn_inv(" << factor <<
") ");
504 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"ord_inv_base(" << poly <<
"), " << poly <<
" irreducible");
508 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv_base(" << poly <<
") <= " << poly <<
"(" << deriv.
sample() <<
") != 0 && sgn_inv(" << poly <<
")");
511 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> ord_inv_base(" << poly <<
") <= del(" << poly <<
") && cell_connected(" << poly.
level <<
")");
519 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"ir_ord(" << ordering <<
", " << deriv.
sample() <<
")");
520 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"using underlying_cell=" << underlying_cell <<
", underlying_ordering=" << underlying_ordering <<
", ordering_polys=" << ordering_polys);
526 for (
const auto& d : decomposed) {
527 const auto& poly1 = d.first.first;
528 const auto& poly2 = d.first.second;
529 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"consider pair " << poly1 <<
" and " << poly2 <<
"");
532 poly_loc_del(deriv, underlying_cell, underlying_ordering, ordering_polys, deriv.
proj().
res(poly1, poly2));
539 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"sgn_inv(" << poly <<
"), " << poly <<
" irreducible");
544 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"semi_sgn_inv(" << poly <<
"), " << poly <<
" irreducible");
549 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"semi_sgn_inv(" << poly <<
"), " << poly <<
" irreducible and non-zero");
550 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= sgn_inv(" << poly <<
")");
556 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"semi_sgn_inv(" << poly <<
"), " << poly <<
" irreducible and nullified");
557 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= sgn_inv(" << poly <<
")");
563 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"semi_sgn_inv(" << poly <<
")");
565 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= " << poly <<
" const");
567 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= ord_inv(" << poly <<
")");
569 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= poly_sgn_inv(" << poly <<
")");
571 std::optional<datastructures::PolyRef> lowest_zero_factor;
574 if (lowest_zero_factor == std::nullopt ||
575 factor.level < lowest_zero_factor->level ||
579 lowest_zero_factor = factor;
584 if (lowest_zero_factor) {
585 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= sgn_inv(" << *lowest_zero_factor <<
") && "<< *lowest_zero_factor <<
"("<< deriv.
sample() <<
")=0");
588 SMTRAT_LOG_TRACE(
"smtrat.cadcells.operators.rules",
"-> semi_sgn_inv(" << poly <<
") <= semi_sgn_inv(factors(" << poly <<
")) <=> semi_sgn_inv(" << deriv.
proj().
factors_nonconst(poly) <<
")");
A DelineatedDerivation is a BaseDerivation with a Delineation and an underlying SampledDerivation.
Describes an ordering of IndexedRoots.
std::optional< SymbolicInterval > biggest_cell_wrt
const auto & data() const
const std::vector< PolyRef > & factors_nonconst(PolyRef p)
RAN evaluate(const Assignment &sample, IndexedRoot r)
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 res(PolyRef p, PolyRef q)
bool is_zero(const Assignment &sample, PolyRef p)
const std::vector< RAN > real_roots_reducible(const Assignment &sample, 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
DelineatedDerivationRef< Properties > & delineated()
A symbolic interal whose bounds are defined by indexed root expressions.
bool contains_root_ordering_holds(P &deriv, const datastructures::IndexedRootOrdering &ordering)
void filter_roots(datastructures::DelineatedDerivation< P > &deriv, const datastructures::PolyRef poly, std::function< result(const RAN &)> filter_condition)
auto projection_root(const datastructures::DelineatedDerivation< P > &deriv, const RAN &root)
std::optional< carl::Interval< RAN > > delineable_interval(datastructures::Projections &proj, const Assignment &sample, const boost::container::flat_set< datastructures::PolyRef > &polys)
boost::container::flat_map< std::pair< datastructures::PolyRef, datastructures::PolyRef >, std::vector< datastructures::IndexedRootRelation > > Decomposition
auto decompose(const datastructures::IndexedRootOrdering &ordering)
void add_to_decomposition(Decomposition &result, datastructures::PolyRef p1, datastructures::PolyRef p2, const datastructures::IndexedRootRelation &rel)
auto has_intersection(datastructures::SampledDerivation< P > &deriv, const datastructures::IndexedRootOrdering &ordering)
Implementation of derivation rules.
void poly_irreducible_semi_sgn_inv_filtered(datastructures::SampledDerivation< P > &, const datastructures::SymbolicInterval &, const datastructures::IndexedRootOrdering &, [[maybe_unused]] datastructures::PolyRef poly)
void delineate_all(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop, bool enable_weak=true)
void delineate_bounds_only(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop)
void poly_irreducible_sgn_inv_filtered(datastructures::SampledDerivation< P > &, const datastructures::SymbolicInterval &, const datastructures::IndexedRootOrdering &, [[maybe_unused]] datastructures::PolyRef poly)
void poly_irreducible_null_sgn_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_irreducible_nonzero_sgn_inv(datastructures::DelineatedDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_irreducible_null_semi_sgn_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_semi_sgn_inv(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
bool root_ordering_holds_delineated(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &underlying_cell, const datastructures::IndexedRootOrdering &underlying_ordering, const boost::container::flat_set< datastructures::PolyRef > &ordering_polys, const datastructures::IndexedRootOrdering &ordering)
void poly_loc_del(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &underlying_cell, const datastructures::IndexedRootOrdering &underlying_ordering, const boost::container::flat_set< datastructures::PolyRef > &ordering_polys, const datastructures::PolyRef poly)
void delineate_all_compound(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop, bool enable_weak=true, bool enable_regular=true)
void delineate_compound_piecewiselinear(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop, bool enable_weak=true)
void poly_irreducible_nonzero_semi_sgn_inv(datastructures::DelineatedDerivation< P > &deriv, datastructures::PolyRef poly)
void poly_ord_inv_base(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell, const datastructures::IndexedRootOrdering &, datastructures::PolyRef poly)
void delineate_noop(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop)
void delineate_all_biggest_cell(datastructures::SampledDerivation< P > &deriv, const properties::root_ordering_holds &prop, bool enable_weak=true)
carl::Assignment< RAN > Assignment
#define SMTRAT_LOG_TRACE(channel, msg)
#define SMTRAT_STATISTICS_CALL(function)
A relation between two roots.
level_t level
The level of the polynomial.
datastructures::IndexedRootOrdering ordering