SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
VariableOrdering.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "feature_based.h"
5 
6 namespace smtrat {
7 namespace mcsat {
8 
9 enum class VariableOrdering {
17 };
18 
19 inline std::string get_name(VariableOrdering ordering) {
20  switch (ordering) {
21  case VariableOrdering::GreedyMaxUnivariate: return "GreedyMaxUnivariate";
22  case VariableOrdering::FeatureBased: return "FeatureBased";
23  case VariableOrdering::FeatureBasedZ3: return "FeatureBasedZ3";
24  case VariableOrdering::FeatureBasedBrown: return "FeatureBasedBrown";
25  case VariableOrdering::FeatureBasedTriangular: return "FeatureBasedTriangular";
26  case VariableOrdering::FeatureBasedLexicographic: return "FeatureBasedLexicographic";
27  case VariableOrdering::FeatureBasedPickering: return "FeatureBasedPickering";
28  }
29 }
30 
31 inline std::ostream& operator<<(std::ostream& os, VariableOrdering ordering){
32  return os << get_name(ordering);
33 }
34 
35 template<VariableOrdering vot, typename Constraints>
36 std::vector<carl::Variable> calculate_variable_order(const Constraints& c) {
37 
38  std::vector<ConstraintT> constraints;
39  for (int i = 0; i < c.size(); ++i) {
40  if (c[i].first == nullptr) continue;
41  if (c[i].first->reabstraction.type() != carl::FormulaType::CONSTRAINT) continue;
42  constraints.emplace_back(c[i].first->reabstraction.constraint());
43  }
44 
45  return calculate_variable_order<vot>(constraints);
46 }
47 
48 template<VariableOrdering vot>
49 std::vector<carl::Variable> calculate_variable_order(const std::vector<ConstraintT>& constraints){
50  switch (vot) {
52  return variableordering::greedy_max_univariate(constraints);
54  return variableordering::feature_based(constraints);
56  return variableordering::feature_based_z3(constraints);
58  return variableordering::feature_based_brown(constraints);
65  }
66 }
67 
68 }
69 
70 }
71 
std::vector< carl::Variable > feature_based_lexicographic(const Constraints &c)
std::vector< carl::Variable > greedy_max_univariate(const Constraints &c)
std::vector< carl::Variable > feature_based_z3(const Constraints &c)
std::vector< carl::Variable > feature_based_pickering(const Constraints &c)
According to Pickering, Lynn, Tereso Del Rio Almajano, Matthew England, and Kelly Cohen.
std::vector< carl::Variable > feature_based_brown(const Constraints &c)
According to https://www.usna.edu/Users/cs/wcbrown/research/ISSAC04/handout.pdf.
std::vector< carl::Variable > feature_based(const Constraints &c)
std::vector< carl::Variable > feature_based_triangular(const Constraints &c)
std::vector< carl::Variable > calculate_variable_order(const Constraints &c)
std::string get_name(VariableOrdering ordering)
std::ostream & operator<<(std::ostream &os, const Bookkeeping &bk)
Definition: Bookkeeping.h:107
Class to create the formulas for axioms.