SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
rules_pdel.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "properties.h"
4 #include "../datastructures/derivation.h"
5 
7 
8 template<typename P>
10  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "del(" << poly << ")");
11  deriv.insert(properties::poly_proj_del{ poly });
12  if (deriv.proj().num_roots(deriv.sample(), poly) > 0 || deriv.proj().is_ldcf_zero(deriv.sample(), poly)) {
13  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> del(" << poly << ") <= proj_del(" << poly << ") && sgn_inv(ldcf(" << poly << ") [" << deriv.proj().ldcf(poly) << "])");
14  deriv.insert(properties::poly_sgn_inv{ deriv.proj().ldcf(poly) });
15  } else {
16  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> del(" << poly << ") <= proj_del(" << poly << ")");
17  }
18  return true;
19 }
20 
21 template<typename P>
23  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "proj_del(" << poly << ")");
24  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> proj_del(" << poly << ") <= non_null(" << poly << ") && ord_inv(disc(" << poly << ") [" << deriv.proj().disc(poly) << "]) && cell_connected(" << (poly.base_level) << ")");
25  deriv.insert(properties::poly_ord_inv{ deriv.proj().disc(poly) });
27  if (!poly_non_null(deriv, poly)) return false;
28  return true;
29 }
30 
31 template<typename P>
33  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "ord_inv(" << poly << "), " << poly << " irreducible");
34  if (deriv.proj().is_const(poly)) {
35  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> ord_inv(" << poly << ") <= " << poly << " const");
36  } else {
37  if (deriv.proj().is_zero(deriv.sample(), poly)) {
38  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> ord_inv(" << poly << ") <= proj_del(" << poly << ") && sgn_inv(" << poly << ") && cell_connected(" << poly.level << ")");
39  deriv.insert(properties::poly_proj_del{ poly });
41  } else {
42  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> ord_inv(" << poly << ") <= " << poly << "(" << deriv.sample() << ") != 0 && sgn_inv(" << poly << ")");
43  }
45  }
46 }
47 
48 template<typename P>
50  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "ord_inv(" << poly << ")");
51  if (deriv.proj().is_const(poly)) {
52  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> ord_inv(" << poly << ") <= " << poly << " const");
53  } else {
54  auto factors = deriv.proj().factors_nonconst(poly);
55  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "-> ord_inv(" << poly << ") <= ord_inv(factors(" << poly << ")) <=> ord_inv(" << factors << ")");
56  for (const auto& factor : factors) {
57  poly_irreducible_ord_inv_pdel(deriv, factor);
58  }
59  }
60 }
61 
62 template<typename P>
64  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "ir_ord(" << ordering << ", " << deriv.sample() << ")");
65  assert(ordering.is_projective());
66  deriv.insert(properties::cell_connected{ deriv.level() });
67  for (const auto& rel : ordering.data()) {
68  assert(rel.first.is_root() && rel.second.is_root());
69  auto& first = rel.first.root();
70  auto& second = rel.second.root();
71  if (first.poly != second.poly) {
72  //assert(rel.is_strict || (ordering.holds_transitive(first,second,false) && ordering.holds_transitive(second,first,false))); // not supported
73  assert(deriv.contains(properties::poly_proj_del{ first.poly }));
74  assert(deriv.contains(properties::poly_proj_del{ second.poly }));
75  deriv.insert(properties::poly_ord_inv{ deriv.proj().res(first.poly, second.poly) });
76  }
77  }
78 }
79 
80 template<typename P>
81 void poly_irreducible_sgn_inv_pdel(datastructures::SampledDerivation<P>& deriv, const datastructures::SymbolicInterval& cell, const datastructures::IndexedRootOrdering& /*ordering*/, const boost::container::flat_set<datastructures::PolyRef>& ordering_non_projective_polys, datastructures::PolyRef poly) {
82  SMTRAT_LOG_TRACE("smtrat.cadcells.operators.rules", "sgn_inv(" << poly << "), " << poly << " irreducible");
83  if (ordering_non_projective_polys.find(poly) != ordering_non_projective_polys.end()) {
84  deriv.insert(properties::poly_del{ poly });
85  } else if (cell.lower().is_infty() || cell.upper().is_infty()) {
86  deriv.insert(properties::poly_del{ poly });
87  } else {
88  assert(deriv.contains(properties::poly_proj_del{ poly }));
89  }
90 }
91 
92 
93 }
Describes an ordering of IndexedRoots.
Definition: roots.h:400
const std::vector< PolyRef > & factors_nonconst(PolyRef p)
Definition: projections.h:238
bool is_ldcf_zero(const Assignment &sample, PolyRef p)
Definition: projections.h:325
size_t num_roots(const Assignment &sample, PolyRef p)
Definition: projections.h:262
bool is_zero(const Assignment &sample, PolyRef p)
Definition: projections.h:250
A SampledDerivation is a DelineatedDerivation with a sample and an DelineationInterval w....
Definition: derivation.h:299
A symbolic interal whose bounds are defined by indexed root expressions.
Definition: roots.h:250
const auto & lower() const
Return the lower bound.
Definition: roots.h:285
const auto & upper() const
Returns the upper bound.
Definition: roots.h:292
Implementation of derivation rules.
Definition: rules.h:13
void root_ordering_holds_pdel(datastructures::SampledDerivation< P > &deriv, const datastructures::IndexedRootOrdering &ordering)
Definition: rules_pdel.h:63
void poly_ord_inv_pdel(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
Definition: rules_pdel.h:49
void poly_irreducible_sgn_inv_pdel(datastructures::SampledDerivation< P > &deriv, const datastructures::SymbolicInterval &cell, const datastructures::IndexedRootOrdering &, const boost::container::flat_set< datastructures::PolyRef > &ordering_non_projective_polys, datastructures::PolyRef poly)
Definition: rules_pdel.h:81
bool poly_del_pdel(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
Definition: rules_pdel.h:9
bool poly_non_null(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
Definition: rules.h:16
void poly_irreducible_ord_inv_pdel(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
Definition: rules_pdel.h:32
bool poly_proj_del(datastructures::SampledDerivation< P > &deriv, datastructures::PolyRef poly)
Definition: rules_pdel.h:22
#define SMTRAT_LOG_TRACE(channel, msg)
Definition: logging.h:36
level_t level
The level of the polynomial.
Definition: polynomials.h:18
level_t base_level
The base level of the polynomial.
Definition: polynomials.h:22