5 #include <carl-arith/core/Variable.h>
6 #include <carl-common/datastructures/Bitset.h>
15 namespace variableordering {
20 for (
auto v: c.variables()) {
26 inline long countUnivariates(
const std::vector<carl::Bitset>& constraints, std::size_t
id) {
27 return std::count(constraints.begin(), constraints.end(), carl::Bitset({id}));
29 inline bool stillOccurs(
const std::vector<carl::Bitset>& constraints, std::size_t
id) {
30 return std::find_if(constraints.begin(), constraints.end(), [
id](
const auto& b){ return b.test(id); }) != constraints.end();
32 inline carl::Variable
findMax(
const std::vector<carl::Bitset>& constraints,
const VariableIDs& vids) {
33 carl::Variable maxVar = carl::Variable::NO_VARIABLE;
34 carl::Variable possible = carl::Variable::NO_VARIABLE;
36 for (
const auto& v: vids.
mIDs) {
42 if (possible == carl::Variable::NO_VARIABLE) {
48 if (maxVar != carl::Variable::NO_VARIABLE)
return maxVar;
53 std::size_t
id = vids[v];
54 for (
auto it = constraints.begin(); it != constraints.end(); ) {
58 it = constraints.erase(it);
67 template<
typename Constra
ints>
70 std::vector<carl::Bitset> constraints;
71 for (
const auto& cons: c) {
73 SMTRAT_LOG_DEBUG(
"smtrat.mcsat",
"Constraint " << cons <<
" -> " << constraints.back());
77 std::vector<carl::Variable> res;
78 while (!constraints.empty()) {
bool stillOccurs(const std::vector< carl::Bitset > &constraints, std::size_t id)
long countUnivariates(const std::vector< carl::Bitset > &constraints, std::size_t id)
void purgeVariable(std::vector< carl::Bitset > &constraints, carl::Variable v, const VariableIDs &vids)
carl::Bitset variablesOf(const ConstraintT &c, VariableIDs &vids)
carl::Variable findMax(const std::vector< carl::Bitset > &constraints, const VariableIDs &vids)
std::vector< carl::Variable > greedy_max_univariate(const Constraints &c)
Class to create the formulas for axioms.
carl::Constraint< Poly > ConstraintT
#define SMTRAT_LOG_DEBUG(channel, msg)
std::map< carl::Variable, std::size_t > mIDs