6 #include <carl-covering/carl-covering.h>
7 #include <carl-arith/constraint/Complexity.h>
12 template<MISHeuristic heuristic>
15 template<
typename CAD>
20 template<
typename CAD>
27 template<
typename CAD>
29 auto covering = cad.
generateCovering().get_cover(carl::covering::heuristic::greedy);
31 for (
const auto& c: covering) {
32 mis.back().emplace(c);
37 template<
typename CAD>
41 res |= carl::covering::heuristic::remove_duplicates(sc);
42 res |= carl::covering::heuristic::select_essential(sc);
43 res |= carl::covering::heuristic::greedy(sc);
47 for (
const auto& c: covering) {
48 mis.back().emplace(c);
53 template<
typename CAD>
55 auto covering = cad.
generateCovering().get_cover(carl::covering::heuristic::exact);
57 for (
const auto& c: covering) {
58 mis.back().emplace(c);
63 template<
typename CAD>
66 carl::Bitset covering;
68 covering |= carl::covering::heuristic::remove_duplicates(cov.set_cover());
69 SMTRAT_LOG_DEBUG(
"smtrat.mis",
"After removing duplicates: " << covering << std::endl << cov);
71 covering |= carl::covering::heuristic::select_essential(cov.set_cover());
72 cov.set_cover().prune_sets();
74 if (cov.set_cover().active_set_count() == 0) {
76 for (
const auto& c: covering) {
77 mis.back().emplace(cov.get_set(c));
82 SMTRAT_LOG_DEBUG(
"smtrat.mis",
"After preconditioning: " << covering << std::endl << cov);
84 covering |= carl::covering::heuristic::greedy_weighted(cov,
86 constexpr
double constant_weight = 10.0;
87 constexpr
double complexity_weight = 0.1;
88 return constant_weight + complexity_weight * (double)
complexity(c.constr());
91 SMTRAT_LOG_DEBUG(
"smtrat.mis",
"After greedy: " << covering << std::endl << cov);
93 cov.set_cover().prune_sets();
94 if (cov.set_cover().active_set_count() == 0) {
96 for (
const auto& c: covering) {
97 mis.back().emplace(cov.get_set(c));
104 covering |= carl::covering::heuristic::exact(cov.set_cover());
106 assert(cov.set_cover().active_set_count() == 0);
108 for (
const auto& c: covering) {
109 mis.back().emplace(cov.get_set(c));
115 template<
typename CAD>
118 auto covering = carl::covering::heuristic::select_essential(cov.set_cover());
119 cov.set_cover().prune_sets();
121 if (cov.set_cover().active_set_count() == 0) {
123 for (
const auto& c: covering) {
124 mis.back().emplace(cov.get_set(c));
130 covering |= carl::covering::heuristic::remove_duplicates(cov.set_cover());
131 covering |= carl::covering::heuristic::greedy_weighted(cov,
133 constexpr
double constant_weight = 5.0;
134 constexpr
double complexity_weight = 0.1;
135 return constant_weight + complexity_weight * (double)
complexity(c.constr());
140 for (
const auto& c: covering) {
141 mis.back().emplace(cov.get_set(c));
const auto & getConstraintMap() const
auto generateCovering() const
void operator()(const CAD &cad, std::vector< FormulaSetT > &mis)
std::size_t complexity(const std::vector< FormulaT > &origin)
Class to create the formulas for axioms.
carl::Constraint< Poly > ConstraintT
#define SMTRAT_LOG_DEBUG(channel, msg)