SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
Default.h
Go to the documentation of this file.
1 #pragma once
2 
16 #include <smtrat-solver/Manager.h>
17 
18 namespace smtrat {
19 
20 /**
21  * The default SMT-RAT strategy.
22  *
23  * For QF_NRA, MCSAT is used. For all other quantifier-free logics (QF_LRA, QF_LIRA, QF_NIRA, QF_NIA, QF_LIA), the classical SMT framework is employed. For NRA, we use CoveringNG.
24  *
25  * @author
26  * @since
27  * @version
28  *
29  */
30 class Default : public Manager {
31  static bool condition_lra(carl::Condition condition) {
32  return (!(carl::PROP_CONTAINS_NONLINEAR_POLYNOMIAL <= condition) && !(carl::PROP_CONTAINS_INTEGER_VALUED_VARS <= condition));
33  }
34 
35  static bool condition_nra(carl::Condition condition) {
36  return ((carl::PROP_CONTAINS_NONLINEAR_POLYNOMIAL <= condition) && !(carl::PROP_CONTAINS_INTEGER_VALUED_VARS <= condition));
37  }
38 
39  static bool condition_lira(carl::Condition condition) {
40  return (!(carl::PROP_CONTAINS_NONLINEAR_POLYNOMIAL <= condition) && (carl::PROP_CONTAINS_INTEGER_VALUED_VARS <= condition));
41  }
42 
43  static bool condition_nira(carl::Condition condition) {
44  return ((carl::PROP_CONTAINS_NONLINEAR_POLYNOMIAL <= condition) && (carl::PROP_CONTAINS_INTEGER_VALUED_VARS <= condition));
45  }
46 
47  static bool condition_quantifier_free(carl::Condition condition) {
48  return (!(carl::PROP_CONTAINS_QUANTIFIER_EXISTS <= condition) && !(carl::PROP_CONTAINS_QUANTIFIER_FORALL <= condition));
49  }
50 
51  static bool condition_non_quantifier_free(carl::Condition condition) {
52  return !condition_quantifier_free(condition);
53  }
54 
55  static bool condition_qf_lra(carl::Condition condition) {
56  return condition_quantifier_free(condition) && condition_lra(condition);
57  }
58 
59  static bool condition_qf_nra(carl::Condition condition) {
60  return condition_quantifier_free(condition) && condition_nra(condition);
61  }
62 
63  static bool condition_qf_lira(carl::Condition condition) {
64  return condition_quantifier_free(condition) && condition_lira(condition);
65  }
66 
67  static bool condition_qf_nira(carl::Condition condition) {
68  return condition_quantifier_free(condition) && condition_nira(condition);
69  }
70 
71  static bool condition_nonqf_ra(carl::Condition condition) {
72  return !condition_quantifier_free(condition) && (condition_lra(condition) || condition_nra(condition));
73  }
74 
75  static bool condition_conjunction(carl::Condition condition) {
76  return ((carl::PROP_IS_LITERAL_CONJUNCTION <= condition));
77  }
78 
79  static bool condition_noconjunction(carl::Condition condition) {
80  return (!(carl::PROP_IS_LITERAL_CONJUNCTION <= condition));
81  }
82 
83  public:
84 
85  Default() : Manager() {
86  setStrategy({
87  addBackend<FPPModule<FPPSettings1>>({
88  addBackend<IncWidthModule<IncWidthSettings1>>({
89  addBackend<IntBlastModule<IntBlastSettings2>>({
90  addBackend<SATModule<SATSettings1>>({
91  addBackend<LRAModule<LRASettings1>>({
92  addBackend<VSModule<VSSettings234>>({
93  addBackend<NewCoveringModule<NewCoveringSettings2>>({
94  addBackend<NewCADModule<NewCADSettingsFOS>>()
95  })
96  })
97  })
98  })
99  })
100  })
101  }).condition( &condition_qf_nira ),
102  addBackend<FPPModule<FPPSettings1>>({
103  addBackend<STropModule<STropSettings3>>({
104  addBackend<SATModule<SATSettingsMCSATDefault>>()
105  })
106  }).condition( &condition_qf_nra ),
107  addBackend<FPPModule<FPPSettings1>>({
108  addBackend<SATModule<SATSettings1>>({
109  addBackend<CubeLIAModule<CubeLIASettings1>>({
110  addBackend<LRAModule<LRASettings1>>()
111  })
112  }).condition( &condition_conjunction ),
113  addBackend<SATModule<SATSettings1>>({
114  addBackend<LRAModule<LRASettings1>>()
115  }).condition( &condition_noconjunction )
116  }).condition( &condition_qf_lira ),
117  addBackend<FPPModule<FPPSettings1>>({
118  addBackend<SATModule<SATSettings1>>({
119  addBackend<LRAModule<LRASettings1>>()
120  })
121  }).condition( &condition_qf_lra ),
122  addBackend<PNFerModule>({
123  addBackend<CoveringNGModule<CoveringNGSettingsDefault>>().condition( &condition_non_quantifier_free ),
124  addBackend<FPPModule<FPPSettings1>>({ // default QF_NRA solver
125  addBackend<STropModule<STropSettings3>>({
126  addBackend<SATModule<SATSettingsMCSATDefault>>()
127  })
128  }).condition( &condition_quantifier_free )
129  }).condition( &condition_nonqf_ra ),
130  });
131  }
132 };
133 
134 } // namespace smtrat
The default SMT-RAT strategy.
Definition: Default.h:30
static bool condition_qf_lira(carl::Condition condition)
Definition: Default.h:63
static bool condition_nira(carl::Condition condition)
Definition: Default.h:43
static bool condition_non_quantifier_free(carl::Condition condition)
Definition: Default.h:51
static bool condition_qf_nra(carl::Condition condition)
Definition: Default.h:59
static bool condition_quantifier_free(carl::Condition condition)
Definition: Default.h:47
static bool condition_lira(carl::Condition condition)
Definition: Default.h:39
static bool condition_nra(carl::Condition condition)
Definition: Default.h:35
static bool condition_qf_lra(carl::Condition condition)
Definition: Default.h:55
static bool condition_nonqf_ra(carl::Condition condition)
Definition: Default.h:71
static bool condition_conjunction(carl::Condition condition)
Definition: Default.h:75
static bool condition_lra(carl::Condition condition)
Definition: Default.h:31
static bool condition_noconjunction(carl::Condition condition)
Definition: Default.h:79
static bool condition_qf_nira(carl::Condition condition)
Definition: Default.h:67
Base class for solvers.
Definition: Manager.h:34
void setStrategy(const std::initializer_list< BackendLink > &backends)
Definition: Manager.h:385
Class to create the formulas for axioms.